diff options
author | Henning Baldersheim <balder@oath.com> | 2018-09-24 11:50:47 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-09-24 11:50:47 +0200 |
commit | 85491d4ce0d186321e2c8a34f62ae13cadd6d5a4 (patch) | |
tree | f06b1f7ff8f82b657fe57df0eb433fc244602a74 /searchlib/src/tests | |
parent | 963ede37edb248accf9eba715d83eca45c8804b9 (diff) |
Update comments and tests as memory size has increased by 8 bytes per entry in the cache.
Diffstat (limited to 'searchlib/src/tests')
-rw-r--r-- | searchlib/src/tests/docstore/document_store/document_store_test.cpp | 9 | ||||
-rw-r--r-- | searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp | 18 |
2 files changed, 17 insertions, 10 deletions
diff --git a/searchlib/src/tests/docstore/document_store/document_store_test.cpp b/searchlib/src/tests/docstore/document_store/document_store_test.cpp index 16acbdfe878..649fb675dca 100644 --- a/searchlib/src/tests/docstore/document_store/document_store_test.cpp +++ b/searchlib/src/tests/docstore/document_store/document_store_test.cpp @@ -102,8 +102,15 @@ void verifyValue(vespalib::stringref s, const Value & v) { EXPECT_EQUAL(0, memcmp(s.data(), result.first.getData(), result.first.getDataLen())); } -TEST("require that Value can store uncompressed data") { +TEST("require that Value and cache entries have expected size") { + using pair = std::pair<DocumentIdT, Value>; + using Node = vespalib::hash_node<pair>; EXPECT_EQUAL(64ul, sizeof(Value)); + EXPECT_EQUAL(72ul, sizeof(pair)); + EXPECT_EQUAL(80ul, sizeof(Node)); +} + +TEST("require that Value can store uncompressed data") { Value v = createValue(S1, CompressionConfig::NONE); verifyValue(S1, v); } diff --git a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp index 34046f551d9..eb49a556bdc 100644 --- a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp +++ b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp @@ -622,7 +622,7 @@ TEST("test that the integrated visit cache works.") { for (size_t i(1); i <= 100; i++) { vcs.verifyRead(i); } - constexpr size_t BASE_SZ = 21374; + constexpr size_t BASE_SZ = 22174; TEST_DO(verifyCacheStats(ds.getCacheStats(), 0, 100, 100, BASE_SZ)); for (size_t i(1); i <= 100; i++) { vcs.verifyRead(i); @@ -642,22 +642,22 @@ TEST("test that the integrated visit cache works.") { vcs.verifyVisit({7,9,17,19,67,88}, true); TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 102, 99, BASE_SZ+130)); vcs.verifyVisit({7,9,17,19,67,88,89}, true); - TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 103, 99, BASE_SZ+201)); + TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 103, 99, BASE_SZ+180)); vcs.rewrite(17); - TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 103, 97, BASE_SZ-657)); + TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 103, 97, BASE_SZ-680)); vcs.verifyVisit({7,9,17,19,67,88,89}, true); - TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 104, 98, BASE_SZ-3)); + TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 104, 98, BASE_SZ-20)); vcs.remove(17); - TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 104, 97, BASE_SZ-657)); + TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 104, 97, BASE_SZ-680)); vcs.verifyVisit({7,9,17,19,67,88,89}, {7,9,19,67,88,89}, true); - TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 105, 98, BASE_SZ-64)); + TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 105, 98, BASE_SZ-90)); vcs.verifyVisit({41, 42}, true); - TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 106, 99, BASE_SZ+238)); + TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 106, 99, BASE_SZ+210)); vcs.verifyVisit({43, 44}, true); - TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 107, 100, BASE_SZ+540)); + TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 107, 100, BASE_SZ+520)); vcs.verifyVisit({41, 42, 43, 44}, true); - TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 108, 99, BASE_SZ+362)); + TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 108, 99, BASE_SZ+340)); } TEST("testWriteRead") { |