Fixes tests leaking altered values of GMOCK_FLAG(verbose) (issue 110).

This commit is contained in:
vladlosev
2010-05-05 19:47:46 +00:00
parent 54af9ba50a
commit 76c1c612e2
3 changed files with 25 additions and 15 deletions

View File

@@ -137,6 +137,7 @@ TEST(NiceMockTest, NoWarningForUninterestingCallAfterDeath) {
TEST(NiceMockTest, InfoForUninterestingCall) {
NiceMock<MockFoo> nice_foo;
const string saved_flag = GMOCK_FLAG(verbose);
GMOCK_FLAG(verbose) = "info";
CaptureStdout();
nice_foo.DoThis();
@@ -147,6 +148,7 @@ TEST(NiceMockTest, InfoForUninterestingCall) {
nice_foo.DoThat(true);
EXPECT_THAT(GetCapturedStdout(),
HasSubstr("Uninteresting mock function call"));
GMOCK_FLAG(verbose) = saved_flag;
}
#endif // GTEST_HAS_STREAM_REDIRECTION_