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

Side by Side Diff: blimp/net/helium/vector_clock_generator_unittest.cc

Issue 2382533002: Helium: Initial proto and Syncable interface definition (Closed)
Patch Set: test changes 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/net/helium/vector_clock_generator.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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, CheckCurrentDoesntIncrease) {
26 VectorClock c1 = gen_.current();
27 EXPECT_EQ(VectorClock::Comparison::EqualTo, c1.CompareTo(gen_.current()));
28 }
29
30 TEST_F(VectorClockGeneratorTest, 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
OLDNEW
« no previous file with comments | « blimp/net/helium/vector_clock_generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698