summaryrefslogtreecommitdiffstats
path: root/staging_vespalib/src/tests/directio/directio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'staging_vespalib/src/tests/directio/directio.cpp')
-rw-r--r--staging_vespalib/src/tests/directio/directio.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/staging_vespalib/src/tests/directio/directio.cpp b/staging_vespalib/src/tests/directio/directio.cpp
index 04155f71f94..7877216b191 100644
--- a/staging_vespalib/src/tests/directio/directio.cpp
+++ b/staging_vespalib/src/tests/directio/directio.cpp
@@ -2,6 +2,7 @@
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/stllike/string.h>
+#include <vespa/vespalib/util/size_literals.h>
#include <vespa/vespalib/data/databuffer.h>
#include <vespa/fastos/file.h>
@@ -21,12 +22,12 @@ TEST("that DirectIOException is thrown on unaligned buf.") {
FastOS_File f("staging_vespalib_directio_test_app");
f.EnableDirectIO();
EXPECT_TRUE(f.OpenReadOnly());
- DataBuffer buf(10000, 4096);
+ DataBuffer buf(10000, 4_Ki);
bool caught(false);
try {
- f.ReadBuf(buf.getFree()+1, 4096, 0);
+ f.ReadBuf(buf.getFree()+1, 4_Ki, 0);
} catch (const DirectIOException & e) {
- EXPECT_EQUAL(4096u, e.getLength());
+ EXPECT_EQUAL(4_Ki, e.getLength());
EXPECT_EQUAL(0u, e.getOffset());
EXPECT_EQUAL(buf.getFree()+1, e.getBuffer());
EXPECT_EQUAL(string(f.GetFileName()), e.getFileName());
@@ -39,12 +40,12 @@ TEST("that DirectIOException is thrown on unaligned offset.") {
FastOS_File f("staging_vespalib_directio_test_app");
f.EnableDirectIO();
EXPECT_TRUE(f.OpenReadOnly());
- DataBuffer buf(10000, 4096);
+ DataBuffer buf(10000, 4_Ki);
bool caught(false);
try {
- f.ReadBuf(buf.getFree(), 4096, 1);
+ f.ReadBuf(buf.getFree(), 4_Ki, 1);
} catch (const DirectIOException & e) {
- EXPECT_EQUAL(4096u, e.getLength());
+ EXPECT_EQUAL(4_Ki, e.getLength());
EXPECT_EQUAL(1u, e.getOffset());
EXPECT_EQUAL(buf.getFree(), e.getBuffer());
EXPECT_EQUAL(string(f.GetFileName()), e.getFileName());