From 1f39818e28a4dbd3bdd618eef7eb000687d3e048 Mon Sep 17 00:00:00 2001 From: Congqi Xia Date: Fri, 3 Jan 2025 08:49:17 +0800 Subject: [PATCH] Update unittest for delete record Signed-off-by: Congqi Xia --- internal/core/unittest/test_delete_record.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/internal/core/unittest/test_delete_record.cpp b/internal/core/unittest/test_delete_record.cpp index 62bcb90a392c1..1cb232e21b4f9 100644 --- a/internal/core/unittest/test_delete_record.cpp +++ b/internal/core/unittest/test_delete_record.cpp @@ -58,22 +58,14 @@ TEST(DeleteMVCC, common_case) { BitsetType bitsets(c); BitsetTypeView bitsets_view(bitsets); auto insert_barrier = c; - // query at ts (11) - Timestamp query_timestamp = 11; + // query at ts (10) + // same as delete ts, shall not set bitset + Timestamp query_timestamp = 10; delete_record.Query(bitsets_view, insert_barrier, query_timestamp); - std::vector expected = {0, 1, 0, 0, 0, 0, 0, 0, 0, 0}; + std::vector expected = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; for (int i = 0; i < c; i++) { ASSERT_EQ(bitsets_view[i], expected[i]); } - BitsetType bitsets2(c); - BitsetTypeView bitsets_view2(bitsets); - // query at ts (10) - query_timestamp = 10; - delete_record.Query(bitsets_view2, insert_barrier, query_timestamp); - expected = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - for (int i = 0; i < c; i++) { - ASSERT_EQ(bitsets_view2[i], expected[i]); - } } { BitsetType bitsets(c);