summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/tests/attribute/enumstore/enumstore_test.cpp')
-rw-r--r--searchlib/src/tests/attribute/enumstore/enumstore_test.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp b/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
index 5346cc7f764..99fdd9f4b0a 100644
--- a/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
+++ b/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/searchlib/attribute/enumstore.hpp>
+#include <vespa/vespalib/test/memory_allocator_observer.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/log/log.h>
@@ -11,6 +12,8 @@ using vespalib::datastore::CompactionStrategy;
using vespalib::datastore::EntryRef;
using vespalib::datastore::EntryRefFilter;
using RefT = vespalib::datastore::EntryRefT<22>;
+using vespalib::alloc::test::MemoryAllocatorObserver;
+using AllocStats = MemoryAllocatorObserver::Stats;
namespace vespalib::datastore {
@@ -374,6 +377,13 @@ TEST(EnumStoreTest, address_space_usage_is_reported)
EXPECT_EQ(AddressSpace(3, 3, ADDRESS_LIMIT + 2), store.get_values_address_space_usage());
}
+TEST(EnumStoreTest, provided_memory_allocator_is_used)
+{
+ AllocStats stats;
+ NumericEnumStore ses(false, DictionaryConfig::Type::BTREE, std::make_unique<MemoryAllocatorObserver>(stats));
+ EXPECT_EQ(AllocStats(1, 0), stats);
+}
+
class BatchUpdaterTest : public ::testing::Test {
public:
NumericEnumStore store;