summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-06-15 07:51:33 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-06-15 07:51:33 +0000
commit5343a9bea2b71203d3a804a9d6e04745723146cb (patch)
tree78965377886b78d3a16b1990445de84ff8c5c816 /searchlib/src/tests
parentb7fa88adf8cacacba2088d8532d79958182b1916 (diff)
- Move when possible.
- Add noexcept to enable more movement - Minor code cleanup.
Diffstat (limited to 'searchlib/src/tests')
-rw-r--r--searchlib/src/tests/docstore/document_store/visitcache_test.cpp2
-rw-r--r--searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp14
2 files changed, 8 insertions, 8 deletions
diff --git a/searchlib/src/tests/docstore/document_store/visitcache_test.cpp b/searchlib/src/tests/docstore/document_store/visitcache_test.cpp
index 14e3c19fe33..3f80bb6004f 100644
--- a/searchlib/src/tests/docstore/document_store/visitcache_test.cpp
+++ b/searchlib/src/tests/docstore/document_store/visitcache_test.cpp
@@ -62,7 +62,7 @@ TEST("require that BlobSet can be built") {
a.append(9, B("bbbbb",5));
verifyAB(a);
CompressionConfig cfg(CompressionConfig::LZ4);
- CompressedBlobSet ca(cfg, a);
+ CompressedBlobSet ca(cfg, std::move(a));
BlobSet b = ca.getBlobSet();
verifyAB(b);
}
diff --git a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
index 1080d44f2fb..1ca020bca86 100644
--- a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
+++ b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
@@ -368,13 +368,13 @@ TEST("test visit cache does not cache empty ones and is able to access some back
IDataStore & datastore = store.getStore();
VisitCache visitCache(datastore, 100000, CompressionConfig::Type::LZ4);
- EXPECT_EQUAL(0u, visitCache.read({1}).size());
+ EXPECT_EQUAL(12u, visitCache.read({1}).byteSize());
EXPECT_TRUE(visitCache.read({1}).empty());
datastore.write(1,1, A7, 7);
- EXPECT_EQUAL(0u, visitCache.read({2}).size());
+ EXPECT_EQUAL(12u, visitCache.read({2}).byteSize());
CompressedBlobSet cbs = visitCache.read({1});
EXPECT_FALSE(cbs.empty());
- EXPECT_EQUAL(19u, cbs.size());
+ EXPECT_EQUAL(19u, cbs.byteSize());
BlobSet bs(cbs.getBlobSet());
EXPECT_EQUAL(7u, bs.get(1).size());
EXPECT_EQUAL(0, strncmp(A7, bs.get(1).c_str(), 7));
@@ -664,14 +664,14 @@ TEST("test that the integrated visit cache works.") {
vcs.remove(17);
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-89));
+ TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 105, 98, BASE_SZ-70));
vcs.verifyVisit({41, 42}, true);
- TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 106, 99, BASE_SZ+215));
+ TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 106, 99, BASE_SZ+230));
vcs.verifyVisit({43, 44}, true);
- TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 107, 100, BASE_SZ+520));
+ TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 107, 100, BASE_SZ+540));
vcs.verifyVisit({41, 42, 43, 44}, true);
- TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 108, 99, BASE_SZ+340));
+ TEST_DO(verifyCacheStats(ds.getCacheStats(), 101, 108, 99, BASE_SZ+360));
}
TEST("testWriteRead") {