From db51ec64892239dbb630706cc0fd66e857eab19f Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Fri, 20 Dec 2024 18:55:48 -0600 Subject: [PATCH] unit tests and fixes --- repertory/librepertory/include/types/repertory.hpp | 12 ++++++++++++ repertory/librepertory/src/app_config.cpp | 6 ++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/repertory/librepertory/include/types/repertory.hpp b/repertory/librepertory/include/types/repertory.hpp index 56c7778d..d0b8cddd 100644 --- a/repertory/librepertory/include/types/repertory.hpp +++ b/repertory/librepertory/include/types/repertory.hpp @@ -618,6 +618,18 @@ template <> struct adl_serializer> { value.store(repertory::database_type_from_string(data.get())); } }; + +template <> struct adl_serializer> { + static void to_json(json &data, + const std::atomic &value) { + data = repertory::download_type_to_string(value.load()); + } + + static void from_json(const json &data, + std::atomic &value) { + value.store(repertory::download_type_from_string(data.get())); + } +}; NLOHMANN_JSON_NAMESPACE_END #endif // REPERTORY_INCLUDE_TYPES_REPERTORY_HPP_ diff --git a/repertory/librepertory/src/app_config.cpp b/repertory/librepertory/src/app_config.cpp index 6b196d4e..00eebf6f 100644 --- a/repertory/librepertory/src/app_config.cpp +++ b/repertory/librepertory/src/app_config.cpp @@ -91,11 +91,11 @@ app_config::app_config(const provider_type &prov, auto host_cfg = get_host_config(); host_cfg.agent_string = default_agent_name(prov_); host_cfg.api_port = default_api_port(prov_); - set_host_config(host_cfg); + host_config_ = host_cfg; auto rm_cfg = get_remote_mount(); rm_cfg.api_port = default_remote_api_port(prov); - set_remote_mount(rm_cfg); + remote_mount_ = rm_cfg; if (not utils::file::directory(data_directory_).create_directory()) { throw startup_exception( @@ -1239,7 +1239,6 @@ void app_config::set_sia_config(sia_config value) { } void app_config::set_task_wait_ms(std::uint16_t value) { - std::cout << task_wait_ms_.load() << '|' << value << std::endl; set_value(task_wait_ms_, value); } @@ -1249,7 +1248,6 @@ auto app_config::set_value(dest &dst, const source &src) -> bool { return false; } - std::cout << "changed" << std::endl; dst = src; config_changed_ = true; save();