Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
3c4f437c
Unverified
Commit
3c4f437c
authored
Aug 15, 2018
by
Gennadiy Civil
Committed by
GitHub
Aug 15, 2018
Browse files
Merge branch 'master' into master
parents
87a37c60
997d343d
Changes
174
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
13 additions
and
47 deletions
+13
-47
googletest/samples/sample1.cc
googletest/samples/sample1.cc
+0
-2
googletest/samples/sample1.h
googletest/samples/sample1.h
+0
-2
googletest/samples/sample10_unittest.cc
googletest/samples/sample10_unittest.cc
+1
-2
googletest/samples/sample1_unittest.cc
googletest/samples/sample1_unittest.cc
+0
-3
googletest/samples/sample2.cc
googletest/samples/sample2.cc
+0
-2
googletest/samples/sample2.h
googletest/samples/sample2.h
+0
-2
googletest/samples/sample2_unittest.cc
googletest/samples/sample2_unittest.cc
+0
-3
googletest/samples/sample3-inl.h
googletest/samples/sample3-inl.h
+0
-2
googletest/samples/sample3_unittest.cc
googletest/samples/sample3_unittest.cc
+0
-3
googletest/samples/sample4.cc
googletest/samples/sample4.cc
+0
-2
googletest/samples/sample4.h
googletest/samples/sample4.h
+0
-3
googletest/samples/sample4_unittest.cc
googletest/samples/sample4_unittest.cc
+1
-2
googletest/samples/sample5_unittest.cc
googletest/samples/sample5_unittest.cc
+1
-2
googletest/samples/sample6_unittest.cc
googletest/samples/sample6_unittest.cc
+1
-2
googletest/samples/sample7_unittest.cc
googletest/samples/sample7_unittest.cc
+1
-2
googletest/samples/sample8_unittest.cc
googletest/samples/sample8_unittest.cc
+1
-2
googletest/samples/sample9_unittest.cc
googletest/samples/sample9_unittest.cc
+1
-2
googletest/src/gtest-all.cc
googletest/src/gtest-all.cc
+1
-2
googletest/src/gtest-death-test.cc
googletest/src/gtest-death-test.cc
+3
-5
googletest/src/gtest-filepath.cc
googletest/src/gtest-filepath.cc
+2
-2
No files found.
googletest/samples/sample1.cc
View file @
3c4f437c
...
@@ -28,8 +28,6 @@
...
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
// A sample program demonstrating using Google C++ testing framework.
//
// Author: wan@google.com (Zhanyong Wan)
#include "sample1.h"
#include "sample1.h"
...
...
googletest/samples/sample1.h
View file @
3c4f437c
...
@@ -28,8 +28,6 @@
...
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
// A sample program demonstrating using Google C++ testing framework.
//
// Author: wan@google.com (Zhanyong Wan)
#ifndef GTEST_SAMPLES_SAMPLE1_H_
#ifndef GTEST_SAMPLES_SAMPLE1_H_
#define GTEST_SAMPLES_SAMPLE1_H_
#define GTEST_SAMPLES_SAMPLE1_H_
...
...
googletest/samples/sample10_unittest.cc
View file @
3c4f437c
...
@@ -25,8 +25,7 @@
...
@@ -25,8 +25,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: vladl@google.com (Vlad Losev)
// This sample shows how to use Google Test listener API to implement
// This sample shows how to use Google Test listener API to implement
// a primitive leak checker.
// a primitive leak checker.
...
...
googletest/samples/sample1_unittest.cc
View file @
3c4f437c
...
@@ -28,9 +28,6 @@
...
@@ -28,9 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
// A sample program demonstrating using Google C++ testing framework.
//
// Author: wan@google.com (Zhanyong Wan)
// This sample shows how to write a simple unit test for a function,
// This sample shows how to write a simple unit test for a function,
// using Google C++ testing framework.
// using Google C++ testing framework.
...
...
googletest/samples/sample2.cc
View file @
3c4f437c
...
@@ -28,8 +28,6 @@
...
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
// A sample program demonstrating using Google C++ testing framework.
//
// Author: wan@google.com (Zhanyong Wan)
#include "sample2.h"
#include "sample2.h"
...
...
googletest/samples/sample2.h
View file @
3c4f437c
...
@@ -28,8 +28,6 @@
...
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
// A sample program demonstrating using Google C++ testing framework.
//
// Author: wan@google.com (Zhanyong Wan)
#ifndef GTEST_SAMPLES_SAMPLE2_H_
#ifndef GTEST_SAMPLES_SAMPLE2_H_
#define GTEST_SAMPLES_SAMPLE2_H_
#define GTEST_SAMPLES_SAMPLE2_H_
...
...
googletest/samples/sample2_unittest.cc
View file @
3c4f437c
...
@@ -28,9 +28,6 @@
...
@@ -28,9 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
// A sample program demonstrating using Google C++ testing framework.
//
// Author: wan@google.com (Zhanyong Wan)
// This sample shows how to write a more complex unit test for a class
// This sample shows how to write a more complex unit test for a class
// that has multiple member functions.
// that has multiple member functions.
...
...
googletest/samples/sample3-inl.h
View file @
3c4f437c
...
@@ -28,8 +28,6 @@
...
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
// A sample program demonstrating using Google C++ testing framework.
//
// Author: wan@google.com (Zhanyong Wan)
#ifndef GTEST_SAMPLES_SAMPLE3_INL_H_
#ifndef GTEST_SAMPLES_SAMPLE3_INL_H_
#define GTEST_SAMPLES_SAMPLE3_INL_H_
#define GTEST_SAMPLES_SAMPLE3_INL_H_
...
...
googletest/samples/sample3_unittest.cc
View file @
3c4f437c
...
@@ -28,9 +28,6 @@
...
@@ -28,9 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
// A sample program demonstrating using Google C++ testing framework.
//
// Author: wan@google.com (Zhanyong Wan)
// In this example, we use a more advanced feature of Google Test called
// In this example, we use a more advanced feature of Google Test called
// test fixture.
// test fixture.
...
...
googletest/samples/sample4.cc
View file @
3c4f437c
...
@@ -28,8 +28,6 @@
...
@@ -28,8 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
// A sample program demonstrating using Google C++ testing framework.
//
// Author: wan@google.com (Zhanyong Wan)
#include <stdio.h>
#include <stdio.h>
...
...
googletest/samples/sample4.h
View file @
3c4f437c
...
@@ -28,9 +28,6 @@
...
@@ -28,9 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
// A sample program demonstrating using Google C++ testing framework.
//
// Author: wan@google.com (Zhanyong Wan)
#ifndef GTEST_SAMPLES_SAMPLE4_H_
#ifndef GTEST_SAMPLES_SAMPLE4_H_
#define GTEST_SAMPLES_SAMPLE4_H_
#define GTEST_SAMPLES_SAMPLE4_H_
...
...
googletest/samples/sample4_unittest.cc
View file @
3c4f437c
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include "sample4.h"
#include "sample4.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
...
...
googletest/samples/sample5_unittest.cc
View file @
3c4f437c
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// This sample teaches how to reuse a test fixture in multiple test
// This sample teaches how to reuse a test fixture in multiple test
// cases by deriving sub-fixtures from it.
// cases by deriving sub-fixtures from it.
...
...
googletest/samples/sample6_unittest.cc
View file @
3c4f437c
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// This sample shows how to test common properties of multiple
// This sample shows how to test common properties of multiple
// implementations of the same interface (aka interface tests).
// implementations of the same interface (aka interface tests).
...
...
googletest/samples/sample7_unittest.cc
View file @
3c4f437c
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: vladl@google.com (Vlad Losev)
// This sample shows how to test common properties of multiple
// This sample shows how to test common properties of multiple
// implementations of an interface (aka interface tests) using
// implementations of an interface (aka interface tests) using
...
...
googletest/samples/sample8_unittest.cc
View file @
3c4f437c
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: vladl@google.com (Vlad Losev)
// This sample shows how to test code relying on some global flag variables.
// This sample shows how to test code relying on some global flag variables.
// Combine() helps with generating all possible combinations of such flags,
// Combine() helps with generating all possible combinations of such flags,
...
...
googletest/samples/sample9_unittest.cc
View file @
3c4f437c
...
@@ -25,8 +25,7 @@
...
@@ -25,8 +25,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: vladl@google.com (Vlad Losev)
// This sample shows how to use Google Test listener API to implement
// This sample shows how to use Google Test listener API to implement
// an alternative console output and how to use the UnitTest reflection API
// an alternative console output and how to use the UnitTest reflection API
...
...
googletest/src/gtest-all.cc
View file @
3c4f437c
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: mheule@google.com (Markus Heule)
//
//
// Google C++ Testing and Mocking Framework (Google Test)
// Google C++ Testing and Mocking Framework (Google Test)
//
//
...
...
googletest/src/gtest-death-test.cc
View file @
3c4f437c
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
//
//
// This file implements death tests.
// This file implements death tests.
...
@@ -267,7 +266,7 @@ static const int kFuchsiaReadPipeFd = 3;
...
@@ -267,7 +266,7 @@ static const int kFuchsiaReadPipeFd = 3;
// statement, which is not allowed; THREW means that the test statement
// statement, which is not allowed; THREW means that the test statement
// returned control by throwing an exception. IN_PROGRESS means the test
// returned control by throwing an exception. IN_PROGRESS means the test
// has not yet concluded.
// has not yet concluded.
//
TODO(vladl@google.com)
: Unify names and possibly values for
//
FIXME
: Unify names and possibly values for
// AbortReason, DeathTestOutcome, and flag characters above.
// AbortReason, DeathTestOutcome, and flag characters above.
enum
DeathTestOutcome
{
IN_PROGRESS
,
DIED
,
LIVED
,
RETURNED
,
THREW
};
enum
DeathTestOutcome
{
IN_PROGRESS
,
DIED
,
LIVED
,
RETURNED
,
THREW
};
...
@@ -582,7 +581,6 @@ bool DeathTestImpl::Passed(bool status_ok) {
...
@@ -582,7 +581,6 @@ bool DeathTestImpl::Passed(bool status_ok) {
if
(
status_ok
)
{
if
(
status_ok
)
{
# if GTEST_USES_PCRE
# if GTEST_USES_PCRE
// PCRE regexes support embedded NULs.
// PCRE regexes support embedded NULs.
// GTEST_USES_PCRE is defined only in google3 mode
const
bool
matched
=
RE
::
PartialMatch
(
error_message
,
*
regex
());
const
bool
matched
=
RE
::
PartialMatch
(
error_message
,
*
regex
());
# else
# else
const
bool
matched
=
RE
::
PartialMatch
(
error_message
.
c_str
(),
*
regex
());
const
bool
matched
=
RE
::
PartialMatch
(
error_message
.
c_str
(),
*
regex
());
...
@@ -1460,7 +1458,7 @@ static int GetStatusFileDescriptor(unsigned int parent_process_id,
...
@@ -1460,7 +1458,7 @@ static int GetStatusFileDescriptor(unsigned int parent_process_id,
StreamableToString
(
parent_process_id
));
StreamableToString
(
parent_process_id
));
}
}
//
TODO(vladl@google.com)
: Replace the following check with a
//
FIXME
: Replace the following check with a
// compile-time assertion when available.
// compile-time assertion when available.
GTEST_CHECK_
(
sizeof
(
HANDLE
)
<=
sizeof
(
size_t
));
GTEST_CHECK_
(
sizeof
(
HANDLE
)
<=
sizeof
(
size_t
));
...
...
googletest/src/gtest-filepath.cc
View file @
3c4f437c
...
@@ -250,7 +250,7 @@ bool FilePath::DirectoryExists() const {
...
@@ -250,7 +250,7 @@ bool FilePath::DirectoryExists() const {
// root directory per disk drive.)
// root directory per disk drive.)
bool
FilePath
::
IsRootDirectory
()
const
{
bool
FilePath
::
IsRootDirectory
()
const
{
#if GTEST_OS_WINDOWS
#if GTEST_OS_WINDOWS
//
TODO(wan@google.com)
: on Windows a network share like
//
FIXME
: on Windows a network share like
// \\server\share can be a root directory, although it cannot be the
// \\server\share can be a root directory, although it cannot be the
// current directory. Handle this properly.
// current directory. Handle this properly.
return
pathname_
.
length
()
==
3
&&
IsAbsolutePath
();
return
pathname_
.
length
()
==
3
&&
IsAbsolutePath
();
...
@@ -350,7 +350,7 @@ FilePath FilePath::RemoveTrailingPathSeparator() const {
...
@@ -350,7 +350,7 @@ FilePath FilePath::RemoveTrailingPathSeparator() const {
// Removes any redundant separators that might be in the pathname.
// Removes any redundant separators that might be in the pathname.
// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
// redundancies that might be in a pathname involving "." or "..".
// redundancies that might be in a pathname involving "." or "..".
//
TODO(wan@google.com)
: handle Windows network shares (e.g. \\server\share).
//
FIXME
: handle Windows network shares (e.g. \\server\share).
void
FilePath
::
Normalize
()
{
void
FilePath
::
Normalize
()
{
if
(
pathname_
.
c_str
()
==
NULL
)
{
if
(
pathname_
.
c_str
()
==
NULL
)
{
pathname_
=
""
;
pathname_
=
""
;
...
...
Prev
1
2
3
4
5
6
7
8
9
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment