Skip to content

Commit

Permalink
Update unittest for delete record
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
  • Loading branch information
congqixia committed Jan 3, 2025
1 parent 4a25a65 commit 1f39818
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions internal/core/unittest/test_delete_record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> expected = {0, 1, 0, 0, 0, 0, 0, 0, 0, 0};
std::vector<bool> 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);
Expand Down

0 comments on commit 1f39818

Please sign in to comment.