Skip to content

Commit

Permalink
Fix unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
small-turtle-1 committed Dec 11, 2024
1 parent 8ba671b commit e66a36c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/unit_test/storage/buffer/buffer_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ TEST_F(BufferManagerTest, cleanup_test) {
auto file_name = MakeShared<String>(fmt::format("file_{}", i));
auto file_worker = MakeUnique<DataFileWorker>(data_dir_, temp_dir_, MakeShared<String>(""), file_name, file_size, buffer_mgr.persistence_manager());
auto *buffer_obj = buffer_mgr.AllocateBufferObject(std::move(file_worker));
buffer_obj->AddObjRc();
buffer_objs.push_back(buffer_obj);
{
auto buffer_handle = buffer_obj->Load();
Expand Down Expand Up @@ -374,6 +375,7 @@ class Test1Obj : public TestObj {
file_info.file_size_ = file_size;
auto file_worker = MakeUnique<DataFileWorker>(data_dir_, temp_dir_, MakeShared<String>(""), file_name, file_size, nullptr);
file_info.buffer_obj_ = buffer_mgr_->AllocateBufferObject(std::move(file_worker));
file_info.buffer_obj_->AddObjRc();
} else {
auto file_worker = MakeUnique<DataFileWorker>(data_dir_, temp_dir_, MakeShared<String>(""), file_name, file_info.file_size_, nullptr);
file_info.buffer_obj_ = buffer_mgr_->GetBufferObject(std::move(file_worker));
Expand Down Expand Up @@ -449,6 +451,7 @@ class Test2Obj : public TestObj {
if (alloc_new) {
auto file_worker = MakeUnique<VarFileWorker>(data_dir_, temp_dir_, MakeShared<String>(""), file_name, 0, nullptr);
file_info.buffer_obj_ = buffer_mgr_->AllocateBufferObject(std::move(file_worker));
file_info.buffer_obj_->AddObjRc();
} else {
auto file_worker = MakeUnique<VarFileWorker>(data_dir_, temp_dir_, MakeShared<String>(""), file_name, file_info.file_size_, nullptr);
file_info.buffer_obj_ = buffer_mgr_->GetBufferObject(std::move(file_worker));
Expand Down

0 comments on commit e66a36c

Please sign in to comment.