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

Side by Side Diff: blimp/helium/revision_generator_unittest.cc

Issue 2402153002: Add CompoundSyncable class for synchronizing containers of Syncables. (Closed)
Patch Set: make literal unsigned Created 4 years, 2 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 | « blimp/helium/result_unittest.cc ('k') | blimp/helium/syncable_unittest.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/macros.h" 5 #include "base/macros.h"
6 #include "blimp/helium/helium_test.h" 6 #include "blimp/helium/helium_test.h"
7 #include "blimp/helium/revision_generator.h" 7 #include "blimp/helium/revision_generator.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace blimp { 10 namespace blimp {
11 namespace helium { 11 namespace helium {
12 namespace { 12 namespace {
13 13
14 using test::HeliumTest; 14 class RevisionGeneratorTest : public HeliumTest {};
15 15
16 TEST_F(HeliumTest, CheckCurrentDoesntIncrease) { 16 TEST_F(RevisionGeneratorTest, CheckCurrentDoesntIncrease) {
17 RevisionGenerator gen; 17 RevisionGenerator gen;
18 EXPECT_EQ(0UL, gen.current()); 18 EXPECT_EQ(0UL, gen.current());
19 } 19 }
20 20
21 TEST_F(HeliumTest, MonotonicallyIncreasing) { 21 TEST_F(RevisionGeneratorTest, MonotonicallyIncreasing) {
22 RevisionGenerator gen; 22 RevisionGenerator gen;
23 EXPECT_EQ(1UL, gen.GetNextRevision()); 23 EXPECT_EQ(1UL, gen.GetNextRevision());
24 EXPECT_EQ(2UL, gen.GetNextRevision()); 24 EXPECT_EQ(2UL, gen.GetNextRevision());
25 EXPECT_EQ(2UL, gen.current()); 25 EXPECT_EQ(2UL, gen.current());
26 } 26 }
27 27
28 TEST_F(HeliumTest, GetNextRevisionCall) { 28 TEST_F(RevisionGeneratorTest, GetNextRevisionCall) {
29 EXPECT_EQ(1UL, GetNextRevision()); 29 EXPECT_EQ(1UL, GetNextRevision());
30 EXPECT_EQ(2UL, GetNextRevision()); 30 EXPECT_EQ(2UL, GetNextRevision());
31 EXPECT_EQ(2UL, RevisionGenerator::GetInstance()->current()); 31 EXPECT_EQ(2UL, RevisionGenerator::GetInstance()->current());
32 } 32 }
33 33
34 } // namespace 34 } // namespace
35 } // namespace helium 35 } // namespace helium
36 } // namespace blimp 36 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/helium/result_unittest.cc ('k') | blimp/helium/syncable_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698