OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project 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 <limits.h> | 5 #include <limits.h> |
6 | 6 |
7 #include "src/atomic-utils.h" | 7 #include "src/base/atomic-utils.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace base { |
12 | 12 |
13 TEST(AtomicNumber, Constructor) { | 13 TEST(AtomicNumber, Constructor) { |
14 // Test some common types. | 14 // Test some common types. |
15 AtomicNumber<int> zero_int; | 15 AtomicNumber<int> zero_int; |
16 AtomicNumber<size_t> zero_size_t; | 16 AtomicNumber<size_t> zero_size_t; |
17 AtomicNumber<intptr_t> zero_intptr_t; | 17 AtomicNumber<intptr_t> zero_intptr_t; |
18 EXPECT_EQ(0, zero_int.Value()); | 18 EXPECT_EQ(0, zero_int.Value()); |
19 EXPECT_EQ(0U, zero_size_t.Value()); | 19 EXPECT_EQ(0U, zero_size_t.Value()); |
20 EXPECT_EQ(0, zero_intptr_t.Value()); | 20 EXPECT_EQ(0, zero_intptr_t.Value()); |
21 } | 21 } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 AtomicEnumSet<TestSetValue> a; | 206 AtomicEnumSet<TestSetValue> a; |
207 AtomicEnumSet<TestSetValue> b; | 207 AtomicEnumSet<TestSetValue> b; |
208 a.Add(kAA); | 208 a.Add(kAA); |
209 EXPECT_FALSE(a == b); | 209 EXPECT_FALSE(a == b); |
210 EXPECT_TRUE(a != b); | 210 EXPECT_TRUE(a != b); |
211 b.Add(kAA); | 211 b.Add(kAA); |
212 EXPECT_TRUE(a == b); | 212 EXPECT_TRUE(a == b); |
213 EXPECT_FALSE(a != b); | 213 EXPECT_FALSE(a != b); |
214 } | 214 } |
215 | 215 |
216 } // namespace internal | 216 } // namespace base |
217 } // namespace v8 | 217 } // namespace v8 |
OLD | NEW |