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

Unified Diff: blimp/net/helium/vector_clock_generator_unittest.cc

Issue 2382533002: Helium: Initial proto and Syncable interface definition (Closed)
Patch Set: remainder stufft 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 side-by-side diff with in-line comments
Download patch
Index: blimp/net/helium/vector_clock_generator_unittest.cc
diff --git a/blimp/net/helium/vector_clock_generator_unittest.cc b/blimp/net/helium/vector_clock_generator_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..26674c3fc6876ad7cf54efb66627e7c734d6cf66
--- /dev/null
+++ b/blimp/net/helium/vector_clock_generator_unittest.cc
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "blimp/net/helium/vector_clock_generator.h"
+
+#include "base/macros.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blimp {
+namespace {
+
+class VectorClockGeneratorTest : public testing::Test {
+ public:
+ VectorClockGeneratorTest() {}
+ ~VectorClockGeneratorTest() override {}
+
+ protected:
+ VectorClockGenerator gen_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VectorClockGeneratorTest);
+};
+
+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.
+ VectorClock c1 = gen_.current();
+ EXPECT_EQ(VectorClock::Comparison::EqualTo, c1.CompareTo(gen_.current()));
+}
+
+TEST_F(VectorClockGeneratorTest, monotonicallyIncreasing) {
Kevin M 2016/10/05 23:41:30 MonotonicallyIncreasing
+ VectorClock c1 = gen_.current();
+ gen_.increment();
+ VectorClock c2 = gen_.current();
+ EXPECT_EQ(VectorClock::Comparison::GreaterThan, c2.CompareTo(c1));
+ EXPECT_EQ(VectorClock::Comparison::EqualTo, c2.CompareTo(gen_.current()));
+}
+
+} // namespace
+} // namespace blimp
« blimp/net/helium/vector_clock_generator.h ('K') | « 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