From 0398696e5485fb68bc95e961fd9e6c84696636f8 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Fri, 14 Feb 2025 09:29:05 -0600 Subject: [PATCH] refactor test names --- repertory/repertory_test/src/atomic_test.cpp | 8 +++---- .../repertory_test/src/curl_comm_test.cpp | 8 +++---- .../src/json_serialize_test.cpp | 24 +++++++++---------- .../repertory_test/src/lock_data_test.cpp | 6 ++--- repertory/repertory_test/src/packet_test.cpp | 2 +- .../repertory_test/src/providers_test.cpp | 6 ++--- repertory/repertory_test/src/upload_test.cpp | 6 ++--- repertory/repertory_test/src/utils_test.cpp | 4 ++-- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/repertory/repertory_test/src/atomic_test.cpp b/repertory/repertory_test/src/atomic_test.cpp index 58df0484..c79aba3c 100644 --- a/repertory/repertory_test/src/atomic_test.cpp +++ b/repertory/repertory_test/src/atomic_test.cpp @@ -24,7 +24,7 @@ #include "types/repertory.hpp" namespace repertory { -TEST(atomic, atomic_primitive) { +TEST(atomic_test, atomic_primitive) { atomic value; value = 5U; EXPECT_EQ(5U, static_cast(value)); @@ -35,7 +35,7 @@ TEST(atomic, atomic_primitive) { EXPECT_EQ(6U, value.load()); } -TEST(atomic, atomic_primitive_equality) { +TEST(atomic_test, atomic_primitive_equality) { atomic value1{5U}; atomic value2{5U}; EXPECT_EQ(value1, value1); @@ -45,7 +45,7 @@ TEST(atomic, atomic_primitive_equality) { EXPECT_EQ(static_cast(value2), 5U); } -TEST(atomic, atomic_primitive_inequality) { +TEST(atomic_test, atomic_primitive_inequality) { atomic value1{5U}; atomic value2{6U}; EXPECT_NE(value1, value2); @@ -53,7 +53,7 @@ TEST(atomic, atomic_primitive_inequality) { EXPECT_NE(static_cast(value2), 5U); } -TEST(atomic, atomic_struct) { +TEST(atomic_test, atomic_struct) { atomic value{ encrypt_config{ .encryption_token = "token", diff --git a/repertory/repertory_test/src/curl_comm_test.cpp b/repertory/repertory_test/src/curl_comm_test.cpp index 30bb9be6..a2191635 100644 --- a/repertory/repertory_test/src/curl_comm_test.cpp +++ b/repertory/repertory_test/src/curl_comm_test.cpp @@ -25,7 +25,7 @@ #include "types/repertory.hpp" namespace repertory { -TEST(curl_comm, can_create_s3_host_config) { +TEST(curl_comm_test, can_create_s3_host_config) { s3_config config{}; config.bucket = "repertory"; config.url = "https://s3.test.com"; @@ -37,7 +37,7 @@ TEST(curl_comm, can_create_s3_host_config) { EXPECT_TRUE(hc.path.empty()); } -TEST(curl_comm, can_create_s3_host_config_with_path_style) { +TEST(curl_comm_test, can_create_s3_host_config_with_path_style) { s3_config config{}; config.bucket = "repertory"; config.url = "https://s3.test.com"; @@ -49,7 +49,7 @@ TEST(curl_comm, can_create_s3_host_config_with_path_style) { EXPECT_STREQ("/repertory", hc.path.c_str()); } -TEST(curl_comm, can_create_s3_host_config_with_region) { +TEST(curl_comm_test, can_create_s3_host_config_with_region) { s3_config config{}; config.bucket = "repertory"; config.url = "https://s3.test.com"; @@ -62,7 +62,7 @@ TEST(curl_comm, can_create_s3_host_config_with_region) { EXPECT_TRUE(hc.path.empty()); } -TEST(curl_comm, can_create_s3_host_config_with_region_and_path_style) { +TEST(curl_comm_test, can_create_s3_host_config_with_region_and_path_style) { s3_config config{}; config.bucket = "repertory"; config.url = "https://s3.test.com"; diff --git a/repertory/repertory_test/src/json_serialize_test.cpp b/repertory/repertory_test/src/json_serialize_test.cpp index e9e79105..433edbcd 100644 --- a/repertory/repertory_test/src/json_serialize_test.cpp +++ b/repertory/repertory_test/src/json_serialize_test.cpp @@ -25,7 +25,7 @@ #include "types/repertory.hpp" namespace repertory { -TEST(json_serialize, can_handle_directory_item) { +TEST(json_serialize_test, can_handle_directory_item) { directory_item cfg{ "api", "parent", true, 2U, {{META_DIRECTORY, "true"}}, }; @@ -47,7 +47,7 @@ TEST(json_serialize, can_handle_directory_item) { } } -TEST(json_serialize, can_handle_encrypt_config) { +TEST(json_serialize_test, can_handle_encrypt_config) { encrypt_config cfg{ "token", "path", @@ -65,7 +65,7 @@ TEST(json_serialize, can_handle_encrypt_config) { } } -TEST(json_serialize, can_handle_host_config) { +TEST(json_serialize_test, can_handle_host_config) { host_config cfg{ "agent", "pwd", "user", 1024U, "host", "path", "http", 11U, }; @@ -94,7 +94,7 @@ TEST(json_serialize, can_handle_host_config) { } } -TEST(json_serialize, can_handle_remote_config) { +TEST(json_serialize_test, can_handle_remote_config) { remote::remote_config cfg{ 1024U, "token", "host", 11U, 20U, 21U, }; @@ -120,7 +120,7 @@ TEST(json_serialize, can_handle_remote_config) { } } -TEST(json_serialize, can_handle_remote_mount) { +TEST(json_serialize_test, can_handle_remote_mount) { remote::remote_mount cfg{1024U, 21U, true, "token"}; json data(cfg); @@ -139,7 +139,7 @@ TEST(json_serialize, can_handle_remote_mount) { } } -TEST(json_serialize, can_handle_s3_config) { +TEST(json_serialize_test, can_handle_s3_config) { s3_config cfg{ "access", "bucket", "token", "region", "secret", 31U, "url", true, false, }; @@ -170,7 +170,7 @@ TEST(json_serialize, can_handle_s3_config) { } } -TEST(json_serialize, can_handle_sia_config) { +TEST(json_serialize_test, can_handle_sia_config) { sia_config cfg{ "bucket", }; @@ -184,7 +184,7 @@ TEST(json_serialize, can_handle_sia_config) { } } -TEST(json_serialize, can_handle_atomic) { +TEST(json_serialize_test, can_handle_atomic) { atomic cfg({ "bucket", }); @@ -198,7 +198,7 @@ TEST(json_serialize, can_handle_atomic) { } } -TEST(json_serialize, can_handle_database_type) { +TEST(json_serialize_test, can_handle_database_type) { json data(database_type::rocksdb); EXPECT_EQ(database_type::rocksdb, data.get()); EXPECT_STREQ("rocksdb", data.get().c_str()); @@ -208,7 +208,7 @@ TEST(json_serialize, can_handle_database_type) { EXPECT_STREQ("sqlite", data.get().c_str()); } -TEST(json_serialize, can_handle_download_type) { +TEST(json_serialize_test, can_handle_download_type) { json data(download_type::direct); EXPECT_EQ(download_type::direct, data.get()); EXPECT_STREQ("direct", data.get().c_str()); @@ -222,7 +222,7 @@ TEST(json_serialize, can_handle_download_type) { EXPECT_STREQ("ring_buffer", data.get().c_str()); } -TEST(json_serialize, can_handle_atomic_database_type) { +TEST(json_serialize_test, can_handle_atomic_database_type) { json data(atomic{database_type::rocksdb}); EXPECT_EQ(database_type::rocksdb, data.get>()); EXPECT_STREQ("rocksdb", data.get().c_str()); @@ -232,7 +232,7 @@ TEST(json_serialize, can_handle_atomic_database_type) { EXPECT_STREQ("sqlite", data.get().c_str()); } -TEST(json_serialize, can_handle_atomic_download_type) { +TEST(json_serialize_test, can_handle_atomic_download_type) { json data(atomic{download_type::direct}); EXPECT_EQ(download_type::direct, data.get>()); EXPECT_STREQ("direct", data.get().c_str()); diff --git a/repertory/repertory_test/src/lock_data_test.cpp b/repertory/repertory_test/src/lock_data_test.cpp index 87186ef0..fd1fa9e3 100644 --- a/repertory/repertory_test/src/lock_data_test.cpp +++ b/repertory/repertory_test/src/lock_data_test.cpp @@ -24,7 +24,7 @@ #include "platform/platform.hpp" namespace repertory { -TEST(lock_data, lock_and_unlock) { +TEST(lock_data_test, lock_and_unlock) { { lock_data l(provider_type::sia, "1"); EXPECT_EQ(lock_result::success, l.grab_lock()); @@ -50,7 +50,7 @@ TEST(lock_data, lock_and_unlock) { } #if defined(_WIN32) -TEST(lock_data, set_and_unset_mount_state) { +TEST(lock_data_test, set_and_unset_mount_state) { lock_data l(provider_type::sia, "1"); EXPECT_TRUE(l.set_mount_state(true, "C:", 99)); @@ -83,7 +83,7 @@ TEST(lock_data, set_and_unset_mount_state) { mount_state["Remote2"].dump().c_str()); } #else -TEST(lock_data, set_and_unset_mount_state) { +TEST(lock_data_test, set_and_unset_mount_state) { lock_data l(provider_type::sia, "1"); EXPECT_TRUE(l.set_mount_state(true, "/mnt/1", 99)); diff --git a/repertory/repertory_test/src/packet_test.cpp b/repertory/repertory_test/src/packet_test.cpp index 0a29dab2..73ef16a8 100644 --- a/repertory/repertory_test/src/packet_test.cpp +++ b/repertory/repertory_test/src/packet_test.cpp @@ -24,7 +24,7 @@ #include "comm/packet/packet.hpp" namespace repertory { -TEST(packet, encrypt_and_decrypt) { +TEST(packet_test, encrypt_and_decrypt) { packet test_packet; test_packet.encode("test"); test_packet.encrypt("moose"); diff --git a/repertory/repertory_test/src/providers_test.cpp b/repertory/repertory_test/src/providers_test.cpp index 0e1752d7..5a7e6dd5 100644 --- a/repertory/repertory_test/src/providers_test.cpp +++ b/repertory/repertory_test/src/providers_test.cpp @@ -629,7 +629,7 @@ static void run_tests(const app_config &cfg, i_provider &provider) { upload_file(provider); */ } -TEST(providers, encrypt_provider) { +TEST(providers_test, encrypt_provider) { const auto config_path = utils::path::combine(test::get_test_output_dir(), {"encrypt_provider"}); @@ -673,7 +673,7 @@ TEST(providers, encrypt_provider) { event_system::instance().stop(); } -TEST(providers, s3_provider) { +TEST(providers_test, s3_provider) { const auto config_path = utils::path::combine(test::get_test_output_dir(), {"s3_provider"}); @@ -713,7 +713,7 @@ TEST(providers, s3_provider) { event_system::instance().stop(); } -TEST(providers, sia_provider) { +TEST(providers_test, sia_provider) { const auto config_path = utils::path::combine(test::get_test_output_dir(), {"sia_provider"}); diff --git a/repertory/repertory_test/src/upload_test.cpp b/repertory/repertory_test/src/upload_test.cpp index 8b21fd8e..1f45d10b 100644 --- a/repertory/repertory_test/src/upload_test.cpp +++ b/repertory/repertory_test/src/upload_test.cpp @@ -29,7 +29,7 @@ namespace repertory { static constexpr const std::size_t test_chunk_size{1024U}; -TEST(upload, can_upload_a_valid_file) { +TEST(upload_test, can_upload_a_valid_file) { console_consumer con; event_system::instance().start(); @@ -71,7 +71,7 @@ TEST(upload, can_upload_a_valid_file) { event_system::instance().stop(); } -TEST(upload, can_cancel_upload) { +TEST(upload_test, can_cancel_upload) { console_consumer con; event_system::instance().start(); @@ -135,7 +135,7 @@ TEST(upload, can_cancel_upload) { event_system::instance().stop(); } -TEST(upload, can_stop_upload) { +TEST(upload_test, can_stop_upload) { console_consumer con; event_system::instance().start(); diff --git a/repertory/repertory_test/src/utils_test.cpp b/repertory/repertory_test/src/utils_test.cpp index aeb9b9dc..f95c3629 100644 --- a/repertory/repertory_test/src/utils_test.cpp +++ b/repertory/repertory_test/src/utils_test.cpp @@ -25,7 +25,7 @@ #include "utils/file.hpp" namespace repertory { -TEST(utils, convert_api_date) { +TEST(utils_test, convert_api_date) { #if defined(_WIN32) auto file_time = utils::time::unix_time_to_filetime( s3_provider::convert_api_date("2009-10-12T17:50:30.111Z")); @@ -63,7 +63,7 @@ TEST(utils, convert_api_date) { #endif // defined(_WIN32) } -TEST(utils, generate_sha256) { +TEST(utils_test, generate_sha256) { auto res = utils::file::file{__FILE__}.sha256(); EXPECT_TRUE(res.has_value()); if (res.has_value()) {