diff options
Diffstat (limited to 'document')
-rw-r--r-- | document/src/tests/fixed_bucket_spaces_test.cpp | 2 | ||||
-rw-r--r-- | document/src/vespa/document/bucket/fixed_bucket_spaces.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/document/src/tests/fixed_bucket_spaces_test.cpp b/document/src/tests/fixed_bucket_spaces_test.cpp index fab38c638a7..12c248adf37 100644 --- a/document/src/tests/fixed_bucket_spaces_test.cpp +++ b/document/src/tests/fixed_bucket_spaces_test.cpp @@ -44,11 +44,13 @@ void FixedBucketSpacesTest::bucket_space_from_name_throws_exception_for_unknown_ void FixedBucketSpacesTest::name_from_bucket_space_is_defined_for_default_space() { CPPUNIT_ASSERT_EQUAL(vespalib::stringref("default"), FixedBucketSpaces::to_string(FixedBucketSpaces::default_space())); + CPPUNIT_ASSERT_EQUAL(vespalib::stringref("default"), FixedBucketSpaces::default_space_name()); } void FixedBucketSpacesTest::name_from_bucket_space_is_defined_for_global_space() { CPPUNIT_ASSERT_EQUAL(vespalib::stringref("global"), FixedBucketSpaces::to_string(FixedBucketSpaces::global_space())); + CPPUNIT_ASSERT_EQUAL(vespalib::stringref("global"), FixedBucketSpaces::global_space_name()); } void FixedBucketSpacesTest::name_from_bucket_space_throws_exception_for_unknown_space() { diff --git a/document/src/vespa/document/bucket/fixed_bucket_spaces.h b/document/src/vespa/document/bucket/fixed_bucket_spaces.h index 87722c7a21c..c9786306897 100644 --- a/document/src/vespa/document/bucket/fixed_bucket_spaces.h +++ b/document/src/vespa/document/bucket/fixed_bucket_spaces.h @@ -16,6 +16,8 @@ VESPA_DEFINE_EXCEPTION(UnknownBucketSpaceException, vespalib::IllegalArgumentExc struct FixedBucketSpaces { static constexpr BucketSpace default_space() { return BucketSpace(1); }; static constexpr BucketSpace global_space() { return BucketSpace(2); } + static vespalib::stringref default_space_name() { return to_string(default_space()); } + static vespalib::stringref global_space_name() { return to_string(global_space()); } // Post-condition: returned space has valid() == true iff name // is either "default" or "global". |