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

Side by Side Diff: runtime/vm/atomic_test.cc

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/atomic.h ('k') | runtime/vm/atomic_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/assert.h" 5 #include "platform/assert.h"
6 #include "platform/utils.h" 6 #include "platform/utils.h"
7 #include "vm/atomic.h" 7 #include "vm/atomic.h"
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/unit_test.h" 9 #include "vm/unit_test.h"
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 UNIT_TEST_CASE(LoadRelaxed) { 59 UNIT_TEST_CASE(LoadRelaxed) {
60 uword v = 42; 60 uword v = 42;
61 EXPECT_EQ(static_cast<uword>(42), AtomicOperations::LoadRelaxed(&v)); 61 EXPECT_EQ(static_cast<uword>(42), AtomicOperations::LoadRelaxed(&v));
62 } 62 }
63 63
64 64
65 TEST_CASE(CompareAndSwapWord) { 65 TEST_CASE(CompareAndSwapWord) {
66 uword old_value = 42; 66 uword old_value = 42;
67 uword new_value = 100; 67 uword new_value = 100;
68 uword result = AtomicOperations::CompareAndSwapWord( 68 uword result =
69 &old_value, old_value, new_value); 69 AtomicOperations::CompareAndSwapWord(&old_value, old_value, new_value);
70 EXPECT_EQ(static_cast<uword>(42), result); 70 EXPECT_EQ(static_cast<uword>(42), result);
71 } 71 }
72 72
73 73
74 TEST_CASE(CompareAndSwapUint32) { 74 TEST_CASE(CompareAndSwapUint32) {
75 uint32_t old_value = 42; 75 uint32_t old_value = 42;
76 uint32_t new_value = 100; 76 uint32_t new_value = 100;
77 uint32_t result = AtomicOperations::CompareAndSwapUint32( 77 uint32_t result =
78 &old_value, old_value, new_value); 78 AtomicOperations::CompareAndSwapUint32(&old_value, old_value, new_value);
79 EXPECT_EQ(static_cast<uint32_t>(42), result); 79 EXPECT_EQ(static_cast<uint32_t>(42), result);
80 } 80 }
81 81
82 } // namespace dart 82 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/atomic.h ('k') | runtime/vm/atomic_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698