summaryrefslogtreecommitdiffstats
path: root/storage/src/tests
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-04-16 15:39:04 +0200
committerHenning Baldersheim <balder@oath.com>2018-04-16 15:39:04 +0200
commit49d2314efda87f61fd37665ebeac766b06a731fa (patch)
tree413aaa65f972113091c17eec219b15cedaca4ee3 /storage/src/tests
parentdb68de6f457386b0c8d02926489df8a0f784a8e1 (diff)
Remove no longer needed hash normalizer.
Diffstat (limited to 'storage/src/tests')
-rw-r--r--storage/src/tests/bucketdb/CMakeLists.txt1
-rw-r--r--storage/src/tests/bucketdb/distribution_hash_normalizer_test.cpp114
-rw-r--r--storage/src/tests/distributor/distributortest.cpp1
3 files changed, 0 insertions, 116 deletions
diff --git a/storage/src/tests/bucketdb/CMakeLists.txt b/storage/src/tests/bucketdb/CMakeLists.txt
index 5aa4e18cb84..13c9863aa8e 100644
--- a/storage/src/tests/bucketdb/CMakeLists.txt
+++ b/storage/src/tests/bucketdb/CMakeLists.txt
@@ -3,7 +3,6 @@ vespa_add_library(storage_testbucketdb TEST
SOURCES
bucketinfotest.cpp
bucketmanagertest.cpp
- distribution_hash_normalizer_test.cpp
initializertest.cpp
judyarraytest.cpp
judymultimaptest.cpp
diff --git a/storage/src/tests/bucketdb/distribution_hash_normalizer_test.cpp b/storage/src/tests/bucketdb/distribution_hash_normalizer_test.cpp
deleted file mode 100644
index da7db8c6f4c..00000000000
--- a/storage/src/tests/bucketdb/distribution_hash_normalizer_test.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vdstestlib/cppunit/macros.h>
-#include <vespa/storage/bucketdb/distribution_hash_normalizer.h>
-#include <string>
-
-namespace storage {
-
-using Normalizer = DistributionHashNormalizer;
-
-class DistributionHashNormalizerTest : public CppUnit::TestFixture {
-public:
- CPPUNIT_TEST_SUITE(DistributionHashNormalizerTest);
- CPPUNIT_TEST(orderNonHierarchicRootGroupNodesByDistributionKey);
- CPPUNIT_TEST(mayHaveSameGroupIndexAsNodeIndex);
- CPPUNIT_TEST(emitOptionalCapacityForRootGroup);
- CPPUNIT_TEST(emitOptionalCapacityForSubGroups);
- CPPUNIT_TEST(hierarchicGroupsAreOrderedByGroupIndex);
- CPPUNIT_TEST(subgroupsOrderedOnEachNestingLevel);
- CPPUNIT_TEST(distributionSpecIsCopiedVerbatim);
- CPPUNIT_TEST(emptyInputYieldsEmptyOutput);
- CPPUNIT_TEST(parseFailureReturnsInputVerbatim);
- CPPUNIT_TEST_SUITE_END();
-
- void orderNonHierarchicRootGroupNodesByDistributionKey();
- void mayHaveSameGroupIndexAsNodeIndex();
- void emitOptionalCapacityForRootGroup();
- void emitOptionalCapacityForSubGroups();
- void hierarchicGroupsAreOrderedByGroupIndex();
- void subgroupsOrderedOnEachNestingLevel();
- void distributionSpecIsCopiedVerbatim();
- void emptyInputYieldsEmptyOutput();
- void parseFailureReturnsInputVerbatim();
-
-private:
- DistributionHashNormalizer _normalizer;
-};
-
-CPPUNIT_TEST_SUITE_REGISTRATION(DistributionHashNormalizerTest);
-
-void
-DistributionHashNormalizerTest::orderNonHierarchicRootGroupNodesByDistributionKey()
-{
- // Group index is first in list.
- CPPUNIT_ASSERT_EQUAL(vespalib::string("(1;0;2;3;4;7)"),
- _normalizer.normalize("(1;4;7;2;0;3)"));
-}
-
-void
-DistributionHashNormalizerTest::mayHaveSameGroupIndexAsNodeIndex()
-{
- CPPUNIT_ASSERT_EQUAL(vespalib::string("(0;0;2;3;4;7)"),
- _normalizer.normalize("(0;4;7;2;0;3)"));
-}
-
-void
-DistributionHashNormalizerTest::emitOptionalCapacityForRootGroup()
-{
- CPPUNIT_ASSERT_EQUAL(vespalib::string("(0c12.5;1;2;3;4;7)"),
- _normalizer.normalize("(0c12.5;1;4;7;2;3)"));
-}
-
-void
-DistributionHashNormalizerTest::emitOptionalCapacityForSubGroups()
-{
- CPPUNIT_ASSERT_EQUAL(vespalib::string("(0d1|*(1c5.5;1)(2;2)(3c7;3))"),
- _normalizer.normalize("(0d1|*(2;2)(1c5.5;1)(3c7;3))"));
-}
-
-void
-DistributionHashNormalizerTest::hierarchicGroupsAreOrderedByGroupIndex()
-{
- CPPUNIT_ASSERT_EQUAL(vespalib::string("(0d1|*(0;0)(1;1)(3;3))"),
- _normalizer.normalize("(0d1|*(3;3)(1;1)(0;0))"));
-}
-
-void
-DistributionHashNormalizerTest::subgroupsOrderedOnEachNestingLevel()
-{
- CPPUNIT_ASSERT_EQUAL(vespalib::string("(0d1|*(1d3|*(2;2)(3;3))"
- "(4;1)(7d2|*(5;5)(6;6)))"),
- _normalizer.normalize("(0d1|*(7d2|*(6;6)(5;5))"
- "(1d3|*(2;2)(3;3))(4;1))"));
-}
-
-void
-DistributionHashNormalizerTest::distributionSpecIsCopiedVerbatim()
-{
- // Definitely don't want to do any ordering of the distribution spec.
- CPPUNIT_ASSERT_EQUAL(vespalib::string("(0d3|2|1|*(0;0)(1;1)(3;3))"),
- _normalizer.normalize("(0d3|2|1|*(3;3)(1;1)(0;0))"));
-}
-
-void
-DistributionHashNormalizerTest::emptyInputYieldsEmptyOutput()
-{
- // Technically a parse failure (only 4.2 has this behavior), but it's
- // explicitly checked for in BucketManager, so let's test it explicitly
- // here as well.
- CPPUNIT_ASSERT_EQUAL(vespalib::string(""), _normalizer.normalize(""));
-}
-
-// In the (unlikely) case that the parser somehow fails to capture all possible
-// valid values of the distribution hash, fall back to returning the non-
-// normalized string. A log warning will also be emitted (though that's not
-// testable).
-void
-DistributionHashNormalizerTest::parseFailureReturnsInputVerbatim()
-{
- CPPUNIT_ASSERT_EQUAL(vespalib::string("onkel skrue"),
- _normalizer.normalize("onkel skrue"));
-}
-
-} // storage
-
diff --git a/storage/src/tests/distributor/distributortest.cpp b/storage/src/tests/distributor/distributortest.cpp
index 28fccf438ff..a9b28bd2542 100644
--- a/storage/src/tests/distributor/distributortest.cpp
+++ b/storage/src/tests/distributor/distributortest.cpp
@@ -1,6 +1,5 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <boost/assign/std/vector.hpp> // for 'operator+=()'
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/storage/distributor/idealstatemetricsset.h>
#include <vespa/storageapi/message/persistence.h>