summaryrefslogtreecommitdiffstats
path: root/storage/src/tests/persistence
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-02-15 13:55:18 +0000
committerArne Juul <arnej@verizonmedia.com>2021-02-15 14:16:22 +0000
commit5c163650a15ac1bc39657a28bbdc9dd57051cc62 (patch)
tree446e56d2aed0edf615d38ad0d671643f2fae3bb1 /storage/src/tests/persistence
parentaf9d59c3fece374c5fe61575c67ad49ac5f84bb4 (diff)
use size literals in storage
Diffstat (limited to 'storage/src/tests/persistence')
-rw-r--r--storage/src/tests/persistence/filestorage/filestormanagertest.cpp13
-rw-r--r--storage/src/tests/persistence/mergehandlertest.cpp3
2 files changed, 9 insertions, 7 deletions
diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
index acccbb8b9b9..8e4671fc78b 100644
--- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
+++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
@@ -26,6 +26,7 @@
#include <vespa/vdslib/state/random.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/vespalib/util/gate.h>
+#include <vespa/vespalib/util/size_literals.h>
#include <atomic>
#include <thread>
@@ -593,7 +594,7 @@ TEST_F(FileStorManagerTest, handler_paused_multi_thread) {
Document::SP doc(createDocument(content, "id:footype:testdoctype1:n=1234:bar").release());
- FastOS_ThreadPool pool(512 * 1024);
+ FastOS_ThreadPool pool(512_Ki);
MessagePusherThread pushthread(filestorHandler, doc);
pushthread.start(pool);
@@ -1277,7 +1278,7 @@ TEST_F(FileStorManagerTest, visiting) {
// Visit bucket with no split, using no selection
{
spi::IteratorId iterId(createIterator(top, ids[0], "true"));
- auto cmd = std::make_shared<GetIterCommand>(makeDocumentBucket(ids[0]), iterId, 16*1024);
+ auto cmd = std::make_shared<GetIterCommand>(makeDocumentBucket(ids[0]), iterId, 16_Ki);
top.sendDown(cmd);
top.waitForMessages(1, _waitTime);
ASSERT_EQ(1, top.getNumReplies());
@@ -1293,7 +1294,7 @@ TEST_F(FileStorManagerTest, visiting) {
uint32_t totalDocs = 0;
spi::IteratorId iterId(createIterator(top, ids[1], "testdoctype1.hstringval = \"John Doe\""));
while (true) {
- auto cmd = std::make_shared<GetIterCommand>(makeDocumentBucket(ids[1]), iterId, 16*1024);
+ auto cmd = std::make_shared<GetIterCommand>(makeDocumentBucket(ids[1]), iterId, 16_Ki);
top.sendDown(cmd);
top.waitForMessages(1, _waitTime);
ASSERT_EQ(1, top.getNumReplies());
@@ -1320,7 +1321,7 @@ TEST_F(FileStorManagerTest, visiting) {
framework::MicroSecTime(40)));
uint32_t totalDocs = 0;
while (true) {
- auto cmd = std::make_shared<GetIterCommand>(makeDocumentBucket(ids[1]), iterId, 16*1024);
+ auto cmd = std::make_shared<GetIterCommand>(makeDocumentBucket(ids[1]), iterId, 16_Ki);
top.sendDown(cmd);
top.waitForMessages(1, _waitTime);
ASSERT_EQ(1, top.getNumReplies());
@@ -1631,7 +1632,7 @@ TEST_F(FileStorManagerTest, get_iter) {
// Sending a getiter request that will only visit some of the docs
spi::IteratorId iterId(createIterator(top, bid, ""));
{
- auto cmd = std::make_shared<GetIterCommand>(makeDocumentBucket(bid), iterId, 2048);
+ auto cmd = std::make_shared<GetIterCommand>(makeDocumentBucket(bid), iterId, 2_Ki);
top.sendDown(cmd);
top.waitForMessages(1, _waitTime);
ASSERT_EQ(1, top.getNumReplies());
@@ -1656,7 +1657,7 @@ TEST_F(FileStorManagerTest, get_iter) {
EXPECT_EQ(ReturnCode(ReturnCode::OK), reply->getResult());
}
{
- auto cmd = std::make_shared<GetIterCommand>(makeDocumentBucket(bid), iterId, 2048);
+ auto cmd = std::make_shared<GetIterCommand>(makeDocumentBucket(bid), iterId, 2_Ki);
top.sendDown(cmd);
top.waitForMessages(1, _waitTime);
ASSERT_EQ(1, top.getNumReplies());
diff --git a/storage/src/tests/persistence/mergehandlertest.cpp b/storage/src/tests/persistence/mergehandlertest.cpp
index 7e810c0fff4..45d431890f5 100644
--- a/storage/src/tests/persistence/mergehandlertest.cpp
+++ b/storage/src/tests/persistence/mergehandlertest.cpp
@@ -8,6 +8,7 @@
#include <tests/common/message_sender_stub.h>
#include <vespa/document/test/make_document_bucket.h>
#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/vespalib/util/size_literals.h>
#include <gmock/gmock.h>
#include <cmath>
@@ -626,7 +627,7 @@ MergeHandlerTest::createDummyGetBucketDiff(int timestampOffset, uint16_t hasMask
diff.push_back(e);
}
- auto getBucketDiffCmd = std::make_shared<api::GetBucketDiffCommand>(_bucket, _nodes, 1024*1024);
+ auto getBucketDiffCmd = std::make_shared<api::GetBucketDiffCommand>(_bucket, _nodes, 1_Mi);
getBucketDiffCmd->getDiff() = diff;
return getBucketDiffCmd;
}