OLD | NEW |
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 |
OLD | NEW |