Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Unified Diff: base/singleton_unittest.cc

Issue 2042003: Switch some Singletons to use LeakySingleton. Base URL: http://src.chromium.org/git/chromium.git
Patch Set: More build fixes. Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/singleton.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/singleton_unittest.cc
diff --git a/base/singleton_unittest.cc b/base/singleton_unittest.cc
index bb46bee83bbb16338399ee16b76cc1985ed3abf9..2ecc2835c40cfc22f803793869cf9871e9abed9d 100644
--- a/base/singleton_unittest.cc
+++ b/base/singleton_unittest.cc
@@ -44,8 +44,9 @@ int* SingletonInt1() {
}
int* SingletonInt2() {
+ typedef int FooType;
// Force to use a different singleton than SingletonInt1.
- return Singleton<int, DefaultSingletonTraits<int> >::get();
+ return Singleton<FooType>::get();
}
class DummyDifferentiatingClass {
@@ -134,28 +135,28 @@ TEST_F(SingletonTest, Basic) {
singleton_int_1 = SingletonInt1();
}
// Ensure POD type initialization.
- EXPECT_EQ(*singleton_int_1, 0);
+ EXPECT_EQ(0, *singleton_int_1);
*singleton_int_1 = 1;
EXPECT_EQ(singleton_int_1, SingletonInt1());
- EXPECT_EQ(*singleton_int_1, 1);
+ EXPECT_EQ(1, *singleton_int_1);
{
singleton_int_2 = SingletonInt2();
}
// Same instance that 1.
- EXPECT_EQ(*singleton_int_2, 1);
+ EXPECT_EQ(1, *singleton_int_2);
EXPECT_EQ(singleton_int_1, singleton_int_2);
{
singleton_int_3 = SingletonInt3();
}
// Different instance than 1 and 2.
- EXPECT_EQ(*singleton_int_3, 0);
+ EXPECT_EQ(0, *singleton_int_3);
EXPECT_NE(singleton_int_1, singleton_int_3);
*singleton_int_3 = 3;
- EXPECT_EQ(*singleton_int_1, 1);
- EXPECT_EQ(*singleton_int_2, 1);
+ EXPECT_EQ(1, *singleton_int_1);
+ EXPECT_EQ(1, *singleton_int_2);
{
singleton_int_4 = SingletonInt4();
« no previous file with comments | « base/singleton.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698