| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/macros.h" | |
| 6 #include "blimp/helium/helium_test.h" | |
| 7 #include "blimp/helium/revision_generator.h" | |
| 8 #include "testing/gtest/include/gtest/gtest.h" | |
| 9 | |
| 10 namespace blimp { | |
| 11 namespace helium { | |
| 12 namespace { | |
| 13 | |
| 14 class RevisionGeneratorTest : public HeliumTest {}; | |
| 15 | |
| 16 TEST_F(RevisionGeneratorTest, CheckCurrentDoesntIncrease) { | |
| 17 RevisionGenerator gen; | |
| 18 EXPECT_EQ(0UL, gen.current()); | |
| 19 } | |
| 20 | |
| 21 TEST_F(RevisionGeneratorTest, MonotonicallyIncreasing) { | |
| 22 RevisionGenerator gen; | |
| 23 EXPECT_EQ(1UL, gen.GetNextRevision()); | |
| 24 EXPECT_EQ(2UL, gen.GetNextRevision()); | |
| 25 EXPECT_EQ(2UL, gen.current()); | |
| 26 } | |
| 27 | |
| 28 TEST_F(RevisionGeneratorTest, GetNextRevisionCall) { | |
| 29 EXPECT_EQ(1UL, GetNextRevision()); | |
| 30 EXPECT_EQ(2UL, GetNextRevision()); | |
| 31 EXPECT_EQ(2UL, RevisionGenerator::GetInstance()->current()); | |
| 32 } | |
| 33 | |
| 34 } // namespace | |
| 35 } // namespace helium | |
| 36 } // namespace blimp | |
| OLD | NEW |