From e903df12aeaff411af827bacbad4001d27cf572a Mon Sep 17 00:00:00 2001 From: Valery Mironov <32071355+MBkkt@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:23:44 +0200 Subject: [PATCH] Fix test --- tests/index/postings_tests.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/index/postings_tests.cpp b/tests/index/postings_tests.cpp index 36d8d1b8a..f7c90ac6d 100644 --- a/tests/index/postings_tests.cpp +++ b/tests/index/postings_tests.cpp @@ -55,12 +55,13 @@ void insert_find_core(const std::vector& src) { const std::string& s = src[i]; const bytes_view b = detail::to_bytes_view(s); auto res = bh.emplace(b); - ASSERT_NE(nullptr, res.first); - ASSERT_TRUE(res.second); + ASSERT_NE(nullptr, res); + ASSERT_FALSE(doc_limits::valid(res->doc)); + res->doc = doc_limits::invalid() + 1; res = bh.emplace(b); - ASSERT_NE(nullptr, res.first); - ASSERT_FALSE(res.second); + ASSERT_NE(nullptr, res); + ASSERT_TRUE(doc_limits::valid(res->doc)); } ASSERT_GT(memory.counter_, 0); @@ -72,21 +73,21 @@ void insert_find_core(const std::vector& src) { const std::string long_str(block_size - irs::bytes_io::vsize(32767), 'c'); auto res = bh.emplace(detail::to_bytes_view(long_str)); - ASSERT_TRUE(res.second); + ASSERT_FALSE(doc_limits::valid(res->doc)); } // insert long key { const std::string too_long_str(block_size, 'c'); auto res = bh.emplace(detail::to_bytes_view(too_long_str)); - ASSERT_TRUE(res.second); + ASSERT_FALSE(doc_limits::valid(res->doc)); } // insert too long key { const std::string too_long_str(1 + block_size, 'c'); auto res = bh.emplace(detail::to_bytes_view(too_long_str)); - ASSERT_FALSE(res.second); + ASSERT_EQ(nullptr, res); } ASSERT_GT(memory.counter_, 0); pool.reset();