From ed2f2331443f02b22b1a8051407debf03215b95d Mon Sep 17 00:00:00 2001 From: "erikkay@google.com" Date: Wed, 20 Aug 2008 15:59:49 +0000 Subject: Create a gtest test fixture subclass that allows for platform specific setup and teardown hooks. On the Mac use this to create an outer Autorelease pool. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1089 0039d316-1c4b-4281-b951-d872f2087c98 --- base/path_service_unittest.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'base/path_service_unittest.cc') diff --git a/base/path_service_unittest.cc b/base/path_service_unittest.cc index 970ea0c..ffc6992 100644 --- a/base/path_service_unittest.cc +++ b/base/path_service_unittest.cc @@ -31,6 +31,7 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/path_service.h" +#include "base/platform_test.h" #if defined(OS_WIN) #include "base/win_util.h" #endif @@ -58,11 +59,15 @@ bool ReturnsInvalidPath(int dir_type) { } // namespace +// On the Mac this winds up using some autoreleased objects, so we need to +// be a PlatformTest. +typedef PlatformTest PathServiceTest; + // Test that all PathService::Get calls return a value and a true result // in the development environment. (This test was created because a few // later changes to Get broke the semantics of the function and yielded the // correct value while returning false.) -TEST(PathServiceTest, Get) { +TEST_F(PathServiceTest, Get) { for (int key = base::DIR_CURRENT; key < base::PATH_END; ++key) { EXPECT_PRED1(ReturnsValidPath, key); } -- cgit v1.1