summaryrefslogtreecommitdiffstats
path: root/googletest
diff options
context:
space:
mode:
Diffstat (limited to 'googletest')
-rw-r--r--googletest/include/gtest/gtest.h5
-rw-r--r--googletest/src/gtest-death-test.cc2
-rw-r--r--googletest/src/gtest.cc6
-rw-r--r--googletest/test/gtest_unittest.cc2
4 files changed, 9 insertions, 6 deletions
diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h
index 8412503..86777c8 100644
--- a/googletest/include/gtest/gtest.h
+++ b/googletest/include/gtest/gtest.h
@@ -1055,6 +1055,10 @@ class GTEST_API_ TestEventListeners {
return default_xml_generator_;
}
+ // Controls whether events will be forwarded by the repeater to the
+ // listeners in the list.
+ void SuppressEventForwarding(bool);
+
private:
friend class TestSuite;
friend class TestInfo;
@@ -1084,7 +1088,6 @@ class GTEST_API_ TestEventListeners {
// Controls whether events will be forwarded by the repeater to the
// listeners in the list.
bool EventForwardingEnabled() const;
- void SuppressEventForwarding();
// The actual list of listeners.
internal::TestEventRepeater* repeater_;
diff --git a/googletest/src/gtest-death-test.cc b/googletest/src/gtest-death-test.cc
index 4cf78e7..0eb6e38 100644
--- a/googletest/src/gtest-death-test.cc
+++ b/googletest/src/gtest-death-test.cc
@@ -1128,7 +1128,7 @@ DeathTest::TestRole NoExecDeathTest::AssumeRole() {
LogToStderr();
// Event forwarding to the listeners of event listener API mush be shut
// down in death test subprocesses.
- GetUnitTestImpl()->listeners()->SuppressEventForwarding();
+ GetUnitTestImpl()->listeners()->SuppressEventForwarding(true);
g_in_fast_death_test_child = true;
return EXECUTE_TEST;
} else {
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index a88ac25..d9fd277 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -5156,8 +5156,8 @@ bool TestEventListeners::EventForwardingEnabled() const {
return repeater_->forwarding_enabled();
}
-void TestEventListeners::SuppressEventForwarding() {
- repeater_->set_forwarding_enabled(false);
+void TestEventListeners::SuppressEventForwarding(bool suppress) {
+ repeater_->set_forwarding_enabled(!suppress);
}
// class UnitTest
@@ -5635,7 +5635,7 @@ void UnitTestImpl::RecordProperty(const TestProperty& test_property) {
// subprocess. Must not be called before InitGoogleTest.
void UnitTestImpl::SuppressTestEventsIfInSubprocess() {
if (internal_run_death_test_flag_ != nullptr)
- listeners()->SuppressEventForwarding();
+ listeners()->SuppressEventForwarding(true);
}
#endif // GTEST_HAS_DEATH_TEST
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index 77d968a..dd049a0 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -173,7 +173,7 @@ class TestEventListenersAccessor {
}
static void SuppressEventForwarding(TestEventListeners* listeners) {
- listeners->SuppressEventForwarding();
+ listeners->SuppressEventForwarding(true);
}
};