diff options
author | herb <herb@google.com> | 2015-09-28 08:59:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-28 08:59:18 -0700 |
commit | 0869267a7c6c58fb68a49b3c2e6d4f231d6645dc (patch) | |
tree | 338f29c03b63115d12cba8a3e602604db6944cf1 /tests | |
parent | 13f48dc85aa68a60da66aaf39c93d527d11d1278 (diff) |
Add cast and assignment operators to SkAtomic.
This is not really an API change.
TBR=reed@google.com
BUG=skia:
Review URL: https://codereview.chromium.org/1369333002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/AtomicTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/AtomicTest.cpp b/tests/AtomicTest.cpp index 7eb7a7103b..e9db3f093d 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); + } } |