Commit 93ad3551 authored by zhanyong.wan's avatar zhanyong.wan
Browse files

Fixes gmock-port_test on Windows.

parent 6f14769e
...@@ -69,19 +69,19 @@ TEST(GmockCheckSyntaxTest, WorksWithSwitch) { ...@@ -69,19 +69,19 @@ TEST(GmockCheckSyntaxTest, WorksWithSwitch) {
TEST(GmockCheckDeathTest, DiesWithCorrectOutputOnFailure) { TEST(GmockCheckDeathTest, DiesWithCorrectOutputOnFailure) {
const bool a_false_condition = false; const bool a_false_condition = false;
EXPECT_DEATH(GMOCK_CHECK_(a_false_condition) << "Extra info", // MSVC and gcc use different formats to print source file locations.
// MSVC and gcc use different formats to print source // Google Mock's failure messages use the same format as used by the
// file locations. Google Mock's failure messages use // compiler, in order for the IDE to recognize them. Therefore we look
// the same format as used by the compiler, in order // for different patterns here depending on the compiler.
// for the IDE to recognize them. Therefore we look const char regex[] =
// for different patterns here depending on the
// compiler.
#ifdef _MSC_VER #ifdef _MSC_VER
"gmock-port_test\\.cc\\([0-9]+\\):" "gmock-port_test\\.cc\\(\\d+\\):"
#else #else
"gmock-port_test\\.cc:[0-9]+" "gmock-port_test\\.cc:[0-9]+"
#endif // _MSC_VER #endif // _MSC_VER
".*a_false_condition.*Extra info"); ".*a_false_condition.*Extra info";
EXPECT_DEATH(GMOCK_CHECK_(a_false_condition) << "Extra info", regex);
} }
TEST(GmockCheckDeathTest, LivesSilentlyOnSuccess) { TEST(GmockCheckDeathTest, LivesSilentlyOnSuccess) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment