From 5196578023bde01331765941040e30179d479c24 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Sun, 3 Jul 2022 20:13:43 +0200 Subject: Use std::filesystem::resize_file. --- searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp index 418182f7bbf..9538db391df 100644 --- a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp +++ b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include using document::BucketId; @@ -292,8 +293,7 @@ TEST("testTruncatedIdxFile"){ } const char * magic = "mumbo jumbo"; { - int truncate_result = truncate("bug-7257706-truncated/1422358701368384000.idx", 3830); - EXPECT_EQUAL(0, truncate_result); + std::filesystem::resize_file(std::filesystem::path("bug-7257706-truncated/1422358701368384000.idx"), 3830); LogDataStore datastore(executor, "bug-7257706-truncated", config, GrowStrategy(), TuneFileSummary(), fileHeaderContext, tlSyncer, nullptr); EXPECT_EQUAL(331ul, datastore.lastSyncToken()); -- cgit v1.2.3