diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-19 13:51:45 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-19 14:13:19 +0000 |
commit | b206dd0a2b7610618079162cff55c9ed68a81920 (patch) | |
tree | 40503cd6fbcf9f06e22550f8fe1481410a0d5ae6 /persistence/src/tests/spi/clusterstatetest.cpp | |
parent | f124b885f64530ff3167512b12fb3ffc98818415 (diff) |
Use a trinary to also handle temporary mismatching bucket used bits.
Diffstat (limited to 'persistence/src/tests/spi/clusterstatetest.cpp')
-rw-r--r-- | persistence/src/tests/spi/clusterstatetest.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/persistence/src/tests/spi/clusterstatetest.cpp b/persistence/src/tests/spi/clusterstatetest.cpp index d60330690a9..17c4c3dc635 100644 --- a/persistence/src/tests/spi/clusterstatetest.cpp +++ b/persistence/src/tests/spi/clusterstatetest.cpp @@ -8,6 +8,7 @@ #include <gtest/gtest.h> using storage::spi::test::makeSpiBucket; +using vespalib::Trinary; namespace storage::spi { @@ -154,35 +155,35 @@ TEST(ClusterStateTest, testReady) { lib::Distribution d(getCfg(3, 0)); ClusterState state(s, 0, d); - EXPECT_EQ(false, state.shouldBeReady(b)); + EXPECT_EQ(Trinary::False, state.shouldBeReady(b)); } // Only node 0 with 1 ready copy. for (uint32_t i = 0; i < 3; ++i) { lib::Distribution d(getCfg(3, 1)); ClusterState state(s, i, d); - EXPECT_EQ(i == 0, state.shouldBeReady(b)); + EXPECT_EQ((i == 0) ? Trinary::True : Trinary::False, state.shouldBeReady(b)); } // All of them with 3 ready copies for (uint32_t i = 0; i < 3; ++i) { lib::Distribution d(getCfg(3, 3)); ClusterState state(s, i, d); - EXPECT_EQ(true, state.shouldBeReady(b)); + EXPECT_EQ(Trinary::True, state.shouldBeReady(b)); } // Node 0 and node 1 with 2 ready copies. for (uint32_t i = 0; i < 3; ++i) { lib::Distribution d(getCfg(3, 2)); ClusterState state(s, i, d); - EXPECT_EQ(i == 0 || i == 2, state.shouldBeReady(b)); + EXPECT_EQ((i == 0 || i == 2) ? Trinary::True : Trinary::False, state.shouldBeReady(b)); } // All of them with 3 ready copies for (uint32_t i = 0; i < 3; ++i) { lib::Distribution d(getCfg(3, 3)); ClusterState state(s, i, d); - EXPECT_EQ(true, state.shouldBeReady(b)); + EXPECT_EQ(Trinary::True, state.shouldBeReady(b)); } lib::ClusterState s2("version:1 storage:3 .0.s:d distributor:3"); @@ -191,13 +192,13 @@ TEST(ClusterStateTest, testReady) for (uint32_t i = 0; i < 3; ++i) { lib::Distribution d(getCfg(3, 2)); ClusterState state(s2, i, d); - EXPECT_EQ(i == 1 || i == 2, state.shouldBeReady(b)); + EXPECT_EQ((i == 1 || i == 2) ? Trinary::True : Trinary::False, state.shouldBeReady(b)); } for (uint32_t i = 0; i < 3; ++i) { lib::Distribution d(getCfg(3, 1)); ClusterState state(s2, i, d); - EXPECT_EQ(i == 2, state.shouldBeReady(b)); + EXPECT_EQ((i == 2) ? Trinary::True : Trinary::False, state.shouldBeReady(b)); } } |