diff options
author | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2012-05-31 20:40:56 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2012-05-31 20:40:56 +0000 |
commit | 2fd619edd3d1ec053f6276debdb513f1122ebcf3 (patch) | |
tree | 3df112696485c11d5d0034d13f604d5f52be0a43 /test/gmock-internal-utils_test.cc | |
parent | 79a367eb217fcd47e2beaf8c0f87fe6d5926f739 (diff) | |
download | googletest-2fd619edd3d1ec053f6276debdb513f1122ebcf3.tar.gz googletest-2fd619edd3d1ec053f6276debdb513f1122ebcf3.tar.bz2 googletest-2fd619edd3d1ec053f6276debdb513f1122ebcf3.zip |
Pulls in gtest r615.
Renames internal enums to the kFoo naming style.
Fixes gmock doctor to work with newer versions of Clang.
Diffstat (limited to 'test/gmock-internal-utils_test.cc')
-rw-r--r-- | test/gmock-internal-utils_test.cc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/test/gmock-internal-utils_test.cc b/test/gmock-internal-utils_test.cc index ae743c1c..d53282eb 100644 --- a/test/gmock-internal-utils_test.cc +++ b/test/gmock-internal-utils_test.cc @@ -359,20 +359,20 @@ class LogIsVisibleTest : public ::testing::Test { TEST_F(LogIsVisibleTest, AlwaysReturnsTrueIfVerbosityIsInfo) { GMOCK_FLAG(verbose) = kInfoVerbosity; - EXPECT_TRUE(LogIsVisible(INFO)); - EXPECT_TRUE(LogIsVisible(WARNING)); + EXPECT_TRUE(LogIsVisible(kInfo)); + EXPECT_TRUE(LogIsVisible(kWarning)); } TEST_F(LogIsVisibleTest, AlwaysReturnsFalseIfVerbosityIsError) { GMOCK_FLAG(verbose) = kErrorVerbosity; - EXPECT_FALSE(LogIsVisible(INFO)); - EXPECT_FALSE(LogIsVisible(WARNING)); + EXPECT_FALSE(LogIsVisible(kInfo)); + EXPECT_FALSE(LogIsVisible(kWarning)); } TEST_F(LogIsVisibleTest, WorksWhenVerbosityIsWarning) { GMOCK_FLAG(verbose) = kWarningVerbosity; - EXPECT_FALSE(LogIsVisible(INFO)); - EXPECT_TRUE(LogIsVisible(WARNING)); + EXPECT_FALSE(LogIsVisible(kInfo)); + EXPECT_TRUE(LogIsVisible(kWarning)); } #if GTEST_HAS_STREAM_REDIRECTION @@ -390,7 +390,7 @@ void TestLogWithSeverity(const string& verbosity, LogSeverity severity, if (should_print) { EXPECT_THAT(GetCapturedStdout().c_str(), ContainsRegex( - severity == WARNING ? + severity == kWarning ? "^\nGMOCK WARNING:\nTest log\\.\nStack trace:\n" : "^\nTest log\\.\nStack trace:\n")); } else { @@ -405,7 +405,7 @@ TEST(LogTest, NoStackTraceWhenStackFramesToSkipIsNegative) { const string saved_flag = GMOCK_FLAG(verbose); GMOCK_FLAG(verbose) = kInfoVerbosity; CaptureStdout(); - Log(INFO, "Test log.\n", -1); + Log(kInfo, "Test log.\n", -1); EXPECT_STREQ("\nTest log.\n", GetCapturedStdout().c_str()); GMOCK_FLAG(verbose) = saved_flag; } @@ -414,7 +414,7 @@ TEST(LogTest, NoStackTraceWhenStackFramesToSkipIsNegative) { // treated as 0. TEST(LogTest, NoSkippingStackFrameInOptMode) { CaptureStdout(); - Log(WARNING, "Test log.\n", 100); + Log(kWarning, "Test log.\n", 100); const String log = GetCapturedStdout(); # if defined(NDEBUG) && GTEST_GOOGLE3_MODE_ @@ -436,29 +436,29 @@ TEST(LogTest, NoSkippingStackFrameInOptMode) { // Tests that all logs are printed when the value of the // --gmock_verbose flag is "info". TEST(LogTest, AllLogsArePrintedWhenVerbosityIsInfo) { - TestLogWithSeverity(kInfoVerbosity, INFO, true); - TestLogWithSeverity(kInfoVerbosity, WARNING, true); + TestLogWithSeverity(kInfoVerbosity, kInfo, true); + TestLogWithSeverity(kInfoVerbosity, kWarning, true); } // Tests that only warnings are printed when the value of the // --gmock_verbose flag is "warning". TEST(LogTest, OnlyWarningsArePrintedWhenVerbosityIsWarning) { - TestLogWithSeverity(kWarningVerbosity, INFO, false); - TestLogWithSeverity(kWarningVerbosity, WARNING, true); + TestLogWithSeverity(kWarningVerbosity, kInfo, false); + TestLogWithSeverity(kWarningVerbosity, kWarning, true); } // Tests that no logs are printed when the value of the // --gmock_verbose flag is "error". TEST(LogTest, NoLogsArePrintedWhenVerbosityIsError) { - TestLogWithSeverity(kErrorVerbosity, INFO, false); - TestLogWithSeverity(kErrorVerbosity, WARNING, false); + TestLogWithSeverity(kErrorVerbosity, kInfo, false); + TestLogWithSeverity(kErrorVerbosity, kWarning, false); } // Tests that only warnings are printed when the value of the // --gmock_verbose flag is invalid. TEST(LogTest, OnlyWarningsArePrintedWhenVerbosityIsInvalid) { - TestLogWithSeverity("invalid", INFO, false); - TestLogWithSeverity("invalid", WARNING, true); + TestLogWithSeverity("invalid", kInfo, false); + TestLogWithSeverity("invalid", kWarning, true); } #endif // GTEST_HAS_STREAM_REDIRECTION |