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

Unified Diff: runtime/vm/atomic_test.cc

Issue 2344193002: Make NoReloadScope thread safe (Closed)
Patch Set: fschneider review Created 4 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 | « runtime/vm/atomic_macos.h ('k') | runtime/vm/atomic_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/atomic_test.cc
diff --git a/runtime/vm/atomic_test.cc b/runtime/vm/atomic_test.cc
index 6973d8b42a03c14a8ead95c8ca2e7e1935166d9e..262a3284b909e1b5f6726dea50a8a97484d03b99 100644
--- a/runtime/vm/atomic_test.cc
+++ b/runtime/vm/atomic_test.cc
@@ -26,6 +26,22 @@ UNIT_TEST_CASE(FetchAndDecrement) {
}
+UNIT_TEST_CASE(FetchAndIncrementSigned) {
+ intptr_t v = -42;
+ EXPECT_EQ(static_cast<intptr_t>(-42),
+ AtomicOperations::FetchAndIncrement(&v));
+ EXPECT_EQ(static_cast<intptr_t>(-41), v);
+}
+
+
+UNIT_TEST_CASE(FetchAndDecrementSigned) {
+ intptr_t v = -42;
+ EXPECT_EQ(static_cast<intptr_t>(-42),
+ AtomicOperations::FetchAndDecrement(&v));
+ EXPECT_EQ(static_cast<intptr_t>(-43), v);
+}
+
+
UNIT_TEST_CASE(IncrementBy) {
intptr_t v = 42;
AtomicOperations::IncrementBy(&v, 100);
« no previous file with comments | « runtime/vm/atomic_macos.h ('k') | runtime/vm/atomic_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698