Skip to content

Commit 9b1d2ee

Browse files
authored
chore: add read guard test (#627)
Signed-off-by: Alex Chi <[email protected]>
1 parent 28bae78 commit 9b1d2ee

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/storage/page_guard_test.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ namespace bustub {
2424

2525
// NOLINTNEXTLINE
2626
TEST(PageGuardTest, DISABLED_SampleTest) {
27-
const std::string db_name = "test.db";
2827
const size_t buffer_pool_size = 5;
2928
const size_t k = 2;
3029

@@ -44,6 +43,12 @@ TEST(PageGuardTest, DISABLED_SampleTest) {
4443

4544
EXPECT_EQ(0, page0->GetPinCount());
4645

46+
{
47+
auto *page2 = bpm->NewPage(&page_id_temp);
48+
page2->RLatch();
49+
auto guard2 = ReadPageGuard(bpm.get(), page2);
50+
}
51+
4752
// Shutdown the disk manager and remove the temporary file we created.
4853
disk_manager->ShutDown();
4954
}

0 commit comments

Comments
 (0)