Skip to content

Commit

Permalink
Check status.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbi42 committed Aug 17, 2023
1 parent 30f385c commit 2aee1c1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions db/db_iterator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2465,28 +2465,28 @@ TEST_P(DBIteratorTest, RefreshWithSnapshot) {
iter->Seek(Key(1));
verify_iter(1, 3);
// Refresh to same snapshot
iter->Refresh(snapshot);
ASSERT_OK(iter->Refresh(snapshot));
ASSERT_TRUE(iter->status().ok() && !iter->Valid());
iter->Seek(Key(3));
verify_iter(3, 6);
ASSERT_TRUE(iter->status().ok() && !iter->Valid());

// Refresh to a newer snapshot
iter->Refresh(snapshot2);
ASSERT_OK(iter->Refresh(snapshot2));
ASSERT_TRUE(iter->status().ok() && !iter->Valid());
iter->SeekToFirst();
verify_iter(0, 4, /*new_key2=*/true);
ASSERT_TRUE(iter->status().ok() && !iter->Valid());

// Refresh to an older snapshot
iter->Refresh(snapshot);
ASSERT_OK(iter->Refresh(snapshot));
ASSERT_TRUE(iter->status().ok() && !iter->Valid());
iter->Seek(Key(3));
verify_iter(3, 6);
ASSERT_TRUE(iter->status().ok() && !iter->Valid());

// Refresh to no snapshot
iter->Refresh();
ASSERT_OK(iter->Refresh());
ASSERT_TRUE(iter->status().ok() && !iter->Valid());
iter->Seek(Key(2));
verify_iter(2, 4, /*new_key2=*/true);
Expand All @@ -2497,7 +2497,7 @@ TEST_P(DBIteratorTest, RefreshWithSnapshot) {
ASSERT_OK(Flush());

// Refresh back to original snapshot
iter->Refresh(snapshot);
ASSERT_OK(iter->Refresh(snapshot));
}

delete iter;
Expand Down

0 comments on commit 2aee1c1

Please sign in to comment.