mirror of
https://github.com/google/googletest.git
synced 2025-01-15 00:47:54 +08:00
Merge branch 'master' into master
This commit is contained in:
commit
89f45180e0
@ -42,8 +42,8 @@ compiler:
|
|||||||
script: ./travis.sh
|
script: ./travis.sh
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
- SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=Debug VERBOSE=1
|
- BUILD_TYPE=Debug VERBOSE=1
|
||||||
- SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11
|
- BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
sudo: false
|
sudo: false
|
||||||
|
@ -217,7 +217,8 @@ The macro can be followed by some optional _clauses_ that provide more informati
|
|||||||
This syntax is designed to make an expectation read like English. For example, you can probably guess that
|
This syntax is designed to make an expectation read like English. For example, you can probably guess that
|
||||||
|
|
||||||
```
|
```
|
||||||
using ::testing::Return;...
|
using ::testing::Return;
|
||||||
|
...
|
||||||
EXPECT_CALL(turtle, GetX())
|
EXPECT_CALL(turtle, GetX())
|
||||||
.Times(5)
|
.Times(5)
|
||||||
.WillOnce(Return(100))
|
.WillOnce(Return(100))
|
||||||
@ -251,7 +252,8 @@ EXPECT_CALL(turtle, Forward(_));
|
|||||||
A list of built-in matchers can be found in the [CheatSheet](CheatSheet.md). For example, here's the `Ge` (greater than or equal) matcher:
|
A list of built-in matchers can be found in the [CheatSheet](CheatSheet.md). For example, here's the `Ge` (greater than or equal) matcher:
|
||||||
|
|
||||||
```
|
```
|
||||||
using ::testing::Ge;...
|
using ::testing::Ge;
|
||||||
|
...
|
||||||
EXPECT_CALL(turtle, Forward(Ge(100)));
|
EXPECT_CALL(turtle, Forward(Ge(100)));
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -280,7 +282,8 @@ First, if the return type of a mock function is a built-in type or a pointer, th
|
|||||||
Second, if a mock function doesn't have a default action, or the default action doesn't suit you, you can specify the action to be taken each time the expectation matches using a series of `WillOnce()` clauses followed by an optional `WillRepeatedly()`. For example,
|
Second, if a mock function doesn't have a default action, or the default action doesn't suit you, you can specify the action to be taken each time the expectation matches using a series of `WillOnce()` clauses followed by an optional `WillRepeatedly()`. For example,
|
||||||
|
|
||||||
```
|
```
|
||||||
using ::testing::Return;...
|
using ::testing::Return;
|
||||||
|
...
|
||||||
EXPECT_CALL(turtle, GetX())
|
EXPECT_CALL(turtle, GetX())
|
||||||
.WillOnce(Return(100))
|
.WillOnce(Return(100))
|
||||||
.WillOnce(Return(200))
|
.WillOnce(Return(200))
|
||||||
@ -290,7 +293,8 @@ EXPECT_CALL(turtle, GetX())
|
|||||||
This says that `turtle.GetX()` will be called _exactly three times_ (Google Mock inferred this from how many `WillOnce()` clauses we've written, since we didn't explicitly write `Times()`), and will return 100, 200, and 300 respectively.
|
This says that `turtle.GetX()` will be called _exactly three times_ (Google Mock inferred this from how many `WillOnce()` clauses we've written, since we didn't explicitly write `Times()`), and will return 100, 200, and 300 respectively.
|
||||||
|
|
||||||
```
|
```
|
||||||
using ::testing::Return;...
|
using ::testing::Return;
|
||||||
|
...
|
||||||
EXPECT_CALL(turtle, GetY())
|
EXPECT_CALL(turtle, GetY())
|
||||||
.WillOnce(Return(100))
|
.WillOnce(Return(100))
|
||||||
.WillOnce(Return(200))
|
.WillOnce(Return(200))
|
||||||
@ -317,7 +321,8 @@ Instead of returning 100, 101, 102, ..., consecutively, this mock function will
|
|||||||
Time for another quiz! What do you think the following means?
|
Time for another quiz! What do you think the following means?
|
||||||
|
|
||||||
```
|
```
|
||||||
using ::testing::Return;...
|
using ::testing::Return;
|
||||||
|
...
|
||||||
EXPECT_CALL(turtle, GetY())
|
EXPECT_CALL(turtle, GetY())
|
||||||
.Times(4)
|
.Times(4)
|
||||||
.WillOnce(Return(100));
|
.WillOnce(Return(100));
|
||||||
@ -331,7 +336,8 @@ So far we've only shown examples where you have a single expectation. More reali
|
|||||||
By default, when a mock method is invoked, Google Mock will search the expectations in the **reverse order** they are defined, and stop when an active expectation that matches the arguments is found (you can think of it as "newer rules override older ones."). If the matching expectation cannot take any more calls, you will get an upper-bound-violated failure. Here's an example:
|
By default, when a mock method is invoked, Google Mock will search the expectations in the **reverse order** they are defined, and stop when an active expectation that matches the arguments is found (you can think of it as "newer rules override older ones."). If the matching expectation cannot take any more calls, you will get an upper-bound-violated failure. Here's an example:
|
||||||
|
|
||||||
```
|
```
|
||||||
using ::testing::_;...
|
using ::testing::_;
|
||||||
|
...
|
||||||
EXPECT_CALL(turtle, Forward(_)); // #1
|
EXPECT_CALL(turtle, Forward(_)); // #1
|
||||||
EXPECT_CALL(turtle, Forward(10)) // #2
|
EXPECT_CALL(turtle, Forward(10)) // #2
|
||||||
.Times(2);
|
.Times(2);
|
||||||
@ -347,7 +353,8 @@ By default, an expectation can match a call even though an earlier expectation h
|
|||||||
Sometimes, you may want all the expected calls to occur in a strict order. To say this in Google Mock is easy:
|
Sometimes, you may want all the expected calls to occur in a strict order. To say this in Google Mock is easy:
|
||||||
|
|
||||||
```
|
```
|
||||||
using ::testing::InSequence;...
|
using ::testing::InSequence;
|
||||||
|
...
|
||||||
TEST(FooTest, DrawsLineSegment) {
|
TEST(FooTest, DrawsLineSegment) {
|
||||||
...
|
...
|
||||||
{
|
{
|
||||||
@ -373,7 +380,8 @@ Now let's do a quick quiz to see how well you can use this mock stuff already. H
|
|||||||
After you've come up with your answer, take a look at ours and compare notes (solve it yourself first - don't cheat!):
|
After you've come up with your answer, take a look at ours and compare notes (solve it yourself first - don't cheat!):
|
||||||
|
|
||||||
```
|
```
|
||||||
using ::testing::_;...
|
using ::testing::_;
|
||||||
|
...
|
||||||
EXPECT_CALL(turtle, GoTo(_, _)) // #1
|
EXPECT_CALL(turtle, GoTo(_, _)) // #1
|
||||||
.Times(AnyNumber());
|
.Times(AnyNumber());
|
||||||
EXPECT_CALL(turtle, GoTo(0, 0)) // #2
|
EXPECT_CALL(turtle, GoTo(0, 0)) // #2
|
||||||
|
@ -27,6 +27,8 @@ option(
|
|||||||
"Build gtest with internal symbols hidden in shared libraries."
|
"Build gtest with internal symbols hidden in shared libraries."
|
||||||
OFF)
|
OFF)
|
||||||
|
|
||||||
|
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Generate debug library name with a postfix.")
|
||||||
|
|
||||||
# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
|
# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
|
||||||
include(cmake/hermetic_build.cmake OPTIONAL)
|
include(cmake/hermetic_build.cmake OPTIONAL)
|
||||||
|
|
||||||
@ -75,9 +77,6 @@ include_directories(
|
|||||||
${gtest_SOURCE_DIR}/include
|
${gtest_SOURCE_DIR}/include
|
||||||
${gtest_SOURCE_DIR})
|
${gtest_SOURCE_DIR})
|
||||||
|
|
||||||
# Where Google Test's libraries can be found.
|
|
||||||
link_directories(${gtest_BINARY_DIR}/src)
|
|
||||||
|
|
||||||
# Summary of tuple support for Microsoft Visual Studio:
|
# Summary of tuple support for Microsoft Visual Studio:
|
||||||
# Compiler version(MS) version(cmake) Support
|
# Compiler version(MS) version(cmake) Support
|
||||||
# ---------- ----------- -------------- -----------------------------
|
# ---------- ----------- -------------- -----------------------------
|
||||||
|
@ -2591,10 +2591,6 @@ std::string StringFromGTestEnv(const char* flag, const char* default_val);
|
|||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
||||||
// Returns a path to temporary directory.
|
|
||||||
// Tries to determine an appropriate directory for the platform.
|
|
||||||
GTEST_API_ std::string TempDir();
|
|
||||||
|
|
||||||
} // namespace testing
|
} // namespace testing
|
||||||
|
|
||||||
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
|
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
using ::testing::EmptyTestEventListener;
|
using ::testing::EmptyTestEventListener;
|
||||||
using ::testing::InitGoogleTest;
|
using ::testing::InitGoogleTest;
|
||||||
using ::testing::Test;
|
using ::testing::Test;
|
||||||
using ::testing::TestCase;
|
|
||||||
using ::testing::TestEventListeners;
|
using ::testing::TestEventListeners;
|
||||||
using ::testing::TestInfo;
|
using ::testing::TestInfo;
|
||||||
using ::testing::TestPartResult;
|
using ::testing::TestPartResult;
|
||||||
|
@ -1313,11 +1313,12 @@ AssertionResult EqFailure(const char* lhs_expression,
|
|||||||
const std::string& rhs_value,
|
const std::string& rhs_value,
|
||||||
bool ignoring_case) {
|
bool ignoring_case) {
|
||||||
Message msg;
|
Message msg;
|
||||||
msg << " Expected: " << lhs_expression;
|
msg << "Expected equality of these values:";
|
||||||
|
msg << "\n " << lhs_expression;
|
||||||
if (lhs_value != lhs_expression) {
|
if (lhs_value != lhs_expression) {
|
||||||
msg << "\n Which is: " << lhs_value;
|
msg << "\n Which is: " << lhs_value;
|
||||||
}
|
}
|
||||||
msg << "\nTo be equal to: " << rhs_expression;
|
msg << "\n " << rhs_expression;
|
||||||
if (rhs_value != rhs_expression) {
|
if (rhs_value != rhs_expression) {
|
||||||
msg << "\n Which is: " << rhs_value;
|
msg << "\n Which is: " << rhs_value;
|
||||||
}
|
}
|
||||||
@ -2569,10 +2570,10 @@ void ReportInvalidTestCaseType(const char* test_case_name,
|
|||||||
<< "probably rename one of the classes to put the tests into different\n"
|
<< "probably rename one of the classes to put the tests into different\n"
|
||||||
<< "test cases.";
|
<< "test cases.";
|
||||||
|
|
||||||
fprintf(stderr, "%s %s",
|
GTEST_LOG_(ERROR)
|
||||||
FormatFileLocation(code_location.file.c_str(),
|
<< FormatFileLocation(code_location.file.c_str(),
|
||||||
code_location.line).c_str(),
|
code_location.line)
|
||||||
errors.GetString().c_str());
|
<< " " << errors.GetString();
|
||||||
}
|
}
|
||||||
#endif // GTEST_HAS_PARAM_TEST
|
#endif // GTEST_HAS_PARAM_TEST
|
||||||
|
|
||||||
@ -3449,9 +3450,7 @@ class XmlUnitTestResultPrinter : public EmptyTestEventListener {
|
|||||||
XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)
|
XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)
|
||||||
: output_file_(output_file) {
|
: output_file_(output_file) {
|
||||||
if (output_file_.c_str() == NULL || output_file_.empty()) {
|
if (output_file_.c_str() == NULL || output_file_.empty()) {
|
||||||
fprintf(stderr, "XML output file may not be null\n");
|
GTEST_LOG_(FATAL) << "XML output file may not be null";
|
||||||
fflush(stderr);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3476,11 +3475,8 @@ void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
|
|||||||
// 3. To interpret the meaning of errno in a thread-safe way,
|
// 3. To interpret the meaning of errno in a thread-safe way,
|
||||||
// we need the strerror_r() function, which is not available on
|
// we need the strerror_r() function, which is not available on
|
||||||
// Windows.
|
// Windows.
|
||||||
fprintf(stderr,
|
GTEST_LOG_(FATAL) << "Unable to open file \""
|
||||||
"Unable to open file \"%s\"\n",
|
<< output_file_ << "\"";
|
||||||
output_file_.c_str());
|
|
||||||
fflush(stderr);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
}
|
||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
PrintXmlUnitTest(&stream, unit_test);
|
PrintXmlUnitTest(&stream, unit_test);
|
||||||
@ -4431,9 +4427,9 @@ void UnitTestImpl::ConfigureXmlOutput() {
|
|||||||
listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter(
|
listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter(
|
||||||
UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));
|
UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));
|
||||||
} else if (output_format != "") {
|
} else if (output_format != "") {
|
||||||
printf("WARNING: unrecognized output format \"%s\" ignored.\n",
|
GTEST_LOG_(WARNING) << "WARNING: unrecognized output format \""
|
||||||
output_format.c_str());
|
<< output_format
|
||||||
fflush(stdout);
|
<< "\" ignored.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4448,9 +4444,9 @@ void UnitTestImpl::ConfigureStreamingOutput() {
|
|||||||
listeners()->Append(new StreamingListener(target.substr(0, pos),
|
listeners()->Append(new StreamingListener(target.substr(0, pos),
|
||||||
target.substr(pos+1)));
|
target.substr(pos+1)));
|
||||||
} else {
|
} else {
|
||||||
printf("WARNING: unrecognized streaming target \"%s\" ignored.\n",
|
GTEST_LOG_(WARNING) << "unrecognized streaming target \""
|
||||||
target.c_str());
|
<< target
|
||||||
fflush(stdout);
|
<< "\" ignored.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4579,9 +4575,9 @@ static void TearDownEnvironment(Environment* env) { env->TearDown(); }
|
|||||||
bool UnitTestImpl::RunAllTests() {
|
bool UnitTestImpl::RunAllTests() {
|
||||||
// Makes sure InitGoogleTest() was called.
|
// Makes sure InitGoogleTest() was called.
|
||||||
if (!GTestIsInitialized()) {
|
if (!GTestIsInitialized()) {
|
||||||
printf("%s",
|
GTEST_LOG_(ERROR) <<
|
||||||
"\nThis test program did NOT call ::testing::InitGoogleTest "
|
"\nThis test program did NOT call ::testing::InitGoogleTest "
|
||||||
"before calling RUN_ALL_TESTS(). Please fix it.\n");
|
"before calling RUN_ALL_TESTS(). Please fix it.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5281,11 +5277,9 @@ bool ParseGoogleTestFlag(const char* const arg) {
|
|||||||
void LoadFlagsFromFile(const std::string& path) {
|
void LoadFlagsFromFile(const std::string& path) {
|
||||||
FILE* flagfile = posix::FOpen(path.c_str(), "r");
|
FILE* flagfile = posix::FOpen(path.c_str(), "r");
|
||||||
if (!flagfile) {
|
if (!flagfile) {
|
||||||
fprintf(stderr,
|
GTEST_LOG_(FATAL) << "Unable to open file \""
|
||||||
"Unable to open file \"%s\"\n",
|
<< GTEST_FLAG(flagfile)
|
||||||
GTEST_FLAG(flagfile).c_str());
|
<< "\"";
|
||||||
fflush(stderr);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
}
|
||||||
std::string contents(ReadEntireFile(flagfile));
|
std::string contents(ReadEntireFile(flagfile));
|
||||||
posix::FClose(flagfile);
|
posix::FClose(flagfile);
|
||||||
|
@ -5,8 +5,9 @@ Value of: false
|
|||||||
Actual: false
|
Actual: false
|
||||||
Expected: true
|
Expected: true
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 2
|
Expected equality of these values:
|
||||||
To be equal to: 3
|
2
|
||||||
|
3
|
||||||
[0;32m[==========] [mRunning 66 tests from 29 test cases.
|
[0;32m[==========] [mRunning 66 tests from 29 test cases.
|
||||||
[0;32m[----------] [mGlobal test environment set-up.
|
[0;32m[----------] [mGlobal test environment set-up.
|
||||||
FooEnvironment::SetUp() called.
|
FooEnvironment::SetUp() called.
|
||||||
@ -34,21 +35,24 @@ BarEnvironment::SetUp() called.
|
|||||||
[0;32m[----------] [m2 tests from NonfatalFailureTest
|
[0;32m[----------] [m2 tests from NonfatalFailureTest
|
||||||
[0;32m[ RUN ] [mNonfatalFailureTest.EscapesStringOperands
|
[0;32m[ RUN ] [mNonfatalFailureTest.EscapesStringOperands
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: kGoldenString
|
Expected equality of these values:
|
||||||
|
kGoldenString
|
||||||
Which is: "\"Line"
|
Which is: "\"Line"
|
||||||
To be equal to: actual
|
actual
|
||||||
Which is: "actual \"string\""
|
Which is: "actual \"string\""
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: golden
|
Expected equality of these values:
|
||||||
|
golden
|
||||||
Which is: "\"Line"
|
Which is: "\"Line"
|
||||||
To be equal to: actual
|
actual
|
||||||
Which is: "actual \"string\""
|
Which is: "actual \"string\""
|
||||||
[0;31m[ FAILED ] [mNonfatalFailureTest.EscapesStringOperands
|
[0;31m[ FAILED ] [mNonfatalFailureTest.EscapesStringOperands
|
||||||
[0;32m[ RUN ] [mNonfatalFailureTest.DiffForLongStrings
|
[0;32m[ RUN ] [mNonfatalFailureTest.DiffForLongStrings
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: golden_str
|
Expected equality of these values:
|
||||||
|
golden_str
|
||||||
Which is: "\"Line\0 1\"\nLine 2"
|
Which is: "\"Line\0 1\"\nLine 2"
|
||||||
To be equal to: "Line 2"
|
"Line 2"
|
||||||
With diff:
|
With diff:
|
||||||
@@ -1,2 @@
|
@@ -1,2 @@
|
||||||
-\"Line\0 1\"
|
-\"Line\0 1\"
|
||||||
@ -59,15 +63,17 @@ With diff:
|
|||||||
[0;32m[ RUN ] [mFatalFailureTest.FatalFailureInSubroutine
|
[0;32m[ RUN ] [mFatalFailureTest.FatalFailureInSubroutine
|
||||||
(expecting a failure that x should be 1)
|
(expecting a failure that x should be 1)
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 1
|
Expected equality of these values:
|
||||||
To be equal to: x
|
1
|
||||||
|
x
|
||||||
Which is: 2
|
Which is: 2
|
||||||
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInSubroutine
|
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInSubroutine
|
||||||
[0;32m[ RUN ] [mFatalFailureTest.FatalFailureInNestedSubroutine
|
[0;32m[ RUN ] [mFatalFailureTest.FatalFailureInNestedSubroutine
|
||||||
(expecting a failure that x should be 1)
|
(expecting a failure that x should be 1)
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 1
|
Expected equality of these values:
|
||||||
To be equal to: x
|
1
|
||||||
|
x
|
||||||
Which is: 2
|
Which is: 2
|
||||||
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInNestedSubroutine
|
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInNestedSubroutine
|
||||||
[0;32m[ RUN ] [mFatalFailureTest.NonfatalFailureInSubroutine
|
[0;32m[ RUN ] [mFatalFailureTest.NonfatalFailureInSubroutine
|
||||||
@ -107,14 +113,16 @@ This failure is expected, and shouldn't have a trace.
|
|||||||
[0;32m[ RUN ] [mSCOPED_TRACETest.WorksInLoop
|
[0;32m[ RUN ] [mSCOPED_TRACETest.WorksInLoop
|
||||||
(expected to fail)
|
(expected to fail)
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 2
|
Expected equality of these values:
|
||||||
To be equal to: n
|
2
|
||||||
|
n
|
||||||
Which is: 1
|
Which is: 1
|
||||||
Google Test trace:
|
Google Test trace:
|
||||||
gtest_output_test_.cc:#: i = 1
|
gtest_output_test_.cc:#: i = 1
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 1
|
Expected equality of these values:
|
||||||
To be equal to: n
|
1
|
||||||
|
n
|
||||||
Which is: 2
|
Which is: 2
|
||||||
Google Test trace:
|
Google Test trace:
|
||||||
gtest_output_test_.cc:#: i = 2
|
gtest_output_test_.cc:#: i = 2
|
||||||
@ -122,14 +130,16 @@ gtest_output_test_.cc:#: i = 2
|
|||||||
[0;32m[ RUN ] [mSCOPED_TRACETest.WorksInSubroutine
|
[0;32m[ RUN ] [mSCOPED_TRACETest.WorksInSubroutine
|
||||||
(expected to fail)
|
(expected to fail)
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 2
|
Expected equality of these values:
|
||||||
To be equal to: n
|
2
|
||||||
|
n
|
||||||
Which is: 1
|
Which is: 1
|
||||||
Google Test trace:
|
Google Test trace:
|
||||||
gtest_output_test_.cc:#: n = 1
|
gtest_output_test_.cc:#: n = 1
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 1
|
Expected equality of these values:
|
||||||
To be equal to: n
|
1
|
||||||
|
n
|
||||||
Which is: 2
|
Which is: 2
|
||||||
Google Test trace:
|
Google Test trace:
|
||||||
gtest_output_test_.cc:#: n = 2
|
gtest_output_test_.cc:#: n = 2
|
||||||
@ -137,8 +147,9 @@ gtest_output_test_.cc:#: n = 2
|
|||||||
[0;32m[ RUN ] [mSCOPED_TRACETest.CanBeNested
|
[0;32m[ RUN ] [mSCOPED_TRACETest.CanBeNested
|
||||||
(expected to fail)
|
(expected to fail)
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 1
|
Expected equality of these values:
|
||||||
To be equal to: n
|
1
|
||||||
|
n
|
||||||
Which is: 2
|
Which is: 2
|
||||||
Google Test trace:
|
Google Test trace:
|
||||||
gtest_output_test_.cc:#: n = 2
|
gtest_output_test_.cc:#: n = 2
|
||||||
@ -437,8 +448,9 @@ Expected: 1 fatal failure
|
|||||||
[0;32m[ OK ] [mTypedTest/0.Success
|
[0;32m[ OK ] [mTypedTest/0.Success
|
||||||
[0;32m[ RUN ] [mTypedTest/0.Failure
|
[0;32m[ RUN ] [mTypedTest/0.Failure
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 1
|
Expected equality of these values:
|
||||||
To be equal to: TypeParam()
|
1
|
||||||
|
TypeParam()
|
||||||
Which is: 0
|
Which is: 0
|
||||||
Expected failure
|
Expected failure
|
||||||
[0;31m[ FAILED ] [mTypedTest/0.Failure, where TypeParam = int
|
[0;31m[ FAILED ] [mTypedTest/0.Failure, where TypeParam = int
|
||||||
@ -447,9 +459,10 @@ Expected failure
|
|||||||
[0;32m[ OK ] [mUnsigned/TypedTestP/0.Success
|
[0;32m[ OK ] [mUnsigned/TypedTestP/0.Success
|
||||||
[0;32m[ RUN ] [mUnsigned/TypedTestP/0.Failure
|
[0;32m[ RUN ] [mUnsigned/TypedTestP/0.Failure
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 1U
|
Expected equality of these values:
|
||||||
|
1U
|
||||||
Which is: 1
|
Which is: 1
|
||||||
To be equal to: TypeParam()
|
TypeParam()
|
||||||
Which is: '\0'
|
Which is: '\0'
|
||||||
Expected failure
|
Expected failure
|
||||||
[0;31m[ FAILED ] [mUnsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
|
[0;31m[ FAILED ] [mUnsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
|
||||||
@ -458,9 +471,10 @@ Expected failure
|
|||||||
[0;32m[ OK ] [mUnsigned/TypedTestP/1.Success
|
[0;32m[ OK ] [mUnsigned/TypedTestP/1.Success
|
||||||
[0;32m[ RUN ] [mUnsigned/TypedTestP/1.Failure
|
[0;32m[ RUN ] [mUnsigned/TypedTestP/1.Failure
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 1U
|
Expected equality of these values:
|
||||||
|
1U
|
||||||
Which is: 1
|
Which is: 1
|
||||||
To be equal to: TypeParam()
|
TypeParam()
|
||||||
Which is: 0
|
Which is: 0
|
||||||
Expected failure
|
Expected failure
|
||||||
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
|
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
|
||||||
@ -597,8 +611,9 @@ Expected non-fatal failure.
|
|||||||
[0;32m[----------] [m1 test from PrintingFailingParams/FailingParamTest
|
[0;32m[----------] [m1 test from PrintingFailingParams/FailingParamTest
|
||||||
[0;32m[ RUN ] [mPrintingFailingParams/FailingParamTest.Fails/0
|
[0;32m[ RUN ] [mPrintingFailingParams/FailingParamTest.Fails/0
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 1
|
Expected equality of these values:
|
||||||
To be equal to: GetParam()
|
1
|
||||||
|
GetParam()
|
||||||
Which is: 2
|
Which is: 2
|
||||||
[0;31m[ FAILED ] [mPrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
|
[0;31m[ FAILED ] [mPrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
|
||||||
[0;32m[----------] [m2 tests from PrintingStrings/ParamTest
|
[0;32m[----------] [m2 tests from PrintingStrings/ParamTest
|
||||||
@ -606,8 +621,9 @@ To be equal to: GetParam()
|
|||||||
[0;32m[ OK ] [mPrintingStrings/ParamTest.Success/a
|
[0;32m[ OK ] [mPrintingStrings/ParamTest.Success/a
|
||||||
[0;32m[ RUN ] [mPrintingStrings/ParamTest.Failure/a
|
[0;32m[ RUN ] [mPrintingStrings/ParamTest.Failure/a
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: "b"
|
Expected equality of these values:
|
||||||
To be equal to: GetParam()
|
"b"
|
||||||
|
GetParam()
|
||||||
Which is: "a"
|
Which is: "a"
|
||||||
Expected failure
|
Expected failure
|
||||||
[0;31m[ FAILED ] [mPrintingStrings/ParamTest.Failure/a, where GetParam() = "a"
|
[0;31m[ FAILED ] [mPrintingStrings/ParamTest.Failure/a, where GetParam() = "a"
|
||||||
@ -678,15 +694,17 @@ Expected fatal failure.
|
|||||||
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
|
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
|
||||||
(expecting a failure that x should be 1)
|
(expecting a failure that x should be 1)
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 1
|
Expected equality of these values:
|
||||||
To be equal to: x
|
1
|
||||||
|
x
|
||||||
Which is: 2
|
Which is: 2
|
||||||
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine (? ms)
|
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine (? ms)
|
||||||
[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
|
[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
|
||||||
(expecting a failure that x should be 1)
|
(expecting a failure that x should be 1)
|
||||||
gtest_output_test_.cc:#: Failure
|
gtest_output_test_.cc:#: Failure
|
||||||
Expected: 1
|
Expected equality of these values:
|
||||||
To be equal to: x
|
1
|
||||||
|
x
|
||||||
Which is: 2
|
Which is: 2
|
||||||
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine (? ms)
|
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine (? ms)
|
||||||
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
|
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
|
||||||
|
@ -2429,8 +2429,9 @@ TEST(StringAssertionTest, ASSERT_STREQ) {
|
|||||||
const char p2[] = "good";
|
const char p2[] = "good";
|
||||||
ASSERT_STREQ(p1, p2);
|
ASSERT_STREQ(p1, p2);
|
||||||
|
|
||||||
EXPECT_FATAL_FAILURE(ASSERT_STREQ("bad", "good"),
|
EXPECT_FATAL_FAILURE(
|
||||||
"Expected: \"bad\"");
|
ASSERT_STREQ("bad", "good"),
|
||||||
|
"Expected equality of these values:\n \"bad\"\n \"good\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests ASSERT_STREQ with NULL arguments.
|
// Tests ASSERT_STREQ with NULL arguments.
|
||||||
@ -3528,9 +3529,10 @@ TEST(AssertionTest, EqFailure) {
|
|||||||
EqFailure("foo", "bar", foo_val, bar_val, false)
|
EqFailure("foo", "bar", foo_val, bar_val, false)
|
||||||
.failure_message());
|
.failure_message());
|
||||||
EXPECT_STREQ(
|
EXPECT_STREQ(
|
||||||
" Expected: foo\n"
|
"Expected equality of these values:\n"
|
||||||
|
" foo\n"
|
||||||
" Which is: 5\n"
|
" Which is: 5\n"
|
||||||
"To be equal to: bar\n"
|
" bar\n"
|
||||||
" Which is: 6",
|
" Which is: 6",
|
||||||
msg1.c_str());
|
msg1.c_str());
|
||||||
|
|
||||||
@ -3538,25 +3540,28 @@ TEST(AssertionTest, EqFailure) {
|
|||||||
EqFailure("foo", "6", foo_val, bar_val, false)
|
EqFailure("foo", "6", foo_val, bar_val, false)
|
||||||
.failure_message());
|
.failure_message());
|
||||||
EXPECT_STREQ(
|
EXPECT_STREQ(
|
||||||
" Expected: foo\n"
|
"Expected equality of these values:\n"
|
||||||
|
" foo\n"
|
||||||
" Which is: 5\n"
|
" Which is: 5\n"
|
||||||
"To be equal to: 6",
|
" 6",
|
||||||
msg2.c_str());
|
msg2.c_str());
|
||||||
|
|
||||||
const std::string msg3(
|
const std::string msg3(
|
||||||
EqFailure("5", "bar", foo_val, bar_val, false)
|
EqFailure("5", "bar", foo_val, bar_val, false)
|
||||||
.failure_message());
|
.failure_message());
|
||||||
EXPECT_STREQ(
|
EXPECT_STREQ(
|
||||||
" Expected: 5\n"
|
"Expected equality of these values:\n"
|
||||||
"To be equal to: bar\n"
|
" 5\n"
|
||||||
|
" bar\n"
|
||||||
" Which is: 6",
|
" Which is: 6",
|
||||||
msg3.c_str());
|
msg3.c_str());
|
||||||
|
|
||||||
const std::string msg4(
|
const std::string msg4(
|
||||||
EqFailure("5", "6", foo_val, bar_val, false).failure_message());
|
EqFailure("5", "6", foo_val, bar_val, false).failure_message());
|
||||||
EXPECT_STREQ(
|
EXPECT_STREQ(
|
||||||
" Expected: 5\n"
|
"Expected equality of these values:\n"
|
||||||
"To be equal to: 6",
|
" 5\n"
|
||||||
|
" 6",
|
||||||
msg4.c_str());
|
msg4.c_str());
|
||||||
|
|
||||||
const std::string msg5(
|
const std::string msg5(
|
||||||
@ -3564,9 +3569,10 @@ TEST(AssertionTest, EqFailure) {
|
|||||||
std::string("\"x\""), std::string("\"y\""),
|
std::string("\"x\""), std::string("\"y\""),
|
||||||
true).failure_message());
|
true).failure_message());
|
||||||
EXPECT_STREQ(
|
EXPECT_STREQ(
|
||||||
" Expected: foo\n"
|
"Expected equality of these values:\n"
|
||||||
|
" foo\n"
|
||||||
" Which is: \"x\"\n"
|
" Which is: \"x\"\n"
|
||||||
"To be equal to: bar\n"
|
" bar\n"
|
||||||
" Which is: \"y\"\n"
|
" Which is: \"y\"\n"
|
||||||
"Ignoring case",
|
"Ignoring case",
|
||||||
msg5.c_str());
|
msg5.c_str());
|
||||||
@ -3580,10 +3586,11 @@ TEST(AssertionTest, EqFailureWithDiff) {
|
|||||||
const std::string msg1(
|
const std::string msg1(
|
||||||
EqFailure("left", "right", left, right, false).failure_message());
|
EqFailure("left", "right", left, right, false).failure_message());
|
||||||
EXPECT_STREQ(
|
EXPECT_STREQ(
|
||||||
" Expected: left\n"
|
"Expected equality of these values:\n"
|
||||||
|
" left\n"
|
||||||
" Which is: "
|
" Which is: "
|
||||||
"1\\n2XXX\\n3\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12XXX\\n13\\n14\\n15\n"
|
"1\\n2XXX\\n3\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12XXX\\n13\\n14\\n15\n"
|
||||||
"To be equal to: right\n"
|
" right\n"
|
||||||
" Which is: 1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n11\\n12\\n13\\n14\n"
|
" Which is: 1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n11\\n12\\n13\\n14\n"
|
||||||
"With diff:\n@@ -1,5 +1,6 @@\n 1\n-2XXX\n+2\n 3\n+4\n 5\n 6\n"
|
"With diff:\n@@ -1,5 +1,6 @@\n 1\n-2XXX\n+2\n 3\n+4\n 5\n 6\n"
|
||||||
"@@ -7,8 +8,6 @@\n 8\n 9\n-10\n 11\n-12XXX\n+12\n 13\n 14\n-15\n",
|
"@@ -7,8 +8,6 @@\n 8\n 9\n-10\n 11\n-12XXX\n+12\n 13\n 14\n-15\n",
|
||||||
@ -3679,8 +3686,9 @@ TEST(ExpectTest, ASSERT_EQ_Double) {
|
|||||||
TEST(AssertionTest, ASSERT_EQ) {
|
TEST(AssertionTest, ASSERT_EQ) {
|
||||||
ASSERT_EQ(5, 2 + 3);
|
ASSERT_EQ(5, 2 + 3);
|
||||||
EXPECT_FATAL_FAILURE(ASSERT_EQ(5, 2*3),
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(5, 2*3),
|
||||||
" Expected: 5\n"
|
"Expected equality of these values:\n"
|
||||||
"To be equal to: 2*3\n"
|
" 5\n"
|
||||||
|
" 2*3\n"
|
||||||
" Which is: 6");
|
" Which is: 6");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3698,7 +3706,7 @@ TEST(AssertionTest, ASSERT_EQ_NULL) {
|
|||||||
// A failure.
|
// A failure.
|
||||||
static int n = 0;
|
static int n = 0;
|
||||||
EXPECT_FATAL_FAILURE(ASSERT_EQ(NULL, &n),
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(NULL, &n),
|
||||||
"To be equal to: &n\n");
|
" &n\n Which is:");
|
||||||
}
|
}
|
||||||
#endif // GTEST_CAN_COMPARE_NULL
|
#endif // GTEST_CAN_COMPARE_NULL
|
||||||
|
|
||||||
@ -3714,7 +3722,7 @@ TEST(ExpectTest, ASSERT_EQ_0) {
|
|||||||
|
|
||||||
// A failure.
|
// A failure.
|
||||||
EXPECT_FATAL_FAILURE(ASSERT_EQ(0, 5.6),
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(0, 5.6),
|
||||||
"Expected: 0");
|
" 0\n 5.6");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests ASSERT_NE.
|
// Tests ASSERT_NE.
|
||||||
@ -3813,7 +3821,7 @@ void TestEq1(int x) {
|
|||||||
// Tests calling a test subroutine that's not part of a fixture.
|
// Tests calling a test subroutine that's not part of a fixture.
|
||||||
TEST(AssertionTest, NonFixtureSubroutine) {
|
TEST(AssertionTest, NonFixtureSubroutine) {
|
||||||
EXPECT_FATAL_FAILURE(TestEq1(2),
|
EXPECT_FATAL_FAILURE(TestEq1(2),
|
||||||
"To be equal to: x");
|
"Which is: 2");
|
||||||
}
|
}
|
||||||
|
|
||||||
// An uncopyable class.
|
// An uncopyable class.
|
||||||
@ -3862,7 +3870,8 @@ TEST(AssertionTest, AssertWorksWithUncopyableObject) {
|
|||||||
EXPECT_FATAL_FAILURE(TestAssertNonPositive(),
|
EXPECT_FATAL_FAILURE(TestAssertNonPositive(),
|
||||||
"IsPositiveUncopyable(y) evaluates to false, where\ny evaluates to -1");
|
"IsPositiveUncopyable(y) evaluates to false, where\ny evaluates to -1");
|
||||||
EXPECT_FATAL_FAILURE(TestAssertEqualsUncopyable(),
|
EXPECT_FATAL_FAILURE(TestAssertEqualsUncopyable(),
|
||||||
"Expected: x\n Which is: 5\nTo be equal to: y\n Which is: -1");
|
"Expected equality of these values:\n"
|
||||||
|
" x\n Which is: 5\n y\n Which is: -1");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests that uncopyable objects can be used in expects.
|
// Tests that uncopyable objects can be used in expects.
|
||||||
@ -3874,7 +3883,8 @@ TEST(AssertionTest, ExpectWorksWithUncopyableObject) {
|
|||||||
"IsPositiveUncopyable(y) evaluates to false, where\ny evaluates to -1");
|
"IsPositiveUncopyable(y) evaluates to false, where\ny evaluates to -1");
|
||||||
EXPECT_EQ(x, x);
|
EXPECT_EQ(x, x);
|
||||||
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(x, y),
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(x, y),
|
||||||
"Expected: x\n Which is: 5\nTo be equal to: y\n Which is: -1");
|
"Expected equality of these values:\n"
|
||||||
|
" x\n Which is: 5\n y\n Which is: -1");
|
||||||
}
|
}
|
||||||
|
|
||||||
enum NamedEnum {
|
enum NamedEnum {
|
||||||
@ -3950,7 +3960,7 @@ TEST(AssertionTest, AnonymousEnum) {
|
|||||||
|
|
||||||
// ICE's in C++Builder.
|
// ICE's in C++Builder.
|
||||||
EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseB),
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseB),
|
||||||
"To be equal to: kCaseB");
|
"kCaseB");
|
||||||
EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseC),
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseC),
|
||||||
"Which is: 42");
|
"Which is: 42");
|
||||||
# endif
|
# endif
|
||||||
@ -4390,8 +4400,9 @@ TEST(ExpectTest, ExpectFalseWithAssertionResult) {
|
|||||||
TEST(ExpectTest, EXPECT_EQ) {
|
TEST(ExpectTest, EXPECT_EQ) {
|
||||||
EXPECT_EQ(5, 2 + 3);
|
EXPECT_EQ(5, 2 + 3);
|
||||||
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5, 2*3),
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5, 2*3),
|
||||||
" Expected: 5\n"
|
"Expected equality of these values:\n"
|
||||||
"To be equal to: 2*3\n"
|
" 5\n"
|
||||||
|
" 2*3\n"
|
||||||
" Which is: 6");
|
" Which is: 6");
|
||||||
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5, 2 - 3),
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5, 2 - 3),
|
||||||
"2 - 3");
|
"2 - 3");
|
||||||
@ -4423,7 +4434,7 @@ TEST(ExpectTest, EXPECT_EQ_NULL) {
|
|||||||
// A failure.
|
// A failure.
|
||||||
int n = 0;
|
int n = 0;
|
||||||
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(NULL, &n),
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(NULL, &n),
|
||||||
"To be equal to: &n\n");
|
"&n\n");
|
||||||
}
|
}
|
||||||
#endif // GTEST_CAN_COMPARE_NULL
|
#endif // GTEST_CAN_COMPARE_NULL
|
||||||
|
|
||||||
@ -4439,7 +4450,7 @@ TEST(ExpectTest, EXPECT_EQ_0) {
|
|||||||
|
|
||||||
// A failure.
|
// A failure.
|
||||||
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(0, 5.6),
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(0, 5.6),
|
||||||
"Expected: 0");
|
"Expected equality of these values:\n 0\n 5.6");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests EXPECT_NE.
|
// Tests EXPECT_NE.
|
||||||
@ -4539,7 +4550,7 @@ TEST(ExpectTest, EXPECT_ANY_THROW) {
|
|||||||
TEST(ExpectTest, ExpectPrecedence) {
|
TEST(ExpectTest, ExpectPrecedence) {
|
||||||
EXPECT_EQ(1 < 2, true);
|
EXPECT_EQ(1 < 2, true);
|
||||||
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(true, true && false),
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(true, true && false),
|
||||||
"To be equal to: true && false");
|
"true && false");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4686,7 +4697,7 @@ TEST(EqAssertionTest, Bool) {
|
|||||||
EXPECT_FATAL_FAILURE({
|
EXPECT_FATAL_FAILURE({
|
||||||
bool false_value = false;
|
bool false_value = false;
|
||||||
ASSERT_EQ(false_value, true);
|
ASSERT_EQ(false_value, true);
|
||||||
}, "To be equal to: true");
|
}, "Which is: false");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests using int values in {EXPECT|ASSERT}_EQ.
|
// Tests using int values in {EXPECT|ASSERT}_EQ.
|
||||||
@ -4720,9 +4731,10 @@ TEST(EqAssertionTest, WideChar) {
|
|||||||
EXPECT_EQ(L'b', L'b');
|
EXPECT_EQ(L'b', L'b');
|
||||||
|
|
||||||
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(L'\0', L'x'),
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(L'\0', L'x'),
|
||||||
" Expected: L'\0'\n"
|
"Expected equality of these values:\n"
|
||||||
|
" L'\0'\n"
|
||||||
" Which is: L'\0' (0, 0x0)\n"
|
" Which is: L'\0' (0, 0x0)\n"
|
||||||
"To be equal to: L'x'\n"
|
" L'x'\n"
|
||||||
" Which is: L'x' (120, 0x78)");
|
" Which is: L'x' (120, 0x78)");
|
||||||
|
|
||||||
static wchar_t wchar;
|
static wchar_t wchar;
|
||||||
@ -4731,7 +4743,7 @@ TEST(EqAssertionTest, WideChar) {
|
|||||||
"wchar");
|
"wchar");
|
||||||
wchar = 0x8119;
|
wchar = 0x8119;
|
||||||
EXPECT_FATAL_FAILURE(ASSERT_EQ(static_cast<wchar_t>(0x8120), wchar),
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(static_cast<wchar_t>(0x8120), wchar),
|
||||||
"To be equal to: wchar");
|
"wchar");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests using ::std::string values in {EXPECT|ASSERT}_EQ.
|
// Tests using ::std::string values in {EXPECT|ASSERT}_EQ.
|
||||||
@ -4760,7 +4772,7 @@ TEST(EqAssertionTest, StdString) {
|
|||||||
static ::std::string str3(str1);
|
static ::std::string str3(str1);
|
||||||
str3.at(2) = '\0';
|
str3.at(2) = '\0';
|
||||||
EXPECT_FATAL_FAILURE(ASSERT_EQ(str1, str3),
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(str1, str3),
|
||||||
"To be equal to: str3\n"
|
" str3\n"
|
||||||
" Which is: \"A \\0 in the middle\"");
|
" Which is: \"A \\0 in the middle\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4881,7 +4893,7 @@ TEST(EqAssertionTest, CharPointer) {
|
|||||||
ASSERT_EQ(p1, p1);
|
ASSERT_EQ(p1, p1);
|
||||||
|
|
||||||
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p0, p2),
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p0, p2),
|
||||||
"To be equal to: p2");
|
"p2");
|
||||||
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p1, p2),
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p1, p2),
|
||||||
"p2");
|
"p2");
|
||||||
EXPECT_FATAL_FAILURE(ASSERT_EQ(reinterpret_cast<char*>(0x1234),
|
EXPECT_FATAL_FAILURE(ASSERT_EQ(reinterpret_cast<char*>(0x1234),
|
||||||
@ -4903,7 +4915,7 @@ TEST(EqAssertionTest, WideCharPointer) {
|
|||||||
EXPECT_EQ(p0, p0);
|
EXPECT_EQ(p0, p0);
|
||||||
|
|
||||||
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p0, p2),
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p0, p2),
|
||||||
"To be equal to: p2");
|
"p2");
|
||||||
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p1, p2),
|
EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p1, p2),
|
||||||
"p2");
|
"p2");
|
||||||
void* pv3 = (void*)0x1234; // NOLINT
|
void* pv3 = (void*)0x1234; // NOLINT
|
||||||
|
@ -64,20 +64,23 @@ EXPECTED_NON_EMPTY_XML = """<?xml version="1.0" encoding="UTF-8"?>
|
|||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="FailedTest" tests="1" failures="1" disabled="0" errors="0" time="*">
|
<testsuite name="FailedTest" tests="1" failures="1" disabled="0" errors="0" time="*">
|
||||||
<testcase name="Fails" status="run" time="*" classname="FailedTest">
|
<testcase name="Fails" status="run" time="*" classname="FailedTest">
|
||||||
<failure message="gtest_xml_output_unittest_.cc:*
 Expected: 1
To be equal to: 2" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
|
<failure message="gtest_xml_output_unittest_.cc:*
Expected equality of these values:
 1
 2" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
|
||||||
Expected: 1
|
Expected equality of these values:
|
||||||
To be equal to: 2%(stack)s]]></failure>
|
1
|
||||||
|
2%(stack)s]]></failure>
|
||||||
</testcase>
|
</testcase>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="MixedResultTest" tests="3" failures="1" disabled="1" errors="0" time="*">
|
<testsuite name="MixedResultTest" tests="3" failures="1" disabled="1" errors="0" time="*">
|
||||||
<testcase name="Succeeds" status="run" time="*" classname="MixedResultTest"/>
|
<testcase name="Succeeds" status="run" time="*" classname="MixedResultTest"/>
|
||||||
<testcase name="Fails" status="run" time="*" classname="MixedResultTest">
|
<testcase name="Fails" status="run" time="*" classname="MixedResultTest">
|
||||||
<failure message="gtest_xml_output_unittest_.cc:*
 Expected: 1
To be equal to: 2" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
|
<failure message="gtest_xml_output_unittest_.cc:*
Expected equality of these values:
 1
 2" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
|
||||||
Expected: 1
|
Expected equality of these values:
|
||||||
To be equal to: 2%(stack)s]]></failure>
|
1
|
||||||
<failure message="gtest_xml_output_unittest_.cc:*
 Expected: 2
To be equal to: 3" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
|
2%(stack)s]]></failure>
|
||||||
Expected: 2
|
<failure message="gtest_xml_output_unittest_.cc:*
Expected equality of these values:
 2
 3" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
|
||||||
To be equal to: 3%(stack)s]]></failure>
|
Expected equality of these values:
|
||||||
|
2
|
||||||
|
3%(stack)s]]></failure>
|
||||||
</testcase>
|
</testcase>
|
||||||
<testcase name="DISABLED_test" status="notrun" time="*" classname="MixedResultTest"/>
|
<testcase name="DISABLED_test" status="notrun" time="*" classname="MixedResultTest"/>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user