diff options
Diffstat (limited to 'document')
-rw-r--r-- | document/src/vespa/document/test/make_bucket_space.cpp | 13 | ||||
-rw-r--r-- | document/src/vespa/document/test/make_bucket_space.h | 3 |
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); } |