diff --git a/src/block_service/test/block_service_manager_test.cpp b/src/block_service/test/block_service_manager_test.cpp index 73b2933fa6..de088f2d69 100644 --- a/src/block_service/test/block_service_manager_test.cpp +++ b/src/block_service/test/block_service_manager_test.cpp @@ -112,13 +112,17 @@ TEST_P(block_service_manager_test, local_file_exist) { int64_t size; std::string md5; - } tests[]{{2333, "bad_md5"}, {2333, _file_meta.md5}, {_file_meta.size, "bad_md5"}}; + } tests[]{ + {2333, "bad_md5"}, // wrong size and md5 + {2333, _file_meta.md5}, // wrong size + {_file_meta.size, "bad_md5"} // wrong md5 + }; for (const auto &test : tests) { // The remote file will be overwritten when repeatedly created. create_remote_file(FILE_NAME, test.size, test.md5); uint64_t download_size = 0; - ASSERT_EQ(test_download_file(download_size), ERR_PATH_ALREADY_EXIST); - ASSERT_EQ(download_size, 0); + ASSERT_EQ(ERR_PATH_ALREADY_EXIST, test_download_file(download_size)); + ASSERT_EQ(0, download_size); } } diff --git a/src/replica/bulk_load/test/replica_bulk_loader_test.cpp b/src/replica/bulk_load/test/replica_bulk_loader_test.cpp index 0c7bcc54a6..6354432c8b 100644 --- a/src/replica/bulk_load/test/replica_bulk_loader_test.cpp +++ b/src/replica/bulk_load/test/replica_bulk_loader_test.cpp @@ -261,9 +261,9 @@ class replica_bulk_loader_test : public replica_test_base /* should_sync */ true); ASSERT_TRUE(s.ok()) << s.ToString(); _file_meta.name = whole_name; - utils::filesystem::md5sum(whole_name, _file_meta.md5); - utils::filesystem::file_size( - whole_name, dsn::utils::FileDataType::kSensitive, _file_meta.size); + ASSERT_EQ(ERR_OK, utils::filesystem::md5sum(whole_name, _file_meta.md5)); + ASSERT_TRUE(utils::filesystem::file_size( + whole_name, dsn::utils::FileDataType::kSensitive, _file_meta.size)); } error_code create_local_metadata_file() diff --git a/src/replica/duplication/test/load_from_private_log_test.cpp b/src/replica/duplication/test/load_from_private_log_test.cpp index f3e12e798c..2782f55f11 100644 --- a/src/replica/duplication/test/load_from_private_log_test.cpp +++ b/src/replica/duplication/test/load_from_private_log_test.cpp @@ -72,7 +72,6 @@ #include "duplication_test_base.h" #include "replica/duplication/load_from_private_log.h" #include "replica/mutation_log_utils.h" -#include "test_util/test_util.h" namespace dsn { namespace replication { @@ -311,13 +310,6 @@ TEST_F(load_from_private_log_test, handle_real_private_log) std::vector log_files({"log.1.0.handle_real_private_log", "log.1.0.handle_real_private_log2", "log.1.0.all_loaded_are_write_empties"}); - if (FLAGS_encrypt_data_at_rest) { - for (int i = 0; i < log_files.size(); i++) { - auto s = dsn::utils::encrypt_file(log_files[i], log_files[i] + ".encrypted"); - ASSERT_TRUE(s.ok()) << s.ToString(); - log_files[i] += ".encrypted"; - } - } struct test_data {