Skip to content

Commit

Permalink
Format change from .db to .bustub (#722)
Browse files Browse the repository at this point in the history
* Format change from .db to .bustub

* Changed format from .db to .bustub in /tools folder

* Log file (added by mistake in prev commit now removed
  • Loading branch information
prashanthduvvada committed Aug 20, 2024
1 parent f4c8eca commit 3adc1c0
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 29 deletions.
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
4 changes: 2 additions & 2 deletions tools/b_plus_tree_printer/b_plus_tree_printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tools/shell/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bustub::BustubInstance>("test.db");
auto bustub = std::make_unique<bustub::BustubInstance>("test.bustub");

auto default_prompt = "bustub> ";
auto emoji_prompt = "\U0001f6c1> "; // the bathtub emoji
Expand Down
2 changes: 1 addition & 1 deletion tools/sqllogictest/sqllogictest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ auto main(int argc, char **argv) -> int { // NOLINT
if (program.get<bool>("--in-memory")) {
bustub = std::make_unique<bustub::BustubInstance>();
} else {
bustub = std::make_unique<bustub::BustubInstance>("test.db");
bustub = std::make_unique<bustub::BustubInstance>("test.bustub");
}

bustub->GenerateMockTable();
Expand Down
2 changes: 1 addition & 1 deletion tools/wasm-bpt-printer/wasm-bpt-printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3adc1c0

Please sign in to comment.