Chromium Code Reviews| Index: base/atomicops_unittest.cc |
| diff --git a/base/atomicops_unittest.cc b/base/atomicops_unittest.cc |
| index 3fd559747226dab196d7f0cd68fc26c4dd9b3e7d..21422a851d37d36a34aaf2ccf52734e6ba1cb267 100644 |
| --- a/base/atomicops_unittest.cc |
| +++ b/base/atomicops_unittest.cc |
| @@ -89,6 +89,13 @@ static void TestCompareAndSwap() { |
| EXPECT_EQ(1, value); |
| EXPECT_EQ(0, prev); |
| + // Verify that CAS will *not* change "value" if it doesn't match the |
| + // expected number. CAS will always return the actual value of the |
|
Alexander Potapenko
2015/11/02 23:06:43
Please remove the double space.
bcwhite
2015/11/03 15:11:36
Done. (As I said in our other review... It's sim
|
| + // variable from before any change. |
| + AtomicType fail = base::subtle::NoBarrier_CompareAndSwap(&value, 0, 2); |
| + EXPECT_EQ(1, value); |
| + EXPECT_EQ(1, fail); |
| + |
| // Use test value that has non-zero bits in both halves, more for testing |
| // 64-bit implementation on 32-bit platforms. |
| const AtomicType k_test_val = (static_cast<uint64_t>(1) << |