diff --git a/test/buffer/buffer_pool_manager_test.cpp b/test/buffer/buffer_pool_manager_test.cpp index 440c85cb9..78f8c9a26 100644 --- a/test/buffer/buffer_pool_manager_test.cpp +++ b/test/buffer/buffer_pool_manager_test.cpp @@ -24,7 +24,7 @@ namespace bustub { // NOLINTNEXTLINE // Check whether pages containing terminal characters can be recovered TEST(BufferPoolManagerTest, DISABLED_BinaryDataTest) { - const std::string db_name = "test.db"; + const std::string db_name = "test.bustub"; const size_t buffer_pool_size = 10; const size_t k = 5; @@ -90,7 +90,7 @@ TEST(BufferPoolManagerTest, DISABLED_BinaryDataTest) { // Shutdown the disk manager and remove the temporary file we created. disk_manager->ShutDown(); - remove("test.db"); + remove("test.bustub"); delete bpm; delete disk_manager; @@ -98,7 +98,7 @@ TEST(BufferPoolManagerTest, DISABLED_BinaryDataTest) { // NOLINTNEXTLINE TEST(BufferPoolManagerTest, DISABLED_SampleTest) { - const std::string db_name = "test.db"; + const std::string db_name = "test.bustub"; const size_t buffer_pool_size = 10; const size_t k = 5; @@ -148,7 +148,7 @@ TEST(BufferPoolManagerTest, DISABLED_SampleTest) { // Shutdown the disk manager and remove the temporary file we created. disk_manager->ShutDown(); - remove("test.db"); + remove("test.bustub"); delete bpm; delete disk_manager; diff --git a/test/container/disk/hash/hash_table_page_test.cpp b/test/container/disk/hash/hash_table_page_test.cpp index 56976baec..92f7d2c24 100644 --- a/test/container/disk/hash/hash_table_page_test.cpp +++ b/test/container/disk/hash/hash_table_page_test.cpp @@ -24,7 +24,7 @@ // // NOLINTNEXTLINE // TEST(HashTablePageTest, DISABLED_DirectoryPageSampleTest) { -// auto *disk_manager = new DiskManager("test.db"); +// auto *disk_manager = new DiskManager("test.bustub"); // auto *bpm = new BufferPoolManager(5, disk_manager); // // get a directory page from the BufferPoolManager @@ -50,14 +50,14 @@ // // unpin the directory page now that we are done // bpm->UnpinPage(directory_page_id, true); // disk_manager->ShutDown(); -// remove("test.db"); +// remove("test.bustub"); // delete disk_manager; // delete bpm; // } // // NOLINTNEXTLINE // TEST(HashTablePageTest, DISABLED_BucketPageSampleTest) { -// auto *disk_manager = new DiskManager("test.db"); +// auto *disk_manager = new DiskManager("test.bustub"); // auto *bpm = new BufferPoolManager(5, disk_manager); // // get a bucket page from the BufferPoolManager @@ -108,7 +108,7 @@ // // unpin the directory page now that we are done // bpm->UnpinPage(bucket_page_id, true); // disk_manager->ShutDown(); -// remove("test.db"); +// remove("test.bustub"); // delete disk_manager; // delete bpm; // } diff --git a/test/container/disk/hash/hash_table_test.cpp b/test/container/disk/hash/hash_table_test.cpp index 650d62b7a..d6279ce7a 100644 --- a/test/container/disk/hash/hash_table_test.cpp +++ b/test/container/disk/hash/hash_table_test.cpp @@ -25,7 +25,7 @@ // // NOLINTNEXTLINE // TEST(HashTableTest, DISABLED_SampleTest) { -// auto *disk_manager = new DiskManager("test.db"); +// auto *disk_manager = new DiskManager("test.bustub"); // auto *bpm = new BufferPoolManager(50, disk_manager); // DiskExtendibleHashTable ht("blah", bpm, IntComparator(), HashFunction()); @@ -112,7 +112,7 @@ // ht.VerifyIntegrity(); // disk_manager->ShutDown(); -// remove("test.db"); +// remove("test.bustub"); // delete disk_manager; // delete bpm; // } diff --git a/test/recovery/recovery_test.cpp.disabled b/test/recovery/recovery_test.cpp.disabled index 6225613d2..9b648ed17 100644 --- a/test/recovery/recovery_test.cpp.disabled +++ b/test/recovery/recovery_test.cpp.disabled @@ -36,21 +36,21 @@ class RecoveryTest : public ::testing::Test { protected: // This function is called before every test. void SetUp() override { - remove("test.db"); + remove("test.bustub"); remove("test.log"); } // This function is called after every test. void TearDown() override { LOG_INFO("Tearing down the system.."); - remove("test.db"); + remove("test.bustub"); remove("test.log"); }; }; // NOLINTNEXTLINE TEST_F(RecoveryTest, DISABLED_RedoTest) { - auto *bustub_instance = new BustubInstance("test.db"); + auto *bustub_instance = new BustubInstance("test.bustub"); ASSERT_FALSE(enable_logging); LOG_INFO("Skip system recovering..."); @@ -92,7 +92,7 @@ TEST_F(RecoveryTest, DISABLED_RedoTest) { delete bustub_instance; LOG_INFO("System restart..."); - bustub_instance = new BustubInstance("test.db"); + bustub_instance = new BustubInstance("test.bustub"); ASSERT_FALSE(enable_logging); LOG_INFO("Check if tuple is not in table before recovery"); @@ -139,7 +139,7 @@ TEST_F(RecoveryTest, DISABLED_RedoTest) { // NOLINTNEXTLINE TEST_F(RecoveryTest, DISABLED_UndoTest) { - auto *bustub_instance = new BustubInstance("test.db"); + auto *bustub_instance = new BustubInstance("test.bustub"); ASSERT_FALSE(enable_logging); LOG_INFO("Skip system recovering..."); @@ -176,7 +176,7 @@ TEST_F(RecoveryTest, DISABLED_UndoTest) { delete bustub_instance; LOG_INFO("System restarted.."); - bustub_instance = new BustubInstance("test.db"); + bustub_instance = new BustubInstance("test.bustub"); LOG_INFO("Check if tuple exists before recovery"); Tuple old_tuple; @@ -218,7 +218,7 @@ TEST_F(RecoveryTest, DISABLED_UndoTest) { // NOLINTNEXTLINE TEST_F(RecoveryTest, DISABLED_CheckpointTest) { - auto *bustub_instance = new BustubInstance("test.db"); + auto *bustub_instance = new BustubInstance("test.bustub"); EXPECT_FALSE(enable_logging); LOG_INFO("Skip system recovering..."); diff --git a/test/storage/disk_manager_test.cpp b/test/storage/disk_manager_test.cpp index 8234153e2..d0f7ad9f3 100644 --- a/test/storage/disk_manager_test.cpp +++ b/test/storage/disk_manager_test.cpp @@ -22,13 +22,13 @@ class DiskManagerTest : public ::testing::Test { protected: // This function is called before every test. void SetUp() override { - remove("test.db"); + remove("test.bustub"); remove("test.log"); } // This function is called after every test. void TearDown() override { - remove("test.db"); + remove("test.bustub"); remove("test.log"); }; }; @@ -37,7 +37,7 @@ class DiskManagerTest : public ::testing::Test { TEST_F(DiskManagerTest, ReadWritePageTest) { char buf[BUSTUB_PAGE_SIZE] = {0}; char data[BUSTUB_PAGE_SIZE] = {0}; - std::string db_file("test.db"); + std::string db_file("test.bustub"); auto dm = DiskManager(db_file); std::strncpy(data, "A test string.", sizeof(data)); @@ -59,7 +59,7 @@ TEST_F(DiskManagerTest, ReadWritePageTest) { TEST_F(DiskManagerTest, ReadWriteLogTest) { char buf[16] = {0}; char data[16] = {0}; - std::string db_file("test.db"); + std::string db_file("test.bustub"); auto dm = DiskManager(db_file); std::strncpy(data, "A test string.", sizeof(data)); @@ -73,6 +73,8 @@ TEST_F(DiskManagerTest, ReadWriteLogTest) { } // NOLINTNEXTLINE -TEST_F(DiskManagerTest, ThrowBadFileTest) { EXPECT_THROW(DiskManager("dev/null\\/foo/bar/baz/test.db"), Exception); } +TEST_F(DiskManagerTest, ThrowBadFileTest) { + EXPECT_THROW(DiskManager("dev/null\\/foo/bar/baz/test.bustub"), Exception); +} } // namespace bustub diff --git a/test/table/tuple_test.cpp b/test/table/tuple_test.cpp index 780559496..ac953db4b 100644 --- a/test/table/tuple_test.cpp +++ b/test/table/tuple_test.cpp @@ -37,7 +37,7 @@ TEST(TupleTest, DISABLED_TableHeapTest) { Tuple tuple = ConstructTuple(&schema); // create transaction - auto *disk_manager = new DiskManager("test.db"); + auto *disk_manager = new DiskManager("test.bustub"); auto *buffer_pool_manager = new BufferPoolManager(50, disk_manager); auto *table = new TableHeap(buffer_pool_manager); @@ -54,7 +54,7 @@ TEST(TupleTest, DISABLED_TableHeapTest) { } disk_manager->ShutDown(); - remove("test.db"); // remove db file + remove("test.bustub"); // remove db file remove("test.log"); delete table; delete buffer_pool_manager; diff --git a/tools/b_plus_tree_printer/b_plus_tree_printer.cpp b/tools/b_plus_tree_printer/b_plus_tree_printer.cpp index 2b3f37d11..c8c628a24 100644 --- a/tools/b_plus_tree_printer/b_plus_tree_printer.cpp +++ b/tools/b_plus_tree_printer/b_plus_tree_printer.cpp @@ -72,7 +72,7 @@ auto main(int argc, char **argv) -> int { GenericComparator<8> comparator(key_schema.get()); - auto *disk_manager = new DiskManager("test.db"); + auto *disk_manager = new DiskManager("test.bustub"); auto *bpm = new BufferPoolManager(100, disk_manager); // create and fetch header_page page_id_t page_id; @@ -136,7 +136,7 @@ auto main(int argc, char **argv) -> int { delete bpm; delete transaction; delete disk_manager; - remove("test.db"); + remove("test.bustub"); remove("test.log"); return 0; diff --git a/tools/shell/shell.cpp b/tools/shell/shell.cpp index 83506cf82..03f281ec8 100644 --- a/tools/shell/shell.cpp +++ b/tools/shell/shell.cpp @@ -29,7 +29,7 @@ auto GetWidthOfUtf8(const void *beg, const void *end, size_t *width) -> int { auto main(int argc, char **argv) -> int { ft_set_u8strwid_func(&GetWidthOfUtf8); - auto bustub = std::make_unique("test.db"); + auto bustub = std::make_unique("test.bustub"); auto default_prompt = "bustub> "; auto emoji_prompt = "\U0001f6c1> "; // the bathtub emoji diff --git a/tools/sqllogictest/sqllogictest.cpp b/tools/sqllogictest/sqllogictest.cpp index f78920849..86d906809 100644 --- a/tools/sqllogictest/sqllogictest.cpp +++ b/tools/sqllogictest/sqllogictest.cpp @@ -257,7 +257,7 @@ auto main(int argc, char **argv) -> int { // NOLINT if (program.get("--in-memory")) { bustub = std::make_unique(); } else { - bustub = std::make_unique("test.db"); + bustub = std::make_unique("test.bustub"); } bustub->GenerateMockTable(); diff --git a/tools/wasm-bpt-printer/wasm-bpt-printer.cpp b/tools/wasm-bpt-printer/wasm-bpt-printer.cpp index 53145423a..0c9ec4927 100644 --- a/tools/wasm-bpt-printer/wasm-bpt-printer.cpp +++ b/tools/wasm-bpt-printer/wasm-bpt-printer.cpp @@ -57,7 +57,7 @@ auto BustubInit(int leaf_max_size, int internal_max_size) -> int { GenericComparator<8> comparator(key_schema.get()); - auto *disk_manager = new DiskManager("test.db"); + auto *disk_manager = new DiskManager("test.bustub"); bpm = new BufferPoolManager(100, disk_manager); // create header_page page_id_t page_id;