summaryrefslogtreecommitdiff
path: root/chromium/base/atomicops_unittest.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-01-25 11:39:07 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-01-25 15:20:42 +0000
commit6c91641271e536ffaa88a1dff5127e42ee99a91e (patch)
tree703d9dd49602377ddc90cbf886aad37913f2496b /chromium/base/atomicops_unittest.cc
parentb145b7fafd36f0c260d6a768c81fc14e32578099 (diff)
downloadqtwebengine-chromium-6c91641271e536ffaa88a1dff5127e42ee99a91e.tar.gz
BASELINE: Update Chromium to 49.0.2623.23
Also adds missing printing sources. Change-Id: I3726b8f0c7d6751c9fc846096c571fadca7108cd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'chromium/base/atomicops_unittest.cc')
-rw-r--r--chromium/base/atomicops_unittest.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chromium/base/atomicops_unittest.cc b/chromium/base/atomicops_unittest.cc
index 3fd55974722..7298609270f 100644
--- a/chromium/base/atomicops_unittest.cc
+++ b/chromium/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
+ // 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) <<