v2.0.4-rc (#37)
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
# Changelog ## v2.0.4-rc ### BREAKING CHANGES * `renterd` v2.0.0+ is now required. Prior versions will fail to mount. ### Issues * \#35 [bug] Low frequency check is set to '0' instead of 1 hour by default * \#36 [bug] Max cache size bytes is set to '0' by default ### Changes from v2.0.3-rc * Added Sia API version check prior to mounting * Added back `-cv` (check version) CLI option * Continue documentation updates * Fixed setting `ApiAuth` via `set_value_by_name` * Fixed setting `HostConfig.ApiUser` via `set_value_by_name` * Fixed setting `HostConfig.Path` via `set_value_by_name` * Fixed setting `HostConfig.Protocol` via `set_value_by_name` * Improved ring buffer read-ahead * Integrated `renterd` version 2.0.0 * Prefer using local cache file when opening files * Refactored `app_config` unit tests * Refactored polling to be more accurate on scheduling tasks Reviewed-on: #37
This commit is contained in:
@ -29,15 +29,28 @@ TEST(utils_error, check_default_exception_handler) {
|
||||
EXPECT_TRUE(utils::error::get_exception_handler() != nullptr);
|
||||
if (&utils::error::default_exception_handler ==
|
||||
utils::error::get_exception_handler()) {
|
||||
#if defined(PROJECT_ENABLE_SPDLOG) && defined(PROJECT_ENABLE_V2_ERRORS)
|
||||
auto default_handler_is_spdlog =
|
||||
is_decay_equ<decltype(utils::error::default_exception_handler),
|
||||
utils::error::spdlog_exception_handler>;
|
||||
EXPECT_TRUE(default_handler_is_spdlog);
|
||||
#else // !defined(PROJECT_ENABLE_SPDLOG) || !defined(PROJECT_ENABLE_V2_ERRORS)
|
||||
auto default_handler_is_iostream =
|
||||
is_decay_equ<decltype(utils::error::default_exception_handler),
|
||||
utils::error::iostream_exception_handler>;
|
||||
EXPECT_TRUE(default_handler_is_iostream);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
TEST(utils_error, can_override_exception_handler) {
|
||||
struct my_exc_handler final : public utils::error::i_exception_handler {
|
||||
#if defined(PROJECT_ENABLE_V2_ERRORS)
|
||||
MOCK_METHOD(void, handle_debug,
|
||||
(std::string_view function_name, std::string_view msg),
|
||||
(const, override));
|
||||
#endif // defined(PROJECT_ENABLE_V2_ERRORS)
|
||||
|
||||
MOCK_METHOD(void, handle_error,
|
||||
(std::string_view function_name, std::string_view msg),
|
||||
(const, override));
|
||||
@ -48,11 +61,30 @@ TEST(utils_error, can_override_exception_handler) {
|
||||
MOCK_METHOD(void, handle_exception,
|
||||
(std::string_view function_name, const std::exception &ex),
|
||||
(const, override));
|
||||
|
||||
#if defined(PROJECT_ENABLE_V2_ERRORS)
|
||||
MOCK_METHOD(void, handle_info,
|
||||
(std::string_view function_name, std::string_view msg),
|
||||
(const, override));
|
||||
|
||||
MOCK_METHOD(void, handle_trace,
|
||||
(std::string_view function_name, std::string_view msg),
|
||||
(const, override));
|
||||
|
||||
MOCK_METHOD(void, handle_warn,
|
||||
(std::string_view function_name, std::string_view msg),
|
||||
(const, override));
|
||||
#endif // defined(PROJECT_ENABLE_V2_ERRORS)
|
||||
};
|
||||
|
||||
my_exc_handler handler{};
|
||||
utils::error::set_exception_handler(&handler);
|
||||
|
||||
#if defined(PROJECT_ENABLE_V2_ERRORS)
|
||||
EXPECT_CALL(handler, handle_debug("test_func", "debug")).WillOnce(Return());
|
||||
utils::error::handle_debug("test_func", "debug");
|
||||
#endif // defined(PROJECT_ENABLE_V2_ERRORS)
|
||||
|
||||
EXPECT_CALL(handler, handle_error("test_func", "error")).WillOnce(Return());
|
||||
utils::error::handle_error("test_func", "error");
|
||||
|
||||
@ -68,6 +100,17 @@ TEST(utils_error, can_override_exception_handler) {
|
||||
});
|
||||
utils::error::handle_exception("test_func_ex", ex);
|
||||
|
||||
#if defined(PROJECT_ENABLE_V2_ERRORS)
|
||||
EXPECT_CALL(handler, handle_info("test_func", "info")).WillOnce(Return());
|
||||
utils::error::handle_info("test_func", "info");
|
||||
|
||||
EXPECT_CALL(handler, handle_trace("test_func", "trace")).WillOnce(Return());
|
||||
utils::error::handle_trace("test_func", "trace");
|
||||
|
||||
EXPECT_CALL(handler, handle_warn("test_func", "warn")).WillOnce(Return());
|
||||
utils::error::handle_warn("test_func", "warn");
|
||||
#endif // defined(PROJECT_ENABLE_V2_ERRORS)
|
||||
|
||||
utils::error::set_exception_handler(&utils::error::default_exception_handler);
|
||||
}
|
||||
} // namespace repertory
|
||||
|
Reference in New Issue
Block a user