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

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

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/bigint_test.cc ('k') | runtime/vm/bit_vector.cc » ('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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 "vm/bit_set.h"
5 #include "platform/assert.h" 6 #include "platform/assert.h"
6 #include "vm/bit_set.h"
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
11 template <intptr_t Size> 11 template <intptr_t Size>
12 void TestBitSet() { 12 void TestBitSet() {
13 BitSet<Size> set; 13 BitSet<Size> set;
14 EXPECT_EQ(-1, set.Last()); 14 EXPECT_EQ(-1, set.Last());
15 for (int i = 0; i < Size; ++i) { 15 for (int i = 0; i < Size; ++i) {
16 EXPECT_EQ(false, set.Test(i)); 16 EXPECT_EQ(false, set.Test(i));
(...skipping 16 matching lines...) Expand all
33 set.Set(i, true); 33 set.Set(i, true);
34 for (int j = i + 1; j < Size; ++j) { 34 for (int j = i + 1; j < Size; ++j) {
35 set.Set(j, true); 35 set.Set(j, true);
36 EXPECT_EQ(j, set.Last()); 36 EXPECT_EQ(j, set.Last());
37 EXPECT_EQ(i, set.ClearLastAndFindPrevious(j)); 37 EXPECT_EQ(i, set.ClearLastAndFindPrevious(j));
38 EXPECT_EQ(false, set.Test(j)); 38 EXPECT_EQ(false, set.Test(j));
39 } 39 }
40 } 40 }
41 } 41 }
42 42
43
44 TEST_CASE(BitSetBasic) { 43 TEST_CASE(BitSetBasic) {
45 TestBitSet<8>(); 44 TestBitSet<8>();
46 TestBitSet<42>(); 45 TestBitSet<42>();
47 TestBitSet<128>(); 46 TestBitSet<128>();
48 TestBitSet<200>(); 47 TestBitSet<200>();
49 } 48 }
50 49
51 } // namespace dart 50 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bigint_test.cc ('k') | runtime/vm/bit_vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698