summaryrefslogtreecommitdiffstats
path: root/document
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 /document
parenta897abcdcaad0d6bd88a043df1c6d3f147bf9717 (diff)
Consolidate makeBucketSpace() test functions to document module.
Diffstat (limited to 'document')
-rw-r--r--document/src/vespa/document/test/make_bucket_space.cpp13
-rw-r--r--document/src/vespa/document/test/make_bucket_space.h3
2 files changed, 15 insertions, 1 deletions
diff --git a/document/src/vespa/document/test/make_bucket_space.cpp b/document/src/vespa/document/test/make_bucket_space.cpp
index a213e5e36b7..be8292fcf71 100644
--- a/document/src/vespa/document/test/make_bucket_space.cpp
+++ b/document/src/vespa/document/test/make_bucket_space.cpp
@@ -9,4 +9,17 @@ 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();
+ }
+}
+
}
diff --git a/document/src/vespa/document/test/make_bucket_space.h b/document/src/vespa/document/test/make_bucket_space.h
index 8289ec2030a..8b17eaea1ac 100644
--- a/document/src/vespa/document/test/make_bucket_space.h
+++ b/document/src/vespa/document/test/make_bucket_space.h
@@ -6,8 +6,9 @@
namespace document::test {
-// Helper function used by unit tests
+// Helper functions used by unit tests
BucketSpace makeBucketSpace();
+BucketSpace makeBucketSpace(const vespalib::string &docTypeName);
}