diff options
author | Geir Storli <geirst@verizonmedia.com> | 2019-05-23 10:55:54 +0000 |
---|---|---|
committer | Geir Storli <geirst@verizonmedia.com> | 2019-05-23 10:55:54 +0000 |
commit | a393a5ee43c92fb6e89af853b52d1f4a89e1d447 (patch) | |
tree | 40f53001901e2664510c1406124ee4e29cf08e0e /vdslib/src/tests/distribution/idealnodecalculatorimpltest.cpp | |
parent | c616b71e999c3ffeaf925b7747bd67d2c7f35ad6 (diff) |
Rewrite vdslib tests from cppunit to gtest.
Note that testSkew() and testSkewWithDown() have been inactive for 9 years and are removed.
testEmptyAndCopy() has never been executed and is also removed.
Diffstat (limited to 'vdslib/src/tests/distribution/idealnodecalculatorimpltest.cpp')
-rw-r--r-- | vdslib/src/tests/distribution/idealnodecalculatorimpltest.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/vdslib/src/tests/distribution/idealnodecalculatorimpltest.cpp b/vdslib/src/tests/distribution/idealnodecalculatorimpltest.cpp index b564a615994..f54c94ae8f9 100644 --- a/vdslib/src/tests/distribution/idealnodecalculatorimpltest.cpp +++ b/vdslib/src/tests/distribution/idealnodecalculatorimpltest.cpp @@ -1,22 +1,10 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/vdslib/distribution/idealnodecalculatorimpl.h> #include <vespa/config-stor-distribution.h> -#include <vespa/vdstestlib/cppunit/macros.h> - -namespace storage { -namespace lib { - -struct IdealNodeCalculatorImplTest : public CppUnit::TestFixture { - - void testNormalUsage(); - - CPPUNIT_TEST_SUITE(IdealNodeCalculatorImplTest); - CPPUNIT_TEST(testNormalUsage); - CPPUNIT_TEST_SUITE_END(); -}; +#include <vespa/vdslib/distribution/idealnodecalculatorimpl.h> +#include <vespa/vespalib/gtest/gtest.h> -CPPUNIT_TEST_SUITE_REGISTRATION(IdealNodeCalculatorImplTest); +namespace storage::lib { /** * Class is just a wrapper for distribution, so little needs to be tested. Just @@ -26,8 +14,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(IdealNodeCalculatorImplTest); * - Changes in distribution/cluster state is picked up. */ -void -IdealNodeCalculatorImplTest::testNormalUsage() +TEST(IdealNodeCalculatorImplTest, test_normal_usage) { ClusterState state("storage:10"); Distribution distr(Distribution::getDefaultDistributionConfig(3, 10)); @@ -38,10 +25,9 @@ IdealNodeCalculatorImplTest::testNormalUsage() configurable.setClusterState(state); std::string expected("[storage.8, storage.9, storage.6]"); - CPPUNIT_ASSERT_EQUAL( + EXPECT_EQ( expected, calc.getIdealStorageNodes(document::BucketId(16, 5)).toString()); } -} // lib -} // storage +} |