Chromium Code Reviews| Index: runtime/vm/atomic_test.cc |
| diff --git a/runtime/vm/atomic_test.cc b/runtime/vm/atomic_test.cc |
| index 6973d8b42a03c14a8ead95c8ca2e7e1935166d9e..782f4f308fe43445454ddb932e8cfd654de2029b 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<uintptr_t>(-42), |
|
Florian Schneider
2016/09/16 18:01:36
intptr_t
Cutch
2016/09/16 18:07:51
Done here and elsewhere.
|
| + AtomicOperations::FetchAndIncrement(&v)); |
| + EXPECT_EQ(static_cast<uintptr_t>(-41), v); |
|
Florian Schneider
2016/09/16 18:01:36
intptr_t?
Or remove these static_casts. They seem
|
| +} |
| + |
| + |
| +UNIT_TEST_CASE(FetchAndDecrementSigned) { |
| + intptr_t v = -42; |
| + EXPECT_EQ(static_cast<uintptr_t>(-42), |
|
Florian Schneider
2016/09/16 18:01:36
Same as above.
|
| + AtomicOperations::FetchAndDecrement(&v)); |
| + EXPECT_EQ(static_cast<uintptr_t>(-43), v); |
|
Florian Schneider
2016/09/16 18:01:36
Same as above.
|
| +} |
| + |
| + |
| UNIT_TEST_CASE(IncrementBy) { |
| intptr_t v = 42; |
| AtomicOperations::IncrementBy(&v, 100); |