Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format change from .db to .bustub #722

Merged
merged 3 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/buffer/buffer_pool_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -90,15 +90,15 @@ 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;
}

// 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;

Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions test/container/disk/hash/hash_table_page_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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;
// }
Expand Down
4 changes: 2 additions & 2 deletions test/container/disk/hash/hash_table_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, int, IntComparator> ht("blah", bpm, IntComparator(), HashFunction<int>());

Expand Down Expand Up @@ -112,7 +112,7 @@
// ht.VerifyIntegrity();

// disk_manager->ShutDown();
// remove("test.db");
// remove("test.bustub");
// delete disk_manager;
// delete bpm;
// }
Expand Down
14 changes: 7 additions & 7 deletions test/recovery/recovery_test.cpp.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -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...");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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...");
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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...");
Expand Down
12 changes: 7 additions & 5 deletions test/storage/disk_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
};
};
Expand All @@ -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));

Expand All @@ -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));

Expand All @@ -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
4 changes: 2 additions & 2 deletions test/table/tuple_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand Down
Loading