diff --git a/audit/test/audit_test.cpp b/audit/test/audit_test.cpp index 7cffe73d..e89c7917 100644 --- a/audit/test/audit_test.cpp +++ b/audit/test/audit_test.cpp @@ -24,11 +24,11 @@ using namespace ::testing; class audit_test : public Test { public: - std::shared_ptr mock_io_context = std::make_shared>(); - std::shared_ptr mock_node = std::make_shared>(); + std::shared_ptr mock_io_context = std::make_shared>(); + std::shared_ptr mock_node = std::make_shared>(); - std::unique_ptr primary_alive_timer = - std::make_unique>(); + std::unique_ptr primary_alive_timer = + std::make_unique>(); bzn::asio::wait_handler primary_alive_timer_callback; diff --git a/chaos/test/chaos_test.cpp b/chaos/test/chaos_test.cpp index aec4d4a4..a2fdaa02 100644 --- a/chaos/test/chaos_test.cpp +++ b/chaos/test/chaos_test.cpp @@ -23,12 +23,12 @@ class chaos_test : public Test { public: std::shared_ptr options; - std::shared_ptr mock_io_context = std::make_shared>(); + std::shared_ptr mock_io_context = std::make_shared>(); - std::unique_ptr node_crash_timer = - std::make_unique>(); - std::unique_ptr second_timer = - std::make_unique>(); + std::unique_ptr node_crash_timer = + std::make_unique>(); + std::unique_ptr second_timer = + std::make_unique>(); bzn::asio::wait_handler node_crash_handler; bzn::asio::wait_handler second_timer_handler; diff --git a/crud/test/crud_test.cpp b/crud/test/crud_test.cpp index d45924ba..558381e9 100644 --- a/crud/test/crud_test.cpp +++ b/crud/test/crud_test.cpp @@ -42,7 +42,7 @@ namespace return intermediate.ParseFromString(source) && target.ParseFromString(intermediate.database_response()); } - void expect_signed_response(const std::shared_ptr& session, + void expect_signed_response(const std::shared_ptr& session, std::optional db_uuid = std::nullopt, std::optional nonce = std::nullopt, std::optional response_case = std::nullopt, @@ -80,7 +80,7 @@ namespace })); } - void expect_response(const std::shared_ptr& session, + void expect_response(const std::shared_ptr& session, std::optional db_uuid = std::nullopt, std::optional nonce = std::nullopt, std::optional response_case = std::nullopt, @@ -123,24 +123,24 @@ namespace std::shared_ptr initialize_crud( - std::shared_ptr& session - , std::shared_ptr& mock_node + std::shared_ptr& session + , std::shared_ptr& mock_node , bzn::uuid_t caller_id) { - mock_node = std::make_shared(); - auto mock_subscription_manager = std::make_shared>(); - auto mock_io_context = std::make_shared>(); - session = std::make_shared(); + mock_node = std::make_shared(); + auto mock_subscription_manager = std::make_shared>(); + auto mock_io_context = std::make_shared>(); + session = std::make_shared(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, mock_node, caller_id); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -205,8 +205,8 @@ namespace void create_test_database( const std::shared_ptr& crud - , const std::shared_ptr& session - , const std::shared_ptr& mock_node + , const std::shared_ptr& session + , const std::shared_ptr& mock_node , const bzn::uuid_t& caller_uuid , const bzn::uuid_t& db_uuid , uint64_t max_size = 0 @@ -224,8 +224,8 @@ namespace void remove_test_database( const std::shared_ptr& crud - , const std::shared_ptr& session - , const std::shared_ptr& mock_node + , const std::shared_ptr& session + , const std::shared_ptr& mock_node , const bzn::uuid_t& caller_uuid , const bzn::uuid_t& db_uuid) { @@ -242,8 +242,8 @@ namespace void create_key_value( const std::shared_ptr& crud - , const std::shared_ptr& session - , const std::shared_ptr& mock_node + , const std::shared_ptr& session + , const std::shared_ptr& mock_node , const bzn::uuid_t& caller , const std::string& request_hash , const bzn::uuid_t& db @@ -262,8 +262,8 @@ namespace void update_key_value( const std::shared_ptr& crud - , const std::shared_ptr& session - , const std::shared_ptr& mock_node + , const std::shared_ptr& session + , const std::shared_ptr& mock_node , const bzn::uuid_t& caller , const std::string& request_hash , const bzn::uuid_t& db @@ -282,8 +282,8 @@ namespace std::pair get_database_size( const std::shared_ptr& crud - , const std::shared_ptr& session - , const std::shared_ptr& mock_node + , const std::shared_ptr& session + , const std::shared_ptr& mock_node , const bzn::uuid_t& caller, const bzn::uuid_t& db) { std::promise> db_size_promise; @@ -311,8 +311,8 @@ namespace std::set get_database_keys( const std::shared_ptr& crud - , const std::shared_ptr& session - , const std::shared_ptr& mock_node + , const std::shared_ptr& session + , const std::shared_ptr& mock_node , const bzn::uuid_t& caller_id , const bzn::uuid_t& db_uuid) { @@ -337,8 +337,8 @@ namespace std::string do_quickread(const std::shared_ptr& crud - , const std::shared_ptr& session - , const std::shared_ptr& mock_node + , const std::shared_ptr& session + , const std::shared_ptr& mock_node , const bzn::uuid_t& caller_id , const bzn::uuid_t& db_uuid , const bzn::key_t& key) @@ -376,8 +376,8 @@ namespace size_t fill_database( const std::shared_ptr& crud - , const std::shared_ptr& session - , const std::shared_ptr& mock_node + , const std::shared_ptr& session + , const std::shared_ptr& mock_node , const bzn::uuid_t& caller_id , const std::string request_hash , const bzn::uuid_t& db_uuid @@ -399,19 +399,19 @@ namespace TEST(crud, test_that_create_sends_proper_response) { - auto mock_subscription_manager = std::make_shared>(); - auto mock_io_context = std::make_shared>(); + auto mock_subscription_manager = std::make_shared>(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -425,7 +425,7 @@ TEST(crud, test_that_create_sends_proper_response) msg.mutable_create()->set_value("value"); // add key... - auto session = std::make_shared(); + auto session = std::make_shared(); expect_signed_response(session, "uuid", 123, std::nullopt, bzn::storage_result_msg.at(bzn::storage_result::db_not_found)); @@ -504,20 +504,20 @@ TEST(crud, test_that_create_sends_proper_response) TEST(crud, test_that_point_of_contact_create_sends_proper_response) { - auto mock_node = std::make_shared(); - auto mock_subscription_manager = std::make_shared>(); - auto mock_io_context = std::make_shared>(); + auto mock_node = std::make_shared(); + auto mock_subscription_manager = std::make_shared>(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, mock_node); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -644,19 +644,19 @@ TEST(crud, test_that_point_of_contact_create_sends_proper_response) TEST(crud, test_that_read_sends_proper_response) { - auto mock_subscription_manager = std::make_shared>(); - auto mock_io_context = std::make_shared>(); + auto mock_subscription_manager = std::make_shared>(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -676,7 +676,7 @@ TEST(crud, test_that_read_sends_proper_response) msg.mutable_create()->set_expire(2); // add key... - auto session = std::make_shared(); + auto session = std::make_shared(); EXPECT_CALL(*mock_subscription_manager, inspect_commit(_)); @@ -762,20 +762,20 @@ TEST(crud, test_that_read_sends_proper_response) TEST(crud, test_that_point_of_contact_read_sends_proper_response) { - auto mock_subscription_manager = std::make_shared>(); - auto mock_node = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_subscription_manager = std::make_shared>(); + auto mock_node = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, mock_node); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -879,19 +879,19 @@ TEST(crud, test_that_point_of_contact_read_sends_proper_response) TEST(crud, test_that_update_sends_proper_response) { - auto mock_subscription_manager = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_subscription_manager = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -912,7 +912,7 @@ TEST(crud, test_that_update_sends_proper_response) msg.mutable_create()->set_value("value"); // add key... - auto session = std::make_shared(); + auto session = std::make_shared(); EXPECT_CALL(*mock_subscription_manager, inspect_commit(_)); @@ -963,20 +963,20 @@ TEST(crud, test_that_update_sends_proper_response) TEST(crud, test_that_point_of_contact_update_sends_proper_response) { - auto mock_subscription_manager = std::make_shared(); - auto mock_node = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_subscription_manager = std::make_shared(); + auto mock_node = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, mock_node); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1052,19 +1052,19 @@ TEST(crud, test_that_point_of_contact_update_sends_proper_response) TEST(crud, test_that_delete_sends_proper_response) { - auto mock_subscription_manager = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_subscription_manager = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1085,7 +1085,7 @@ TEST(crud, test_that_delete_sends_proper_response) msg.mutable_create()->set_value("value"); // add key... - auto session = std::make_shared(); + auto session = std::make_shared(); EXPECT_CALL(*mock_subscription_manager, inspect_commit(_)); @@ -1113,20 +1113,20 @@ TEST(crud, test_that_delete_sends_proper_response) TEST(crud, test_that_point_of_contact_delete_sends_proper_response) { - auto mock_node = std::make_shared(); - auto mock_subscription_manager = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_node = std::make_shared(); + auto mock_subscription_manager = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, mock_node); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1193,19 +1193,19 @@ TEST(crud, test_that_point_of_contact_delete_sends_proper_response) TEST(crud, test_that_has_sends_proper_response) { - auto mock_node = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_node = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), nullptr); + std::make_shared>(), nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1224,7 +1224,7 @@ TEST(crud, test_that_has_sends_proper_response) msg.mutable_create()->set_value("value"); // add key... - auto session = std::make_shared(); + auto session = std::make_shared(); expect_signed_response(session); crud->handle_request("caller_id", msg, session); @@ -1274,19 +1274,19 @@ TEST(crud, test_that_has_sends_proper_response) TEST(crud, test_that_point_of_contact_has_sends_proper_response) { - auto mock_node = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_node = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), mock_node); + std::make_shared>(), mock_node); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1355,18 +1355,18 @@ TEST(crud, test_that_point_of_contact_has_sends_proper_response) TEST(crud, test_that_keys_sends_proper_response) { - auto mock_io_context = std::make_shared>(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), nullptr); + std::make_shared>(), nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1385,7 +1385,7 @@ TEST(crud, test_that_keys_sends_proper_response) msg.mutable_create()->set_value("value"); // add key... - auto session = std::make_shared(); + auto session = std::make_shared(); EXPECT_CALL(*session, send_signed_message(_)).Times(2); crud->handle_request("caller_id", msg, session); @@ -1431,19 +1431,19 @@ TEST(crud, test_that_keys_sends_proper_response) TEST(crud, test_that_point_of_contact_keys_sends_proper_response) { - auto mock_node = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_node = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), mock_node); + std::make_shared>(), mock_node); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1522,18 +1522,18 @@ TEST(crud, test_that_point_of_contact_keys_sends_proper_response) TEST(crud, test_that_size_sends_proper_response) { - auto mock_io_context = std::make_shared>(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), nullptr); + std::make_shared>(), nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1553,7 +1553,7 @@ TEST(crud, test_that_size_sends_proper_response) msg.mutable_create()->set_value("value"); // add key... - auto session = std::make_shared(); + auto session = std::make_shared(); expect_signed_response(session); crud->handle_request("caller_id", msg, session); @@ -1587,19 +1587,19 @@ TEST(crud, test_that_size_sends_proper_response) TEST(crud, test_that_point_of_contact_size_sends_proper_response) { - auto mock_node = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_node = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), mock_node); + std::make_shared>(), mock_node); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1667,20 +1667,20 @@ TEST(crud, test_that_point_of_contact_size_sends_proper_response) TEST(crud, test_that_subscribe_request_calls_subscription_manager) { - auto mock_subscription_manager = std::make_shared(); + auto mock_subscription_manager = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr); EXPECT_CALL(*mock_subscription_manager, start()); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1697,7 +1697,7 @@ TEST(crud, test_that_subscribe_request_calls_subscription_manager) crud->handle_request("caller_id", msg, nullptr); // try again with a valid session... - auto mock_session = std::make_shared(); + auto mock_session = std::make_shared(); EXPECT_CALL(*mock_subscription_manager, subscribe(msg.header().db_uuid(), msg.subscribe().key(), msg.header().nonce(), _, _)); @@ -1710,20 +1710,20 @@ TEST(crud, test_that_subscribe_request_calls_subscription_manager) TEST(crud, test_that_unsubscribe_request_calls_subscription_manager) { - auto mock_subscription_manager = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_subscription_manager = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr); EXPECT_CALL(*mock_subscription_manager, start()); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1740,7 +1740,7 @@ TEST(crud, test_that_unsubscribe_request_calls_subscription_manager) // nothing should happen... crud->handle_request("caller_id", msg, nullptr); - auto mock_session = std::make_shared(); + auto mock_session = std::make_shared(); EXPECT_CALL(*mock_subscription_manager, unsubscribe(msg.header().db_uuid(), msg.unsubscribe().key(), msg.unsubscribe().nonce(), _, _)); @@ -1753,18 +1753,18 @@ TEST(crud, test_that_unsubscribe_request_calls_subscription_manager) TEST(crud, test_that_create_db_request_sends_proper_response) { - auto mock_io_context = std::make_shared>(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), nullptr); + std::make_shared>(), nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1776,7 +1776,7 @@ TEST(crud, test_that_create_db_request_sends_proper_response) msg.mutable_header()->set_nonce(uint64_t(123)); msg.mutable_create_db(); - auto mock_session = std::make_shared(); + auto mock_session = std::make_shared(); expect_signed_response(mock_session, "uuid", std::nullopt, database_response::RESPONSE_NOT_SET); @@ -1791,19 +1791,19 @@ TEST(crud, test_that_create_db_request_sends_proper_response) TEST(crud, test_that_point_of_contact_create_db_request_sends_proper_response) { - auto mock_node = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_node = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), mock_node); + std::make_shared>(), mock_node); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1847,18 +1847,18 @@ TEST(crud, test_that_point_of_contact_create_db_request_sends_proper_response) TEST(crud, test_that_has_db_request_sends_proper_response) { - auto mock_io_context = std::make_shared>(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), nullptr); + std::make_shared>(), nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1874,7 +1874,7 @@ TEST(crud, test_that_has_db_request_sends_proper_response) // nothing should happen... crud->handle_request("caller_id", msg, nullptr); - auto mock_session = std::make_shared(); + auto mock_session = std::make_shared(); // request has db.. msg.mutable_has_db(); @@ -1903,19 +1903,19 @@ TEST(crud, test_that_has_db_request_sends_proper_response) TEST(crud, test_that_point_of_contact_has_db_request_sends_proper_response) { - auto mock_node = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_node = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), mock_node); + std::make_shared>(), mock_node); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -1969,18 +1969,18 @@ TEST(crud, test_that_point_of_contact_has_db_request_sends_proper_response) TEST(crud, test_that_delete_db_sends_proper_response) { auto storage = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), nullptr); + std::make_shared>(), nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillOnce(Return(std::make_shared>())); @@ -1992,7 +1992,7 @@ TEST(crud, test_that_delete_db_sends_proper_response) msg.mutable_header()->set_nonce(uint64_t(123)); msg.mutable_delete_db(); - auto mock_session = std::make_shared(); + auto mock_session = std::make_shared(); expect_signed_response(mock_session, "uuid", std::nullopt, std::nullopt, bzn::storage_result_msg.at(bzn::storage_result::db_not_found)); @@ -2035,19 +2035,19 @@ TEST(crud, test_that_delete_db_sends_proper_response) TEST(crud, test_that_point_of_contact_delete_db_sends_proper_response) { - auto mock_node = std::make_shared(); - auto mock_io_context = std::make_shared>(); + auto mock_node = std::make_shared(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), mock_node); + std::make_shared>(), mock_node); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -2112,8 +2112,8 @@ TEST(crud, test_that_point_of_contact_delete_db_sends_proper_response) TEST(crud, test_that_state_can_be_saved_and_retrieved) { - bzn::crud crud(std::make_shared>(), std::make_shared(), - std::make_shared>(), nullptr); + bzn::crud crud(std::make_shared>(), std::make_shared(), + std::make_shared>(), nullptr); ASSERT_TRUE(crud.save_state()); @@ -2127,8 +2127,8 @@ TEST(crud, test_that_state_can_be_saved_and_retrieved) TEST(crud, test_that_writers_sends_proper_response) { - bzn::crud crud(std::make_shared>(), std::make_shared(), - std::make_shared>(), nullptr); + bzn::crud crud(std::make_shared>(), std::make_shared(), + std::make_shared>(), nullptr); // create database... database_msg msg; @@ -2136,7 +2136,7 @@ TEST(crud, test_that_writers_sends_proper_response) msg.mutable_header()->set_nonce(uint64_t(123)); msg.mutable_create_db(); - auto mock_session = std::make_shared(); + auto mock_session = std::make_shared(); expect_signed_response(mock_session); @@ -2159,10 +2159,10 @@ TEST(crud, test_that_writers_sends_proper_response) TEST(crud, test_that_point_of_contact_writers_sends_proper_response) { - auto mock_node = std::make_shared(); + auto mock_node = std::make_shared(); - bzn::crud crud(std::make_shared>(), std::make_shared(), - std::make_shared>(), mock_node); + bzn::crud crud(std::make_shared>(), std::make_shared(), + std::make_shared>(), mock_node); // create database... database_msg msg; @@ -2197,8 +2197,8 @@ TEST(crud, test_that_point_of_contact_writers_sends_proper_response) TEST(crud, test_that_add_writers_sends_proper_response) { - bzn::crud crud(std::make_shared>(), std::make_shared(), - std::make_shared>(), nullptr); + bzn::crud crud(std::make_shared>(), std::make_shared(), + std::make_shared>(), nullptr); // create database... database_msg msg; @@ -2206,7 +2206,7 @@ TEST(crud, test_that_add_writers_sends_proper_response) msg.mutable_header()->set_nonce(uint64_t(123)); msg.mutable_create_db(); - auto mock_session = std::make_shared(); + auto mock_session = std::make_shared(); expect_signed_response(mock_session); @@ -2247,10 +2247,10 @@ TEST(crud, test_that_add_writers_sends_proper_response) TEST(crud, test_that_point_of_contact_add_writers_sends_proper_response) { - auto mock_node = std::make_shared(); + auto mock_node = std::make_shared(); - bzn::crud crud(std::make_shared>(), std::make_shared(), - std::make_shared>(), mock_node); + bzn::crud crud(std::make_shared>(), std::make_shared(), + std::make_shared>(), mock_node); // create database... database_msg msg; @@ -2320,8 +2320,8 @@ TEST(crud, test_that_point_of_contact_add_writers_sends_proper_response) TEST(crud, test_that_remove_writers_sends_proper_response) { - bzn::crud crud(std::make_shared>(), std::make_shared(), - std::make_shared>(), nullptr); + bzn::crud crud(std::make_shared>(), std::make_shared(), + std::make_shared>(), nullptr); // create database... database_msg msg; @@ -2329,7 +2329,7 @@ TEST(crud, test_that_remove_writers_sends_proper_response) msg.mutable_header()->set_nonce(uint64_t(123)); msg.mutable_create_db(); - auto mock_session = std::make_shared(); + auto mock_session = std::make_shared(); expect_signed_response(mock_session); @@ -2360,10 +2360,10 @@ TEST(crud, test_that_remove_writers_sends_proper_response) TEST(crud, test_that_point_of_contact_remove_writers_sends_proper_response) { - auto mock_node = std::make_shared(); + auto mock_node = std::make_shared(); - bzn::crud crud(std::make_shared>(), std::make_shared(), - std::make_shared>(), mock_node); + bzn::crud crud(std::make_shared>(), std::make_shared(), + std::make_shared>(), mock_node); // create database... database_msg msg; @@ -2417,9 +2417,9 @@ TEST(crud, test_that_point_of_contact_remove_writers_sends_proper_response) TEST(crud, test_that_key_with_expire_set_is_deleted_by_timer_callback) { - auto mock_subscription_manager = std::make_shared(); - auto mock_io_context = std::make_shared>(); - auto mock_steady_timer = std::make_unique(); + auto mock_subscription_manager = std::make_shared(); + auto mock_io_context = std::make_shared>(); + auto mock_steady_timer = std::make_unique(); EXPECT_CALL(*mock_steady_timer, expires_from_now(_)).Times(2); @@ -2440,7 +2440,7 @@ TEST(crud, test_that_key_with_expire_set_is_deleted_by_timer_callback) EXPECT_CALL(*mock_subscription_manager, start()); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -2454,7 +2454,7 @@ TEST(crud, test_that_key_with_expire_set_is_deleted_by_timer_callback) msg.mutable_header()->set_db_uuid("uuid"); msg.mutable_header()->set_nonce(uint64_t(123)); - auto session = std::make_shared(); + auto session = std::make_shared(); msg.mutable_create_db(); expect_signed_response(session, "uuid", 123, database_response::RESPONSE_NOT_SET); @@ -2488,8 +2488,8 @@ TEST(crud, test_that_key_with_expire_set_is_deleted_by_timer_callback) TEST(crud, test_that_key_with_expiration_can_be_made_persistent) { - auto mock_io_context = std::make_shared>(); - auto mock_steady_timer = std::make_unique(); + auto mock_io_context = std::make_shared>(); + auto mock_steady_timer = std::make_unique(); EXPECT_CALL(*mock_steady_timer, expires_from_now(_)); EXPECT_CALL(*mock_steady_timer, async_wait(_)); @@ -2501,9 +2501,9 @@ TEST(crud, test_that_key_with_expiration_can_be_made_persistent) })); auto crud = std::make_shared(mock_io_context, std::make_shared(), - std::make_shared>(), nullptr); + std::make_shared>(), nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -2514,7 +2514,7 @@ TEST(crud, test_that_key_with_expiration_can_be_made_persistent) msg.mutable_header()->set_db_uuid("uuid"); msg.mutable_header()->set_nonce(uint64_t(123)); - auto session = std::make_shared(); + auto session = std::make_shared(); msg.mutable_create_db(); expect_signed_response(session, "uuid", 123, database_response::RESPONSE_NOT_SET); @@ -2548,20 +2548,20 @@ TEST(crud, test_that_key_with_expiration_can_be_made_persistent) TEST(crud, test_that_create_db_uses_bluzelle_key_to_validate) { - auto mock_subscription_manager = std::make_shared>(); - auto mock_io_context = std::make_shared>(); - auto session = std::make_shared(); + auto mock_subscription_manager = std::make_shared>(); + auto mock_io_context = std::make_shared>(); + auto session = std::make_shared(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr, "caller_id"); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -2584,19 +2584,19 @@ TEST(crud, test_that_create_db_uses_bluzelle_key_to_validate) TEST(crud, test_that_create_db_with_incorrect_bluzelle_key_fails_to_validate) { - auto mock_subscription_manager = std::make_shared>(); - auto mock_io_context = std::make_shared>(); - auto session = std::make_shared(); + auto mock_subscription_manager = std::make_shared>(); + auto mock_io_context = std::make_shared>(); + auto session = std::make_shared(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr, "caller_id"); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -2619,19 +2619,19 @@ TEST(crud, test_that_create_db_with_incorrect_bluzelle_key_fails_to_validate) TEST(crud, test_that_delete_db_uses_bluzelle_key_to_validate) { - auto mock_subscription_manager = std::make_shared>(); - auto mock_io_context = std::make_shared>(); - auto session = std::make_shared(); + auto mock_subscription_manager = std::make_shared>(); + auto mock_io_context = std::make_shared>(); + auto session = std::make_shared(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr, "caller_id"); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -2675,19 +2675,19 @@ TEST(crud, test_that_delete_db_uses_bluzelle_key_to_validate) TEST(crud, test_that_delete_db_with_incorrect_bluzelle_key_fails_to_validate) { - auto mock_subscription_manager = std::make_shared>(); - auto mock_io_context = std::make_shared>(); - auto session = std::make_shared(); + auto mock_subscription_manager = std::make_shared>(); + auto mock_io_context = std::make_shared>(); + auto session = std::make_shared(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr, "caller_id"); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -2747,17 +2747,17 @@ TEST(crud, test_assumption_that_boost_random_mt19937_produces_the_same_values_fo TEST(crud, test_that_create_and_updates_which_exceed_db_limit_send_proper_responses) { - auto mock_subscription_manager = std::make_shared>(); - auto mock_io_context = std::make_shared>(); - auto session = std::make_shared(); + auto mock_subscription_manager = std::make_shared>(); + auto mock_io_context = std::make_shared>(); + auto session = std::make_shared(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -2817,8 +2817,8 @@ TEST(crud, test_random_eviction_policy_randomly_removes_a_key_value_pair_for_cre const uint64_t NONCE{123}; const std::string REQUEST_HASH{generate_random_hash()}; - std::shared_ptr session; - std::shared_ptr mock_node; + std::shared_ptr session; + std::shared_ptr mock_node; auto crud{initialize_crud(session, mock_node, CALLER_UUID)}; remove_test_database(crud, session, mock_node, CALLER_UUID, DB_UUID); @@ -2872,8 +2872,8 @@ TEST(crud, test_random_eviction_policy_with_large_value_requiring_many_evictions const bzn::value_t LARGE_TEST_VALUE{make_value(3 * VALUE_SIZE)}; const std::string REQUEST_HASH{generate_random_hash()}; - std::shared_ptr session; - std::shared_ptr mock_node; + std::shared_ptr session; + std::shared_ptr mock_node; auto crud{initialize_crud(session, mock_node, CALLER_UUID)}; remove_test_database(crud, session, mock_node, CALLER_UUID, DB_UUID); @@ -2913,8 +2913,8 @@ TEST(crud, test_random_eviction_policy_edge_case_of_create_with_value_larger_tha const uint64_t NONCE{123}; const std::string REQUEST_HASH{generate_random_hash()}; - std::shared_ptr session; - std::shared_ptr mock_node; + std::shared_ptr session; + std::shared_ptr mock_node; auto crud{initialize_crud(session, mock_node, CALLER_UUID)}; @@ -2941,8 +2941,8 @@ TEST(crud, test_random_eviction_policy_randomly_removes_a_single_key_value_pair_ const size_t VALUE_SIZE{45}; const std::string REQUEST_HASH{generate_random_hash()}; - std::shared_ptr session; - std::shared_ptr mock_node; + std::shared_ptr session; + std::shared_ptr mock_node; auto crud{initialize_crud(session, mock_node, CALLER_UUID)}; @@ -2991,8 +2991,8 @@ TEST(crud, test_random_eviction_policy_randomly_removes_many_key_value_pairs_for const size_t LARGE_VALUE_SIZE{5 * VALUE_SIZE}; const std::string REQUEST_HASH{generate_random_hash()}; - std::shared_ptr session; - std::shared_ptr mock_node; + std::shared_ptr session; + std::shared_ptr mock_node; auto crud{initialize_crud(session, mock_node, CALLER_UUID)}; @@ -3039,8 +3039,8 @@ TEST(crud, test_random_eviction_policy_edge_case_of_update_with_value_larger_tha const bzn::uuid_t DB_UUID{"sut_uuid"}; const bzn::uuid_t CALLER_UUID{"caller_id"}; - std::shared_ptr session; - std::shared_ptr mock_node; + std::shared_ptr session; + std::shared_ptr mock_node; auto crud{initialize_crud(session, mock_node, CALLER_UUID)}; @@ -3063,12 +3063,12 @@ TEST(crud, test_that_two_cruds_evict_the_same_key_value_pairs) const size_t VALUE_SIZE{27}; const std::string REQUEST_HASH{generate_random_hash()}; - std::shared_ptr session_0; - std::shared_ptr mock_node_0; + std::shared_ptr session_0; + std::shared_ptr mock_node_0; auto crud_0{initialize_crud(session_0, mock_node_0, CALLER_UUID)}; - std::shared_ptr session_1; - std::shared_ptr mock_node_1; + std::shared_ptr session_1; + std::shared_ptr mock_node_1; auto crud_1{initialize_crud(session_1, mock_node_1, CALLER_UUID)}; remove_test_database(crud_0, session_0, mock_node_0, CALLER_UUID, DB_UUID); @@ -3153,19 +3153,19 @@ TEST(crud, test_that_two_cruds_evict_the_same_key_value_pairs) TEST(crud, test_that_expire_send_proper_response) { - auto mock_subscription_manager = std::make_shared>(); - auto mock_io_context = std::make_shared>(); + auto mock_subscription_manager = std::make_shared>(); + auto mock_io_context = std::make_shared>(); EXPECT_CALL(*mock_io_context, make_unique_steady_timer()).WillOnce(Invoke( [&]() { - return std::make_unique>(); + return std::make_unique>(); })); auto crud = std::make_shared(mock_io_context, std::make_shared(), mock_subscription_manager, nullptr); - auto mock_pbft = std::make_shared(); + auto mock_pbft = std::make_shared(); EXPECT_CALL(*mock_pbft, current_peers_ptr()).WillRepeatedly(Return(std::make_shared>())); @@ -3183,7 +3183,7 @@ TEST(crud, test_that_expire_send_proper_response) msg.mutable_create()->set_value("value"); // add key... - auto session = std::make_shared(); + auto session = std::make_shared(); EXPECT_CALL(*mock_subscription_manager, inspect_commit(_)); diff --git a/crud/test/subscription_manager_test.cpp b/crud/test/subscription_manager_test.cpp index 28a24880..574b7b8b 100644 --- a/crud/test/subscription_manager_test.cpp +++ b/crud/test/subscription_manager_test.cpp @@ -30,15 +30,15 @@ namespace TEST(subscription_manager, test_that_session_can_subscribe_and_unsubscribe_for_updates) { - auto mock_session1 = std::make_shared(); - auto mock_session2 = std::make_shared(); - auto mock_session3 = std::make_shared(); + auto mock_session1 = std::make_shared(); + auto mock_session2 = std::make_shared(); + auto mock_session3 = std::make_shared(); EXPECT_CALL(*mock_session1, get_session_id()).WillRepeatedly(Return(bzn::session_id(1))); EXPECT_CALL(*mock_session2, get_session_id()).WillRepeatedly(Return(bzn::session_id(2))); EXPECT_CALL(*mock_session3, get_session_id()).WillRepeatedly(Return(bzn::session_id(3))); - bzn::subscription_manager sm(std::make_shared>()); + bzn::subscription_manager sm(std::make_shared>()); // two subscribers... { @@ -138,13 +138,13 @@ TEST(subscription_manager, test_that_session_can_subscribe_and_unsubscribe_for_u TEST(subscription_manager, test_that_session_cannot_unsubscribe_other_sessions) { - auto mock_session1 = std::make_shared(); - auto mock_session2 = std::make_shared(); + auto mock_session1 = std::make_shared(); + auto mock_session2 = std::make_shared(); EXPECT_CALL(*mock_session1, get_session_id()).WillRepeatedly(Return(bzn::session_id(1))); EXPECT_CALL(*mock_session2, get_session_id()).WillRepeatedly(Return(bzn::session_id(2))); - bzn::subscription_manager sm(std::make_shared>()); + bzn::subscription_manager sm(std::make_shared>()); // two subscribers... { @@ -165,13 +165,13 @@ TEST(subscription_manager, test_that_session_cannot_unsubscribe_other_sessions) TEST(subscription_manager, test_that_subscriber_is_notified_for_create_and_updates) { - auto mock_session1 = std::make_shared(); - auto mock_session2 = std::make_shared(); + auto mock_session1 = std::make_shared(); + auto mock_session2 = std::make_shared(); EXPECT_CALL(*mock_session1, get_session_id()).WillRepeatedly(Return(bzn::session_id(1))); EXPECT_CALL(*mock_session2, get_session_id()).WillRepeatedly(Return(bzn::session_id(2))); - bzn::subscription_manager sm(std::make_shared>()); + bzn::subscription_manager sm(std::make_shared>()); database_response response; sm.subscribe(TEST_UUID, "0", 0, response, mock_session1); @@ -303,8 +303,8 @@ TEST(subscription_manager, test_that_subscriber_is_notified_for_create_and_updat TEST(subscription_manager, test_that_dead_session_is_removed_from_subscriber_list) { - auto mock_io_context = std::make_shared(); - auto mock_steady_timer = std::make_unique(); + auto mock_io_context = std::make_shared(); + auto mock_steady_timer = std::make_unique(); EXPECT_CALL(*mock_steady_timer, expires_from_now(_)).Times(2); @@ -325,8 +325,8 @@ TEST(subscription_manager, test_that_dead_session_is_removed_from_subscriber_lis sm->start(); - auto mock_session1 = std::make_shared(); - auto mock_session2 = std::make_shared(); + auto mock_session1 = std::make_shared(); + auto mock_session2 = std::make_shared(); EXPECT_CALL(*mock_session1, get_session_id()).WillRepeatedly(Return(bzn::session_id(1))); EXPECT_CALL(*mock_session2, get_session_id()).WillRepeatedly(Return(bzn::session_id(2))); diff --git a/mocks/mock_boost_asio_beast.hpp b/mocks/mock_boost_asio_beast.hpp index c95ef5cd..e7a84c88 100644 --- a/mocks/mock_boost_asio_beast.hpp +++ b/mocks/mock_boost_asio_beast.hpp @@ -22,7 +22,7 @@ namespace bzn::asio { - class Mocktcp_socket_base : public tcp_socket_base { + class mock_tcp_socket_base : public tcp_socket_base { public: MOCK_METHOD0(get_tcp_socket, boost::asio::ip::tcp::socket&()); @@ -37,7 +37,7 @@ namespace bzn::asio { namespace bzn::asio { - class Mockudp_socket_base : public udp_socket_base { + class mock_udp_socket_base : public udp_socket_base { public: MOCK_METHOD3(async_send_to, void(const boost::asio::const_buffer& msg, boost::asio::ip::udp::endpoint ep, @@ -49,7 +49,7 @@ namespace bzn::asio { namespace bzn::asio { - class Mocktcp_acceptor_base : public tcp_acceptor_base { + class mock_tcp_acceptor_base : public tcp_acceptor_base { public: MOCK_METHOD2(async_accept, void(bzn::asio::tcp_socket_base& socket, bzn::asio::accept_handler handler)); @@ -62,7 +62,7 @@ namespace bzn::asio { namespace bzn::asio { - class Mocksteady_timer_base : public steady_timer_base { + class mock_steady_timer_base : public steady_timer_base { public: MOCK_METHOD1(async_wait, void(wait_handler handler)); @@ -79,7 +79,7 @@ namespace bzn::asio { namespace bzn::asio { - class Mockstrand_base : public strand_base { + class mock_strand_base : public strand_base { public: MOCK_METHOD1(wrap, bzn::asio::write_handler(write_handler handler)); @@ -98,7 +98,7 @@ namespace bzn::asio { namespace bzn::asio { - class Mockio_context_base : public io_context_base { + class mock_io_context_base : public io_context_base { public: MOCK_METHOD1(make_unique_tcp_acceptor, std::unique_ptr(const boost::asio::ip::tcp::endpoint& ep)); @@ -127,7 +127,7 @@ namespace bzn::asio { namespace bzn::beast { - class Mockhttp_socket_base : public http_socket_base { + class mock_http_socket_base : public http_socket_base { public: MOCK_METHOD0(get_socket, boost::asio::ip::tcp::socket&()); @@ -144,7 +144,7 @@ namespace bzn::beast { namespace bzn::beast { - class Mockwebsocket_stream_base : public websocket_stream_base { + class mock_websocket_stream_base : public websocket_stream_base { public: MOCK_METHOD0(get_websocket, boost::beast::websocket::stream&()); @@ -171,7 +171,7 @@ namespace bzn::beast { namespace bzn::beast { - class Mockwebsocket_base : public websocket_base { + class mock_websocket_base : public websocket_base { public: MOCK_METHOD1(make_unique_websocket_stream, std::unique_ptr(boost::asio::ip::tcp::socket& socket)); diff --git a/mocks/mock_crud_base.hpp b/mocks/mock_crud_base.hpp index 2c7619f4..2aa7e157 100644 --- a/mocks/mock_crud_base.hpp +++ b/mocks/mock_crud_base.hpp @@ -19,7 +19,7 @@ namespace bzn { - class Mockcrud_base : public crud_base { + class mock_crud_base : public crud_base { public: MOCK_METHOD3(handle_request, void(const bzn::caller_id_t& caller_id, const database_msg& request, std::shared_ptr session)); diff --git a/mocks/mock_crypto_base.hpp b/mocks/mock_crypto_base.hpp index eede3fd4..f92b1b6c 100644 --- a/mocks/mock_crypto_base.hpp +++ b/mocks/mock_crypto_base.hpp @@ -19,7 +19,7 @@ namespace bzn { - class Mockcrypto_base : public crypto_base + class mock_crypto_base : public crypto_base { public: MOCK_METHOD1(sign, bool(bzn_envelope& msg)); diff --git a/mocks/mock_node_base.hpp b/mocks/mock_node_base.hpp index 2fd45324..774a52df 100644 --- a/mocks/mock_node_base.hpp +++ b/mocks/mock_node_base.hpp @@ -22,7 +22,7 @@ namespace bzn { -class Mocknode_base : public node_base { +class mock_node_base : public node_base { public: MOCK_METHOD2(register_for_message, bool(const bzn_envelope::PayloadCase msg_type, bzn::protobuf_handler message_handler)); diff --git a/mocks/mock_pbft_base.hpp b/mocks/mock_pbft_base.hpp index b4eaa26c..a68fa6a2 100644 --- a/mocks/mock_pbft_base.hpp +++ b/mocks/mock_pbft_base.hpp @@ -22,7 +22,7 @@ namespace bzn { -class Mockpbft_base : public pbft_base { +class mock_pbft_base : public pbft_base { public: MOCK_METHOD0(start, void()); diff --git a/mocks/mock_pbft_failure_detector.hpp b/mocks/mock_pbft_failure_detector.hpp index 42c4e606..5dfe5215 100644 --- a/mocks/mock_pbft_failure_detector.hpp +++ b/mocks/mock_pbft_failure_detector.hpp @@ -20,7 +20,7 @@ namespace bzn { - class Mockpbft_failure_detector_base : public pbft_failure_detector_base + class mock_pbft_failure_detector_base : public pbft_failure_detector_base { public: MOCK_METHOD1(request_seen, void(const bzn::hash_t& req)); diff --git a/mocks/mock_session_base.hpp b/mocks/mock_session_base.hpp index 19c027b3..705582b2 100644 --- a/mocks/mock_session_base.hpp +++ b/mocks/mock_session_base.hpp @@ -21,7 +21,7 @@ // gmock_gen.py generated... namespace bzn { - class Mocksession_base : public session_base { + class mock_session_base : public session_base { public: MOCK_METHOD1(send_message, void(std::shared_ptr msg)); diff --git a/mocks/mock_status_provider_base.hpp b/mocks/mock_status_provider_base.hpp index cc556af4..dc8f1563 100644 --- a/mocks/mock_status_provider_base.hpp +++ b/mocks/mock_status_provider_base.hpp @@ -22,7 +22,7 @@ namespace bzn { - class Mockstatus_provider_base : public status_provider_base { + class mock_status_provider_base : public status_provider_base { public: MOCK_METHOD0(get_name, std::string()); diff --git a/mocks/mock_storage_base.hpp b/mocks/mock_storage_base.hpp index f585888a..d4c17278 100644 --- a/mocks/mock_storage_base.hpp +++ b/mocks/mock_storage_base.hpp @@ -19,7 +19,7 @@ namespace bzn { - class Mockstorage_base : public storage_base { + class mock_storage_base : public storage_base { public: MOCK_METHOD3(create, bzn::storage_result(const bzn::uuid_t& uuid, const std::string& key, const std::string& value)); diff --git a/mocks/mock_subscription_manager_base.hpp b/mocks/mock_subscription_manager_base.hpp index c0d61dd8..d87794b7 100644 --- a/mocks/mock_subscription_manager_base.hpp +++ b/mocks/mock_subscription_manager_base.hpp @@ -19,7 +19,7 @@ namespace bzn { -class Mocksubscription_manager_base : public subscription_manager_base { +class mock_subscription_manager_base : public subscription_manager_base { public: MOCK_METHOD0(start, void()); diff --git a/mocks/smart_mock_io.cpp b/mocks/smart_mock_io.cpp index 2f867d7b..54e7f1a7 100644 --- a/mocks/smart_mock_io.cpp +++ b/mocks/smart_mock_io.cpp @@ -23,7 +23,7 @@ bzn::asio::smart_mock_io::smart_mock_io() EXPECT_CALL(*this, make_unique_strand()).WillRepeatedly(Invoke( [&]() { - auto strand = std::make_unique(); + auto strand = std::make_unique(); EXPECT_CALL(*strand, wrap(A())).WillRepeatedly(ReturnArg<0>()); EXPECT_CALL(*strand, wrap(A())).WillRepeatedly(ReturnArg<0>()); EXPECT_CALL(*strand, wrap(A())).WillRepeatedly(ReturnArg<0>()); @@ -47,7 +47,7 @@ bzn::asio::smart_mock_io::smart_mock_io() { auto id = timer_count++; - auto timer = std::make_unique(); + auto timer = std::make_unique(); EXPECT_CALL(*timer, async_wait(_)).WillRepeatedly(Invoke( [&, id](auto wh) { @@ -68,7 +68,7 @@ bzn::asio::smart_mock_io::smart_mock_io() { auto id = socket_count++; - auto mock_socket = std::make_unique(); + auto mock_socket = std::make_unique(); static boost::asio::io_context io; static boost::asio::ip::tcp::socket socket(io); @@ -90,7 +90,7 @@ bzn::asio::smart_mock_io::smart_mock_io() EXPECT_CALL(*this, make_unique_tcp_acceptor(_)).Times(AtMost(1)).WillOnce(Invoke( [&](auto& /*ep*/) { - auto mock_acceptor = std::make_unique(); + auto mock_acceptor = std::make_unique(); EXPECT_CALL(*mock_acceptor, async_accept(_, _)).WillRepeatedly(Invoke( [&](auto& socket, auto handler) @@ -107,7 +107,7 @@ bzn::asio::smart_mock_io::smart_mock_io() { auto id = this->socket_id_map.at(socket.native_handle()); this->socket_is_open.insert_or_assign(id, true); - auto wss = std::make_unique(); + auto wss = std::make_unique(); EXPECT_CALL(*wss, async_accept(_)).Times(AtMost(1)).WillOnce(Invoke( [&, id](auto handler) diff --git a/mocks/smart_mock_io.hpp b/mocks/smart_mock_io.hpp index e304690c..c30007c4 100644 --- a/mocks/smart_mock_io.hpp +++ b/mocks/smart_mock_io.hpp @@ -17,7 +17,7 @@ namespace bzn::asio { - class smart_mock_io : public Mockio_context_base + class smart_mock_io : public mock_io_context_base { public: @@ -28,7 +28,7 @@ namespace bzn::asio void yield_until_clear(); std::shared_ptr real_io_context = std::make_shared(); - std::shared_ptr websocket = std::make_shared(); + std::shared_ptr websocket = std::make_shared(); size_t timer_count = 0; std::map timer_callbacks; diff --git a/mocks/smart_mock_node.hpp b/mocks/smart_mock_node.hpp index 0d899b3a..1566b3e0 100644 --- a/mocks/smart_mock_node.hpp +++ b/mocks/smart_mock_node.hpp @@ -19,7 +19,7 @@ namespace bzn { - class smart_mock_node : public Mocknode_base + class smart_mock_node : public mock_node_base { public: smart_mock_node(); diff --git a/monitor/test/monitor_test.cpp b/monitor/test/monitor_test.cpp index 2d259aa1..2657e09f 100644 --- a/monitor/test/monitor_test.cpp +++ b/monitor/test/monitor_test.cpp @@ -29,7 +29,7 @@ using namespace ::testing; class monitor_test : public Test { public: - std::shared_ptr io_context = std::make_shared(); + std::shared_ptr io_context = std::make_shared(); std::shared_ptr clock = std::make_shared(); std::shared_ptr options = std::make_shared(); std::shared_ptr monitor; @@ -65,7 +65,7 @@ class monitor_test : public Test EXPECT_CALL(*(this->io_context), make_unique_udp_socket()).WillRepeatedly(Invoke( [&]() { - auto socket = std::make_unique(); + auto socket = std::make_unique(); EXPECT_CALL(*socket, async_send_to(_, _, _)).WillRepeatedly(Invoke( [&](auto buffer, auto /*endpoint*/, auto handler) { @@ -245,4 +245,4 @@ TEST_F(monitor_test, test_collate_all_messages_sent) EXPECT_NE(result.find(4000), result.end()); EXPECT_NE(result.at(4000).find("hash"), std::string::npos); -} \ No newline at end of file +} diff --git a/node/test/node_test.cpp b/node/test/node_test.cpp index 5f75a021..3d3dd1a5 100644 --- a/node/test/node_test.cpp +++ b/node/test/node_test.cpp @@ -161,7 +161,7 @@ namespace bzn TEST(node, test_that_registering_message_handler_can_only_be_done_once) { auto mock_chaos = std::make_shared>(); - auto mock_io_context = std::make_shared>(); + auto mock_io_context = std::make_shared>(); auto options = std::shared_ptr(); auto crypto = std::shared_ptr(); auto monitor = std::make_shared>(); @@ -180,12 +180,12 @@ namespace bzn TEST(node, test_that_wrongly_signed_messages_are_dropped) { auto mock_chaos = std::make_shared>(); - auto mock_io_context = std::make_shared>(); + auto mock_io_context = std::make_shared>(); auto options = std::make_shared(); options->get_mutable_simple_options().set(bzn::option_names::CRYPTO_ENABLED_INCOMING, "true"); auto monitor = std::make_shared>(); auto crypto = std::make_shared(options, monitor); - auto mock_session = std::make_shared(); + auto mock_session = std::make_shared(); auto node = std::make_shared(mock_io_context, nullptr, mock_chaos, TEST_ENDPOINT, crypto, options, monitor); // Add our test callback... diff --git a/node/test/session_test.cpp b/node/test/session_test.cpp index b29e3377..6aef89df 100644 --- a/node/test/session_test.cpp +++ b/node/test/session_test.cpp @@ -40,7 +40,7 @@ namespace class session_test : public Test { public: - std::shared_ptr io_context = std::make_shared(); + std::shared_ptr io_context = std::make_shared(); std::shared_ptr mock_chaos = std::make_shared>(); std::shared_ptr monitor = std::make_shared>(); @@ -51,7 +51,7 @@ class session_test : public Test EXPECT_CALL(*(this->io_context), make_unique_steady_timer()).WillRepeatedly(Invoke( [&]() { - auto timer = std::make_unique(); + auto timer = std::make_unique(); EXPECT_CALL(*timer, async_wait(_)).WillRepeatedly(Invoke( [&](auto wh) { @@ -64,7 +64,7 @@ class session_test : public Test EXPECT_CALL(*(this->io_context), make_unique_strand()).WillRepeatedly(Invoke( []() { - auto strand = std::make_unique(); + auto strand = std::make_unique(); EXPECT_CALL(*strand, wrap(A())).WillRepeatedly(ReturnArg<0>()); EXPECT_CALL(*strand, wrap(A())).WillRepeatedly(ReturnArg<0>()); EXPECT_CALL(*strand, wrap(A())).WillRepeatedly(ReturnArg<0>()); @@ -90,7 +90,7 @@ class session_test2 : public Test std::shared_ptr mock_io = std::make_shared(); std::shared_ptr mock_chaos = std::make_shared>(); std::shared_ptr monitor = std::make_shared>(); - std::shared_ptr mock_crypto = std::make_shared>(); + std::shared_ptr mock_crypto = std::make_shared>(); std::shared_ptr options = std::make_shared(); @@ -119,7 +119,7 @@ namespace bzn TEST_F(session_test, test_that_when_session_starts_it_accepts_and_read_is_scheduled) { - auto mock_websocket_stream = std::make_shared(); + auto mock_websocket_stream = std::make_shared(); EXPECT_CALL(*mock_websocket_stream, is_open()).WillRepeatedly(Return(true)); bzn::asio::accept_handler accept_handler; diff --git a/pbft/test/database_pbft_service_test.cpp b/pbft/test/database_pbft_service_test.cpp index 09d75dab..ffad2408 100644 --- a/pbft/test/database_pbft_service_test.cpp +++ b/pbft/test/database_pbft_service_test.cpp @@ -30,46 +30,46 @@ namespace TEST(database_pbft_service, test_that_on_construction_if_next_request_sequence_doesnt_exist_its_created) { - auto mock_storage = std::make_shared(); + auto mock_storage = std::make_shared(); EXPECT_CALL(*mock_storage, read(_, _)).WillOnce(Return(std::optional())); EXPECT_CALL(*mock_storage, create(_, _, DEFAULT_NEXT_REQUEST_SEQUENCE)).WillOnce(Return(bzn::storage_result::ok)); EXPECT_CALL(*mock_storage, update(_, _, DEFAULT_NEXT_REQUEST_SEQUENCE)).WillOnce(Return(bzn::storage_result::ok)); - bzn::database_pbft_service dps(std::make_shared(), mock_storage, std::make_shared(), TEST_UUID); + bzn::database_pbft_service dps(std::make_shared(), mock_storage, std::make_shared(), TEST_UUID); } TEST(database_pbft_service, test_that_on_construction_if_next_request_sequence_exists_its_loaded) { - auto mock_storage = std::make_shared(); + auto mock_storage = std::make_shared(); EXPECT_CALL(*mock_storage, read(_, _)).WillOnce(Return(std::optional("123"))); EXPECT_CALL(*mock_storage, update(_, _, "123")).WillOnce(Return(bzn::storage_result::ok)); - bzn::database_pbft_service dps(std::make_shared(), mock_storage, std::make_shared(), TEST_UUID); + bzn::database_pbft_service dps(std::make_shared(), mock_storage, std::make_shared(), TEST_UUID); } TEST(database_pbft_service, test_that_on_construction_if_next_request_sequence_doesnt_exist_it_throws_if_error_occurs) { - auto mock_storage = std::make_shared(); + auto mock_storage = std::make_shared(); EXPECT_CALL(*mock_storage, read(_, _)).WillOnce(Return(std::optional())); EXPECT_CALL(*mock_storage, create(_, _, DEFAULT_NEXT_REQUEST_SEQUENCE)).WillOnce(Return(bzn::storage_result::value_too_large)); - EXPECT_THROW(bzn::database_pbft_service dps(std::make_shared(), mock_storage, std::make_shared(), TEST_UUID), std::runtime_error); + EXPECT_THROW(bzn::database_pbft_service dps(std::make_shared(), mock_storage, std::make_shared(), TEST_UUID), std::runtime_error); } TEST(database_pbft_service, test_that_failed_storing_of_operation_does_not_throw_for_duplicate) { - auto mock_storage = std::make_shared(); + auto mock_storage = std::make_shared(); EXPECT_CALL(*mock_storage, read(_, _)).WillOnce(Return(std::optional())); EXPECT_CALL(*mock_storage, create(_, _, DEFAULT_NEXT_REQUEST_SEQUENCE)).WillOnce(Return(bzn::storage_result::ok)); - bzn::database_pbft_service dps(std::make_shared(), mock_storage, std::make_shared(), TEST_UUID); + bzn::database_pbft_service dps(std::make_shared(), mock_storage, std::make_shared(), TEST_UUID); EXPECT_CALL(*mock_storage, create(_, _, _)).WillOnce(Return(bzn::storage_result::exists)); EXPECT_CALL(*mock_storage, update(_, _, _)).WillOnce(Return(bzn::storage_result::ok)); @@ -86,8 +86,8 @@ TEST(database_pbft_service, test_that_failed_storing_of_operation_does_not_throw TEST(database_pbft_service, test_that_executed_operation_fires_callback_with_operation) { auto mem_storage = std::make_shared(); - auto mock_io_context = std::make_shared(); - auto mock_crud = std::make_shared>(); + auto mock_io_context = std::make_shared(); + auto mock_crud = std::make_shared>(); EXPECT_CALL(*mock_io_context, post(_)).WillOnce(InvokeArgument<0>()); @@ -123,8 +123,8 @@ TEST(database_pbft_service, test_that_executed_operation_fires_callback_with_ope TEST(database_pbft_service, test_that_apply_operation_now_is_handled) { auto mem_storage = std::make_shared(); - auto mock_io_context = std::make_shared(); - auto mock_crud = std::make_shared(); + auto mock_io_context = std::make_shared(); + auto mock_crud = std::make_shared(); bzn::database_pbft_service dps(mock_io_context, mem_storage, mock_crud, TEST_UUID); @@ -162,8 +162,8 @@ TEST(database_pbft_service, test_that_apply_operation_now_is_handled) TEST(database_pbft_service, test_that_stored_operation_is_executed_in_order_and_registered_handler_is_scheduled) { auto mem_storage = std::make_shared(); - auto mock_io_context = std::make_shared(); - auto mock_crud = std::make_shared(); + auto mock_io_context = std::make_shared(); + auto mock_crud = std::make_shared(); bzn::database_pbft_service dps(mock_io_context, mem_storage, mock_crud, TEST_UUID); @@ -186,7 +186,7 @@ TEST(database_pbft_service, test_that_stored_operation_is_executed_in_order_and_ msg.mutable_create()->set_key("key3"); msg.mutable_create()->set_value("value3"); - auto mock_session = std::make_shared(); + auto mock_session = std::make_shared(); EXPECT_CALL(*mock_session, is_open()).WillRepeatedly(Return(true)); auto operation3 = std::make_shared(0, 3, "somehashb", nullptr); env.set_database_msg(msg.SerializeAsString()); @@ -204,7 +204,7 @@ TEST(database_pbft_service, test_that_stored_operation_is_executed_in_order_and_ auto operation1 = std::make_shared(0, 1, "somehashc", nullptr); env.set_database_msg(msg.SerializeAsString()); operation1->record_request(env); - auto session2 = std::make_shared(); + auto session2 = std::make_shared(); EXPECT_CALL(*session2, is_open()).WillRepeatedly(Return(true)); operation1->set_session(std::move(session2)); @@ -273,8 +273,8 @@ namespace test TEST(database_pbft_service, test_that_set_state_catches_up_backlogged_operations) { auto mem_storage = std::make_shared(); - auto mock_io_context = std::make_shared(); - auto mock_crud = std::make_shared(); + auto mock_io_context = std::make_shared(); + auto mock_crud = std::make_shared(); bzn::database_pbft_service dps(mock_io_context, mem_storage, mock_crud, TEST_UUID); diff --git a/pbft/test/pbft_failure_detector_test.cpp b/pbft/test/pbft_failure_detector_test.cpp index f8b293c5..e3351248 100644 --- a/pbft/test/pbft_failure_detector_test.cpp +++ b/pbft/test/pbft_failure_detector_test.cpp @@ -27,10 +27,10 @@ namespace bzn public: std::shared_ptr failure_detector; - std::shared_ptr mock_io_context = - std::make_shared>(); - std::unique_ptr request_timer = - std::make_unique>(); + std::shared_ptr mock_io_context = + std::make_shared>(); + std::unique_ptr request_timer = + std::make_unique>(); bzn::asio::wait_handler request_timer_callback; diff --git a/pbft/test/pbft_join_leave_test.cpp b/pbft/test/pbft_join_leave_test.cpp index 40498202..52fbb74e 100644 --- a/pbft/test/pbft_join_leave_test.cpp +++ b/pbft/test/pbft_join_leave_test.cpp @@ -86,7 +86,7 @@ namespace bzn { protected: pbft_msg - send_new_config_preprepare(std::shared_ptr pbft, std::shared_ptr mock_node, + send_new_config_preprepare(std::shared_ptr pbft, std::shared_ptr mock_node, const bzn::pbft_configuration &config) { // make and "send" a pre-prepare message for a new_config @@ -369,10 +369,10 @@ namespace bzn // set up a second pbft to be the new primary after a view change auto mock_node2 = std::make_shared(); - auto mock_io_context2 = std::make_shared>(); - auto audit_heartbeat_timer2 = std::make_unique>(); - auto new_config_timer2 = std::make_unique>(); - auto join_retry_timer2 = std::make_unique>(); + auto mock_io_context2 = std::make_shared>(); + auto audit_heartbeat_timer2 = std::make_unique>(); + auto new_config_timer2 = std::make_unique>(); + auto join_retry_timer2 = std::make_unique>(); auto mock_service2 = std::make_shared>(); auto mock_options = std::make_shared(); auto storage2 = std::make_shared(); @@ -492,10 +492,10 @@ namespace bzn // set up a third pbft to receive the new_view message and join the swarm auto mock_node3 = std::make_shared(); - auto mock_io_context3 = std::make_shared>(); - auto audit_heartbeat_timer3 = std::make_unique>(); - auto new_config_timer3 = std::make_unique>(); - auto join_retry_timer3 = std::make_unique>(); + auto mock_io_context3 = std::make_shared>(); + auto audit_heartbeat_timer3 = std::make_unique>(); + auto new_config_timer3 = std::make_unique>(); + auto join_retry_timer3 = std::make_unique>(); auto mock_service3 = std::make_shared>(); auto mock_options3 = std::make_shared(); auto storage3 = std::make_shared(); diff --git a/pbft/test/pbft_newview_test.cpp b/pbft/test/pbft_newview_test.cpp index 5abf5703..bfacfba5 100644 --- a/pbft/test/pbft_newview_test.cpp +++ b/pbft/test/pbft_newview_test.cpp @@ -25,10 +25,10 @@ namespace bzn { public: - std::shared_ptr + std::shared_ptr build_pft_with_mock_crypto() { - std::shared_ptr mockcrypto = std::make_shared(); + std::shared_ptr mockcrypto = std::make_shared(); this->crypto = mockcrypto; this->build_pbft(); return mockcrypto; diff --git a/pbft/test/pbft_test.cpp b/pbft/test/pbft_test.cpp index dfe9f32d..73be43de 100644 --- a/pbft/test/pbft_test.cpp +++ b/pbft/test/pbft_test.cpp @@ -162,7 +162,7 @@ namespace bzn::test TEST_F(pbft_test, client_request_does_not_result_in_message_ack) { this->build_pbft(); - auto mock_session = std::make_shared>(); + auto mock_session = std::make_shared>(); EXPECT_CALL(*mock_session, send_message(A>())).Times(Exactly(0)); @@ -172,7 +172,7 @@ namespace bzn::test TEST_F(pbft_test, database_response_is_forwarded_to_session) { this->build_pbft(); - auto mock_session = std::make_shared>(); + auto mock_session = std::make_shared>(); EXPECT_CALL(*mock_session, send_message(A>())).Times(Exactly(1)); @@ -212,7 +212,7 @@ namespace bzn::test TEST_F(pbft_test, client_request_executed_results_in_message_response) { - auto mock_session = std::make_shared(); + auto mock_session = std::make_shared(); EXPECT_CALL(*mock_session, send_message(A>())).Times(Exactly(1)); auto peers = std::make_shared>(); diff --git a/pbft/test/pbft_test_common.cpp b/pbft/test/pbft_test_common.cpp index 6bd60cb1..32d27ec9 100644 --- a/pbft/test/pbft_test_common.cpp +++ b/pbft/test/pbft_test_common.cpp @@ -98,7 +98,7 @@ namespace bzn::test Invoke( [&]() { - auto timer = std::make_unique>(); + auto timer = std::make_unique>(); EXPECT_CALL(*timer, async_wait(_)) .Times(AnyNumber()) .WillOnce( diff --git a/pbft/test/pbft_test_common.hpp b/pbft/test/pbft_test_common.hpp index 3caebe55..dc888b11 100644 --- a/pbft/test/pbft_test_common.hpp +++ b/pbft/test/pbft_test_common.hpp @@ -71,15 +71,15 @@ namespace bzn::test pbft_msg preprepare_msg; bzn_envelope default_original_msg; - std::shared_ptr mock_io_context = - std::make_shared>(); + std::shared_ptr mock_io_context = + std::make_shared>(); std::shared_ptr mock_node = std::make_shared(); - std::shared_ptr mock_failure_detector = - std::make_shared>(); + std::shared_ptr mock_failure_detector = + std::make_shared>(); std::shared_ptr mock_service = std::make_shared>(); - std::shared_ptr mock_session = - std::make_shared>(); + std::shared_ptr mock_session = + std::make_shared>(); std::shared_ptr storage = std::make_shared(); std::shared_ptr operation_manager = std::make_shared(storage); @@ -90,17 +90,17 @@ namespace bzn::test std::shared_ptr pbft; - std::unique_ptr audit_heartbeat_timer = - std::make_unique>(); + std::unique_ptr audit_heartbeat_timer = + std::make_unique>(); - std::unique_ptr new_config_timer = - std::make_unique>(); + std::unique_ptr new_config_timer = + std::make_unique>(); - std::unique_ptr join_retry_timer = - std::make_unique>(); + std::unique_ptr join_retry_timer = + std::make_unique>(); - std::unique_ptr cp_manager_timer1 = - std::make_unique>(); + std::unique_ptr cp_manager_timer1 = + std::make_unique>(); bzn::asio::wait_handler audit_heartbeat_timer_callback; bzn::asio::wait_handler new_config_timer_callback; diff --git a/pbft/test/pbft_viewchange_test.cpp b/pbft/test/pbft_viewchange_test.cpp index ec9d02a8..4aa1fe7c 100644 --- a/pbft/test/pbft_viewchange_test.cpp +++ b/pbft/test/pbft_viewchange_test.cpp @@ -27,10 +27,10 @@ namespace bzn public: std::shared_ptr options = std::make_shared(); - std::shared_ptr + std::shared_ptr build_pft_with_mock_crypto() { - std::shared_ptr mockcrypto = std::make_shared(); + std::shared_ptr mockcrypto = std::make_shared(); this->crypto = mockcrypto; this->build_pbft(); return mockcrypto; @@ -325,16 +325,16 @@ namespace bzn // sut2 is new primary after view change auto mock_node2 = std::make_shared(); - std::shared_ptr mock_io_context2 = - std::make_shared>(); - std::unique_ptr audit_heartbeat_timer2 = - std::make_unique>(); - std::unique_ptr new_config_timer2 = - std::make_unique>(); - std::unique_ptr join_retry_timer2 = - std::make_unique>(); - std::unique_ptr grace_timer2 = - std::make_unique>(); + std::shared_ptr mock_io_context2 = + std::make_shared>(); + std::unique_ptr audit_heartbeat_timer2 = + std::make_unique>(); + std::unique_ptr new_config_timer2 = + std::make_unique>(); + std::unique_ptr join_retry_timer2 = + std::make_unique>(); + std::unique_ptr grace_timer2 = + std::make_unique>(); std::shared_ptr mock_service2 = std::make_shared>(); diff --git a/status/test/status_test.cpp b/status/test/status_test.cpp index 823fe3af..da3d79d2 100644 --- a/status/test/status_test.cpp +++ b/status/test/status_test.cpp @@ -25,7 +25,7 @@ using namespace testing; TEST(status_test, test_that_status_registers_and_responses_to_requests) { - auto mock_node = std::make_shared(); + auto mock_node = std::make_shared(); // success { @@ -51,10 +51,10 @@ TEST(status_test, test_that_status_request_queries_status_providers) { const std::string SWARM_ID{"utest"}; - auto mock_node = std::make_shared(); - auto mock_session = std::make_shared(); + auto mock_node = std::make_shared(); + auto mock_session = std::make_shared(); - auto mock_status_provider = std::make_shared(); + auto mock_status_provider = std::make_shared(); auto status = std::make_shared(mock_node, bzn::status::status_provider_list_t{mock_status_provider, mock_status_provider}, SWARM_ID);