diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-08 20:00:26 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-08 20:00:26 +0000 |
commit | 03bf070dc2b8f9cab33525575c185525f3e5d2f2 (patch) | |
tree | b6c4671ae4a88be617453b539fb42a2dac1e4782 /vespalib/src/tests/datastore | |
parent | 3aedb80196984cfd8cf8c9c62c7fa004af517e0e (diff) |
Add test showing accounted memory usage for empty attributes.
Diffstat (limited to 'vespalib/src/tests/datastore')
-rw-r--r-- | vespalib/src/tests/datastore/unique_store/unique_store_test.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/vespalib/src/tests/datastore/unique_store/unique_store_test.cpp b/vespalib/src/tests/datastore/unique_store/unique_store_test.cpp index 176792962a6..b9f9becc5a4 100644 --- a/vespalib/src/tests/datastore/unique_store/unique_store_test.cpp +++ b/vespalib/src/tests/datastore/unique_store/unique_store_test.cpp @@ -467,6 +467,14 @@ TEST_F(DoubleTest, nan_is_handled) } std::vector<uint32_t> exp_enumerated = { 0, 1, 4, 2, 3, 1, 4, 2 }; EXPECT_EQ(exp_enumerated, enumerated); -} +} + +TEST_F(DoubleTest, control_memory_usage) { + EXPECT_EQ(472u, sizeof(store)); + EXPECT_EQ(32u, store.get_values_memory_usage().allocatedBytes()); + EXPECT_EQ(98208u, store.get_dictionary_memory_usage().allocatedBytes()); + EXPECT_EQ(98240u, store.getMemoryUsage().allocatedBytes()); + EXPECT_EQ(144u, sizeof(BufferState)); +} GTEST_MAIN_RUN_ALL_TESTS() |