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

Side by Side Diff: runtime/vm/ring_buffer_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/reusable_handles.h ('k') | runtime/vm/runtime_entry.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) 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/ring_buffer.h"
5 #include "platform/assert.h" 6 #include "platform/assert.h"
6 #include "vm/ring_buffer.h"
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
11 TEST_CASE(RingBuffer) { 11 TEST_CASE(RingBuffer) {
12 RingBuffer<int, 2> buf; 12 RingBuffer<int, 2> buf;
13 EXPECT_EQ(0, buf.Size()); 13 EXPECT_EQ(0, buf.Size());
14 buf.Add(42); 14 buf.Add(42);
15 EXPECT_EQ(1, buf.Size()); 15 EXPECT_EQ(1, buf.Size());
16 EXPECT_EQ(42, buf.Get(0)); 16 EXPECT_EQ(42, buf.Get(0));
17 buf.Add(87); 17 buf.Add(87);
18 EXPECT_EQ(2, buf.Size()); 18 EXPECT_EQ(2, buf.Size());
19 EXPECT_EQ(87, buf.Get(0)); 19 EXPECT_EQ(87, buf.Get(0));
20 EXPECT_EQ(42, buf.Get(1)); 20 EXPECT_EQ(42, buf.Get(1));
21 buf.Add(-1); 21 buf.Add(-1);
22 EXPECT_EQ(2, buf.Size()); 22 EXPECT_EQ(2, buf.Size());
23 EXPECT_EQ(-1, buf.Get(0)); 23 EXPECT_EQ(-1, buf.Get(0));
24 EXPECT_EQ(87, buf.Get(1)); 24 EXPECT_EQ(87, buf.Get(1));
25 } 25 }
26 26
27 } // namespace dart 27 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/reusable_handles.h ('k') | runtime/vm/runtime_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698