summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/docstore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-01-08 12:32:04 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-01-08 12:40:27 +0000
commit59da89504b2d573d8da77aaecceaf25f17c151d9 (patch)
tree1886b3418b49593a5e5990f75deaa748664870d7 /searchlib/src/tests/docstore
parent81e96f8b51dd1034f5ba1a72165202d4e15db2d5 (diff)
Remove interface to modify buffer.
Use shared_ptr to allow sharing instead of copy.
Diffstat (limited to 'searchlib/src/tests/docstore')
-rw-r--r--searchlib/src/tests/docstore/document_store/document_store_test.cpp8
-rw-r--r--searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp6
2 files changed, 7 insertions, 7 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 86c6d3ad883..f950377be4b 100644
--- a/searchlib/src/tests/docstore/document_store/document_store_test.cpp
+++ b/searchlib/src/tests/docstore/document_store/document_store_test.cpp
@@ -105,9 +105,9 @@ void verifyValue(vespalib::stringref s, const Value & v) {
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));
+ EXPECT_EQUAL(48ul, sizeof(Value));
+ EXPECT_EQUAL(56ul, sizeof(pair));
+ EXPECT_EQUAL(64ul, sizeof(Node));
}
TEST("require that Value can store uncompressed data") {
@@ -144,7 +144,7 @@ TEST("require that Value can store zstd compressed data") {
TEST("require that Value can detect if output not equal to input") {
Value v = createValue(S1, CompressionConfig::NONE);
- static_cast<uint8_t *>(v.get())[8] ^= 0xff;
+ const_cast<uint8_t *>(static_cast<const uint8_t *>(v.get()))[8] ^= 0xff;
EXPECT_FALSE(v.decompressed().second);
}
diff --git a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
index f92f5fd9581..11b7cd2520c 100644
--- a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
+++ b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
@@ -626,7 +626,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 = 22174;
+ constexpr size_t BASE_SZ = 20594;
TEST_DO(verifyCacheStats(ds.getCacheStats(), 0, 100, 100, BASE_SZ));
for (size_t i(1); i <= 100; i++) {
vcs.verifyRead(i);
@@ -648,11 +648,11 @@ TEST("test that the integrated visit cache works.") {
vcs.verifyVisit({7,9,17,19,67,88,89}, true);
TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 103, 99, BASE_SZ+180));
vcs.rewrite(17);
- TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 103, 97, BASE_SZ-680));
+ TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 103, 97, BASE_SZ-671));
vcs.verifyVisit({7,9,17,19,67,88,89}, true);
TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 104, 98, BASE_SZ-20));
vcs.remove(17);
- TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 104, 97, BASE_SZ-680));
+ TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 104, 97, BASE_SZ-671));
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-90));