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

Unified Diff: tests/AtomicTest.cpp

Issue 1369333002: Add cast and assignment operators to SkAtomic. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove atomic include Created 5 years, 3 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 | « include/core/SkAtomics.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/AtomicTest.cpp
diff --git a/tests/AtomicTest.cpp b/tests/AtomicTest.cpp
index 7eb7a7103b78ccbfeb8859328fc4aad6ab4cf0e4..e9db3f093dd2271155887909113b8a8a60a4ee47 100644
--- a/tests/AtomicTest.cpp
+++ b/tests/AtomicTest.cpp
@@ -54,4 +54,13 @@ DEF_TEST(Atomic, reporter) {
int32_t valueToModify = 3;
const int32_t originalValue = valueToModify;
REPORTER_ASSERT(reporter, originalValue == sk_atomic_add(&valueToModify, 7));
+
+ {
+ SkAtomic<int> v {0};
+ REPORTER_ASSERT(reporter, 0 == v.load());
+ v = 10;
+ REPORTER_ASSERT(reporter, 10 == v.load());
+ int q = v;
+ REPORTER_ASSERT(reporter, 10 == q);
+ }
}
« no previous file with comments | « include/core/SkAtomics.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698