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

Unified Diff: blimp/helium/version_vector_unittest.cc

Issue 2602103002: Delete blimp/helium and remove references to it from dependent targets (Closed)
Patch Set: . Created 4 years 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
« no previous file with comments | « blimp/helium/version_vector.cc ('k') | blimp/net/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/helium/version_vector_unittest.cc
diff --git a/blimp/helium/version_vector_unittest.cc b/blimp/helium/version_vector_unittest.cc
deleted file mode 100644
index dfb3ae403a81680bca4c5fe6cbd72e98ec0a4e28..0000000000000000000000000000000000000000
--- a/blimp/helium/version_vector_unittest.cc
+++ /dev/null
@@ -1,143 +0,0 @@
-// 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 <tuple>
-
-#include "base/macros.h"
-#include "blimp/helium/version_vector.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace blimp {
-namespace helium {
-namespace {
-
-class VersionVectorComparisonTest
- : public ::testing::TestWithParam<
- std::tuple<VersionVector, VersionVector, VersionVector::Comparison>> {
- public:
- VersionVectorComparisonTest() {}
- ~VersionVectorComparisonTest() override {}
-};
-
-TEST_P(VersionVectorComparisonTest, CompareTo) {
- auto param = GetParam();
- VersionVector v1 = std::get<0>(param);
- VersionVector v2 = std::get<1>(param);
- VersionVector::Comparison expected = std::get<2>(param);
- EXPECT_EQ(expected, v1.CompareTo(v2));
-}
-
-INSTANTIATE_TEST_CASE_P(
- LessThan,
- VersionVectorComparisonTest,
- ::testing::Values(std::make_tuple(VersionVector(1, 2),
- VersionVector(1, 3),
- VersionVector::Comparison::LessThan)));
-
-INSTANTIATE_TEST_CASE_P(
- GreaterThan,
- VersionVectorComparisonTest,
- ::testing::Values(std::make_tuple(VersionVector(1, 3),
- VersionVector(1, 2),
- VersionVector::Comparison::GreaterThan),
- std::make_tuple(VersionVector(2, 2),
- VersionVector(1, 2),
- VersionVector::Comparison::GreaterThan)));
-
-INSTANTIATE_TEST_CASE_P(
- Conflict,
- VersionVectorComparisonTest,
- ::testing::Values(std::make_tuple(VersionVector(1, 2),
- VersionVector(0, 1),
- VersionVector::Comparison::Conflict),
- std::make_tuple(VersionVector(1, 2),
- VersionVector(0, 3),
- VersionVector::Comparison::Conflict)));
-
-INSTANTIATE_TEST_CASE_P(
- EqualTo,
- VersionVectorComparisonTest,
- ::testing::Values(std::make_tuple(VersionVector(1, 1),
- VersionVector(1, 1),
- VersionVector::Comparison::EqualTo),
- std::make_tuple(VersionVector(2, 3),
- VersionVector(2, 3),
- VersionVector::Comparison::EqualTo),
- std::make_tuple(VersionVector(3, 2),
- VersionVector(3, 2),
- VersionVector::Comparison::EqualTo)));
-
-class VersionVectorTest : public testing::Test {
- public:
- VersionVectorTest() {}
- ~VersionVectorTest() override {}
-
- protected:
- void CheckCumulativeMerge(const VersionVector& v1,
- const VersionVector& v2,
- const VersionVector& expected) {
- // Compute the merge of v1 and v2
- VersionVector r1 = v1.MergeWith(v2);
- EXPECT_EQ(expected.local_revision(), r1.local_revision());
- EXPECT_EQ(expected.remote_revision(), r1.remote_revision());
-
- // Compute the merge of v2 and v1
- VersionVector r2 = v2.MergeWith(v1);
- EXPECT_EQ(expected.local_revision(), r2.local_revision());
- EXPECT_EQ(expected.remote_revision(), r2.remote_revision());
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VersionVectorTest);
-};
-
-TEST_F(VersionVectorTest, IncrementLocal1) {
- VersionVector v(0, 0);
- v.IncrementLocal();
- EXPECT_EQ(1U, v.local_revision());
- EXPECT_EQ(0U, v.remote_revision());
-}
-
-TEST_F(VersionVectorTest, IncrementLocal2) {
- VersionVector v(4, 5);
- v.IncrementLocal();
- EXPECT_EQ(5U, v.local_revision());
- EXPECT_EQ(5U, v.remote_revision());
-}
-
-TEST_F(VersionVectorTest, MergeLocalEqualRemoteSmaller) {
- VersionVector v1(1, 2);
- VersionVector v2(1, 4);
-
- VersionVector expected(1, 4);
- CheckCumulativeMerge(v1, v2, expected);
-}
-
-TEST_F(VersionVectorTest, MergeLocalSmallerRemoteEqual) {
- VersionVector v1(1, 4);
- VersionVector v2(2, 4);
-
- VersionVector expected(2, 4);
- CheckCumulativeMerge(v1, v2, expected);
-}
-
-TEST_F(VersionVectorTest, MergeLocalSmallerRemoteSmaller) {
- VersionVector v1(1, 2);
- VersionVector v2(3, 4);
-
- VersionVector expected(3, 4);
- CheckCumulativeMerge(v1, v2, expected);
-}
-
-TEST_F(VersionVectorTest, MergeLocalSmallerRemoteGreater) {
- VersionVector v1(1, 4);
- VersionVector v2(3, 2);
-
- VersionVector expected(3, 4);
- CheckCumulativeMerge(v1, v2, expected);
-}
-
-} // namespace
-} // namespace helium
-} // namespace blimp
« no previous file with comments | « blimp/helium/version_vector.cc ('k') | blimp/net/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698