diff options
Diffstat (limited to 'googlemock/test/gmock-internal-utils_test.cc')
-rw-r--r-- | googlemock/test/gmock-internal-utils_test.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/googlemock/test/gmock-internal-utils_test.cc b/googlemock/test/gmock-internal-utils_test.cc index b30eb8c..8722418 100644 --- a/googlemock/test/gmock-internal-utils_test.cc +++ b/googlemock/test/gmock-internal-utils_test.cc @@ -361,27 +361,27 @@ TEST(ExpectTest, FailsNonfatallyOnFalse) { class LogIsVisibleTest : public ::testing::Test { protected: - void SetUp() override { original_verbose_ = GMOCK_FLAG(verbose); } + void SetUp() override { original_verbose_ = GMOCK_FLAG_GET(verbose); } - void TearDown() override { GMOCK_FLAG(verbose) = original_verbose_; } + void TearDown() override { GMOCK_FLAG_SET(verbose, original_verbose_); } std::string original_verbose_; }; TEST_F(LogIsVisibleTest, AlwaysReturnsTrueIfVerbosityIsInfo) { - GMOCK_FLAG(verbose) = kInfoVerbosity; + GMOCK_FLAG_SET(verbose, kInfoVerbosity); EXPECT_TRUE(LogIsVisible(kInfo)); EXPECT_TRUE(LogIsVisible(kWarning)); } TEST_F(LogIsVisibleTest, AlwaysReturnsFalseIfVerbosityIsError) { - GMOCK_FLAG(verbose) = kErrorVerbosity; + GMOCK_FLAG_SET(verbose, kErrorVerbosity); EXPECT_FALSE(LogIsVisible(kInfo)); EXPECT_FALSE(LogIsVisible(kWarning)); } TEST_F(LogIsVisibleTest, WorksWhenVerbosityIsWarning) { - GMOCK_FLAG(verbose) = kWarningVerbosity; + GMOCK_FLAG_SET(verbose, kWarningVerbosity); EXPECT_FALSE(LogIsVisible(kInfo)); EXPECT_TRUE(LogIsVisible(kWarning)); } @@ -395,7 +395,7 @@ TEST_F(LogIsVisibleTest, WorksWhenVerbosityIsWarning) { void TestLogWithSeverity(const std::string& verbosity, LogSeverity severity, bool should_print) { const std::string old_flag = GMOCK_FLAG(verbose); - GMOCK_FLAG(verbose) = verbosity; + GMOCK_FLAG_SET(verbose, verbosity); CaptureStdout(); Log(severity, "Test log.\n", 0); if (should_print) { @@ -407,18 +407,18 @@ void TestLogWithSeverity(const std::string& verbosity, LogSeverity severity, } else { EXPECT_STREQ("", GetCapturedStdout().c_str()); } - GMOCK_FLAG(verbose) = old_flag; + GMOCK_FLAG_SET(verbose, old_flag); } // Tests that when the stack_frames_to_skip parameter is negative, // Log() doesn't include the stack trace in the output. TEST(LogTest, NoStackTraceWhenStackFramesToSkipIsNegative) { const std::string saved_flag = GMOCK_FLAG(verbose); - GMOCK_FLAG(verbose) = kInfoVerbosity; + GMOCK_FLAG_SET(verbose, kInfoVerbosity); CaptureStdout(); Log(kInfo, "Test log.\n", -1); EXPECT_STREQ("\nTest log.\n", GetCapturedStdout().c_str()); - GMOCK_FLAG(verbose) = saved_flag; + GMOCK_FLAG_SET(verbose, saved_flag); } struct MockStackTraceGetter : testing::internal::OsStackTraceGetterInterface { @@ -500,10 +500,10 @@ TEST(LogTest, OnlyWarningsArePrintedWhenVerbosityIsInvalid) { // and log severity. std::string GrabOutput(void(*logger)(), const char* verbosity) { const std::string saved_flag = GMOCK_FLAG(verbose); - GMOCK_FLAG(verbose) = verbosity; + GMOCK_FLAG_SET(verbose, verbosity); CaptureStdout(); logger(); - GMOCK_FLAG(verbose) = saved_flag; + GMOCK_FLAG_SET(verbose, saved_flag); return GetCapturedStdout(); } |