Chromium Code Reviews| 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 "blimp/net/helium/vector_clock_generator.h" | |
| 6 | |
| 7 #include "base/macros.h" | |
| 8 #include "testing/gtest/include/gtest/gtest.h" | |
| 9 | |
| 10 namespace blimp { | |
| 11 namespace { | |
| 12 | |
| 13 class VectorClockGeneratorTest : public testing::Test { | |
| 14 public: | |
| 15 VectorClockGeneratorTest() {} | |
| 16 ~VectorClockGeneratorTest() override {} | |
| 17 | |
| 18 protected: | |
| 19 VectorClockGenerator gen_; | |
| 20 | |
| 21 private: | |
| 22 DISALLOW_COPY_AND_ASSIGN(VectorClockGeneratorTest); | |
| 23 }; | |
| 24 | |
| 25 TEST_F(VectorClockGeneratorTest, nextFollowedByLast) { | |
|
Kevin M
2016/10/05 23:41:30
Don't understand this test name
scf
2016/10/06 19:47:17
Done.
| |
| 26 VectorClock c1 = gen_.current(); | |
| 27 EXPECT_EQ(VectorClock::Comparison::EqualTo, c1.CompareTo(gen_.current())); | |
| 28 } | |
| 29 | |
| 30 TEST_F(VectorClockGeneratorTest, monotonicallyIncreasing) { | |
|
Kevin M
2016/10/05 23:41:30
MonotonicallyIncreasing
| |
| 31 VectorClock c1 = gen_.current(); | |
| 32 gen_.increment(); | |
| 33 VectorClock c2 = gen_.current(); | |
| 34 EXPECT_EQ(VectorClock::Comparison::GreaterThan, c2.CompareTo(c1)); | |
| 35 EXPECT_EQ(VectorClock::Comparison::EqualTo, c2.CompareTo(gen_.current())); | |
| 36 } | |
| 37 | |
| 38 } // namespace | |
| 39 } // namespace blimp | |
| OLD | NEW |