diff --git a/src/replica/test/replica_disk_test.cpp b/src/replica/test/replica_disk_test.cpp index 9f2df58cbf7..ce74411990b 100644 --- a/src/replica/test/replica_disk_test.cpp +++ b/src/replica/test/replica_disk_test.cpp @@ -243,16 +243,16 @@ TEST_F(replica_disk_test, disk_status_test) {disk_status::SPACE_INSUFFICIENT, disk_status::NORMAL}}; auto dn = stub->get_fs_manager()->get_dir_nodes()[0]; for (const auto &test : tests) { - update_node_status(dn, test.old_status, test.new_status); + dn->status = test.new_status; for (const auto &pids_of_app : dn->holding_replicas) { for (const auto &pid : pids_of_app.second) { replica_ptr rep = stub->get_replica(pid); ASSERT_NE(nullptr, rep); - ASSERT_EQ(test.new_status, rep->disk_space_insufficient()); + ASSERT_EQ(test.new_status, rep->get_dir_node()->status); } } } - update_node_status(dn, disk_status::NORMAL, disk_status::NORMAL); + dn->status = disk_status::NORMAL; } TEST_F(replica_disk_test, add_new_disk_test) diff --git a/src/replica/test/replica_disk_test_base.h b/src/replica/test/replica_disk_test_base.h index 40b5d4be016..08e7ffc39ef 100644 --- a/src/replica/test/replica_disk_test_base.h +++ b/src/replica/test/replica_disk_test_base.h @@ -100,25 +100,6 @@ class replica_disk_test_base : public replica_test_base } } - void update_node_status(const std::shared_ptr &dn, - disk_status::type old_status, - disk_status::type new_status) - { - for (const auto &pids_of_app : dn->holding_replicas) { - for (const auto &pid : pids_of_app.second) { - replica_ptr rep = stub->get_replica(pid); - ASSERT_NE(nullptr, rep); - rep->set_disk_status(new_status); - } - } - if (old_status != new_status) { - dn->status = new_status; - } - } - - // if (dn->status == disk_status::NORMAL) { - // dir_size++; - // } void prepare_before_add_new_disk_test(const std::string &create_dir, const std::string &check_rw) {