Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/memory/singleton.h" | 6 #include "base/memory/singleton.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace base { | 9 namespace base { |
| 10 namespace { | 10 namespace { |
| 11 | 11 |
| 12 COMPILE_ASSERT(DefaultSingletonTraits<int>::kRegisterAtExit == true, a); | 12 static_assert(DefaultSingletonTraits<int>::kRegisterAtExit == true, "a"); |
|
Mostyn Bramley-Moore
2015/11/23 06:44:14
Maybe change the message to something like "object
Avi (use Gerrit)
2015/11/24 04:49:43
Done.
| |
| 13 | 13 |
| 14 typedef void (*CallbackFunc)(); | 14 typedef void (*CallbackFunc)(); |
| 15 | 15 |
| 16 class IntSingleton { | 16 class IntSingleton { |
| 17 public: | 17 public: |
| 18 static IntSingleton* GetInstance() { | 18 static IntSingleton* GetInstance() { |
| 19 return Singleton<IntSingleton>::get(); | 19 return Singleton<IntSingleton>::get(); |
| 20 } | 20 } |
| 21 | 21 |
| 22 int value_; | 22 int value_; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 AlignedTestSingleton<AlignedMemory<4096, 4096> >::GetInstance(); | 281 AlignedTestSingleton<AlignedMemory<4096, 4096> >::GetInstance(); |
| 282 | 282 |
| 283 EXPECT_ALIGNED(align4, 4); | 283 EXPECT_ALIGNED(align4, 4); |
| 284 EXPECT_ALIGNED(align32, 32); | 284 EXPECT_ALIGNED(align32, 32); |
| 285 EXPECT_ALIGNED(align128, 128); | 285 EXPECT_ALIGNED(align128, 128); |
| 286 EXPECT_ALIGNED(align4096, 4096); | 286 EXPECT_ALIGNED(align4096, 4096); |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace | 289 } // namespace |
| 290 } // namespace base | 290 } // namespace base |
| OLD | NEW |