summaryrefslogtreecommitdiffstats
path: root/persistence
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@oath.com>2017-11-14 13:30:35 +0000
committerTor Egge <Tor.Egge@oath.com>2017-11-14 13:34:19 +0000
commit6774536c128590b70e20b6e04b442fb73e3c33bb (patch)
treead45f5930b16735423725edc895289a70dc53614 /persistence
parenta897abcdcaad0d6bd88a043df1c6d3f147bf9717 (diff)
Consolidate makeBucketSpace() test functions to document module.
Diffstat (limited to 'persistence')
-rw-r--r--persistence/src/vespa/persistence/conformancetest/conformancetest.cpp3
-rw-r--r--persistence/src/vespa/persistence/spi/test.cpp22
-rw-r--r--persistence/src/vespa/persistence/spi/test.h2
3 files changed, 5 insertions, 22 deletions
diff --git a/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp b/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp
index 30aa19c6a86..57ebd36ce00 100644
--- a/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp
+++ b/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp
@@ -7,6 +7,7 @@
#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/document/update/documentupdate.h>
#include <vespa/document/update/assignvalueupdate.h>
+#include <vespa/document/test/make_bucket_space.h>
#include <vespa/vdslib/state/state.h>
#include <vespa/vdslib/state/node.h>
#include <vespa/vdslib/state/nodestate.h>
@@ -18,8 +19,8 @@
using document::BucketId;
using document::BucketSpace;
+using document::test::makeBucketSpace;
using storage::spi::test::makeSpiBucket;
-using storage::spi::test::makeBucketSpace;
namespace storage::spi {
diff --git a/persistence/src/vespa/persistence/spi/test.cpp b/persistence/src/vespa/persistence/spi/test.cpp
index e376bd6b4d4..b58d527c598 100644
--- a/persistence/src/vespa/persistence/spi/test.cpp
+++ b/persistence/src/vespa/persistence/spi/test.cpp
@@ -1,33 +1,17 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "test.h"
+#include <vespa/document/test/make_bucket_space.h>
using document::BucketId;
using document::BucketSpace;
+using document::test::makeBucketSpace;
namespace storage::spi::test {
-BucketSpace makeBucketSpace()
-{
- return BucketSpace::placeHolder();
-}
-
-BucketSpace makeBucketSpace(const vespalib::string &docTypeName)
-{
- // Used by persistence conformance test to map fron document type name
- // to bucket space. See document::TestDocRepo for known document types.
- if (docTypeName == "no") {
- return BucketSpace(2);
- } else if (docTypeName == "testdoctype2") {
- return BucketSpace(1);
- } else {
- return makeBucketSpace();
- }
-}
-
Bucket makeSpiBucket(BucketId bucketId, PartitionId partitionId)
{
- return Bucket(document::Bucket(BucketSpace::placeHolder(), bucketId), partitionId);
+ return Bucket(document::Bucket(makeBucketSpace(), bucketId), partitionId);
}
Bucket makeSpiBucket(BucketId bucketId)
diff --git a/persistence/src/vespa/persistence/spi/test.h b/persistence/src/vespa/persistence/spi/test.h
index 06bade014ab..445cfc91213 100644
--- a/persistence/src/vespa/persistence/spi/test.h
+++ b/persistence/src/vespa/persistence/spi/test.h
@@ -8,8 +8,6 @@ namespace storage::spi::test {
// Helper functions used by unit tests
-document::BucketSpace makeBucketSpace();
-document::BucketSpace makeBucketSpace(const vespalib::string &docTypeName);
Bucket makeSpiBucket(document::BucketId bucketId, PartitionId partitionId);
Bucket makeSpiBucket(document::BucketId bucketId);