aboutsummaryrefslogtreecommitdiffstats
path: root/samples/sample10_unittest.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-24 21:15:59 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-24 21:15:59 +0000
commitb50ef44a3527d958270ff1f08cb99e3ac633bd17 (patch)
treeceb0f9819c41f511d74cf72066ec48620dea8caa /samples/sample10_unittest.cc
parent7fba282ce74ce527cba5c686945d18ae1b7cb3d2 (diff)
downloadgoogletest-b50ef44a3527d958270ff1f08cb99e3ac633bd17.tar.gz
googletest-b50ef44a3527d958270ff1f08cb99e3ac633bd17.tar.bz2
googletest-b50ef44a3527d958270ff1f08cb99e3ac633bd17.zip
Publishes the even listener API (by Vlad Losev); adds OS-indicating macros to simplify gtest code (by Zhanyong Wan).
Diffstat (limited to 'samples/sample10_unittest.cc')
-rw-r--r--samples/sample10_unittest.cc28
1 files changed, 4 insertions, 24 deletions
diff --git a/samples/sample10_unittest.cc b/samples/sample10_unittest.cc
index 8cb958f6..e1368596 100644
--- a/samples/sample10_unittest.cc
+++ b/samples/sample10_unittest.cc
@@ -36,33 +36,14 @@
#include <gtest/gtest.h>
+using ::testing::EmptyTestEventListener;
+using ::testing::EventListeners;
using ::testing::InitGoogleTest;
using ::testing::Test;
+using ::testing::TestCase;
using ::testing::TestInfo;
using ::testing::TestPartResult;
using ::testing::UnitTest;
-using ::testing::internal::EmptyTestEventListener;
-using ::testing::internal::EventListeners;
-using ::testing::internal::TestCase;
-
-namespace testing {
-namespace internal {
-
-// TODO(vladl@google.com): Get rid of the accessor class once the API is
-// published.
-class UnitTestAccessor {
- public:
- static bool Passed(const UnitTest& unit_test) { return unit_test.Passed(); }
- static EventListeners& listeners(UnitTest* unit_test) {
- return unit_test->listeners();
- }
-
-};
-
-} // namespace internal
-} // namespace testing
-
-using ::testing::internal::UnitTestAccessor;
namespace {
@@ -142,8 +123,7 @@ int main(int argc, char **argv) {
// If we are given the --check_for_leaks command line flag, installs the
// leak checker.
if (check_for_leaks) {
- EventListeners& listeners = UnitTestAccessor::listeners(
- UnitTest::GetInstance());
+ EventListeners& listeners = UnitTest::GetInstance()->listeners();
// Adds the leak checker to the end of the test event listener list,
// after the default text output printer and the default XML report