diff --git a/console/executor.cpp b/console/executor.cpp index ad21ebef..09916d7f 100644 --- a/console/executor.cpp +++ b/console/executor.cpp @@ -66,19 +66,23 @@ const std::unordered_map executor::options_ { "g", menu::go }, { "h", menu::hold }, { "i", menu::info }, + { "m", menu::menu_ }, { "t", menu::test }, + { "v", menu::version }, { "w", menu::work }, { "z", menu::zeroize } }; -const std::unordered_map executor::menu_ +const std::unordered_map executor::options_menu_ { { menu::backup, "[b]ackup the store" }, { menu::close, "[c]lose the node" }, { menu::errors, "[e]rrors in store display" }, { menu::go, "[g]o network communication" }, { menu::hold, "[h]old network communication" }, - { menu::info, "[i]nformation display" }, + { menu::info, "[i]nfo about store display" }, + { menu::menu_, "[m]enu of options and toggles" }, { menu::test, "[t]est built-in case" }, + { menu::version, "[v]ersion information" }, { menu::work, "[w]ork distribution display" }, { menu::zeroize, "[z]eroize disk full error" } }; @@ -91,20 +95,20 @@ const std::unordered_map executor::toggles_ { "x", levels::proxy }, { "r", levels::remote }, { "f", levels::fault }, - { "q", levels::quit }, + { "q", levels::quitting }, { "o", levels::objects }, { "v", levels::verbose } }; -const std::unordered_map executor::display_ +const std::unordered_map executor::toggles_menu_ { { levels::application, "[a]pplication" }, { levels::news, "[n]ews" }, { levels::session, "[s]ession" }, { levels::protocol, "[p]rotocol" }, - { levels::proxy, "pro[x]y" }, + { levels::proxy, "[x]proxy" }, { levels::remote, "[r]emote" }, { levels::fault, "[f]ault" }, - { levels::quit, "[q]uitting" }, + { levels::quitting, "[q]uitting" }, { levels::objects, "[o]bjects" }, { levels::verbose, "[v]erbose" } }; @@ -117,7 +121,7 @@ const std::unordered_map executor::defined_ { levels::proxy, levels::proxy_defined }, { levels::remote, levels::remote_defined }, { levels::fault, levels::fault_defined }, - { levels::quit, levels::quit_defined }, + { levels::quitting, levels::quitting_defined }, { levels::objects, levels::objects_defined }, { levels::verbose, levels::verbose_defined }, }; @@ -169,7 +173,7 @@ executor::executor(parser& metadata, std::istream& input, std::ostream& output, metadata.configured.log.proxy, metadata.configured.log.remote, metadata.configured.log.fault, - metadata.configured.log.quit, + metadata.configured.log.quitting, metadata.configured.log.objects, metadata.configured.log.verbose } @@ -284,6 +288,33 @@ void executor::dump_collisions() const query_.neutrino_buckets()) : 0)); } +// logging compilation and initial values. +void executor::dump_options() const +{ + logger(BN_NODE_INTERRUPT); + logger(BN_LOG_TABLE_HEADER); + logger(format("[a]pplication.. " BN_LOG_TABLE) % levels::application_defined % toggle_.at(levels::application)); + logger(format("[n]ews......... " BN_LOG_TABLE) % levels::news_defined % toggle_.at(levels::news)); + logger(format("[s]ession...... " BN_LOG_TABLE) % levels::session_defined % toggle_.at(levels::session)); + logger(format("[p]rotocol..... " BN_LOG_TABLE) % levels::protocol_defined % toggle_.at(levels::protocol)); + logger(format("[x]proxy....... " BN_LOG_TABLE) % levels::proxy_defined % toggle_.at(levels::proxy)); + logger(format("[r]emote....... " BN_LOG_TABLE) % levels::remote_defined % toggle_.at(levels::remote)); + logger(format("[f]ault........ " BN_LOG_TABLE) % levels::fault_defined % toggle_.at(levels::fault)); + logger(format("[q]uitting..... " BN_LOG_TABLE) % levels::quitting_defined % toggle_.at(levels::quitting)); + logger(format("[o]bjects...... " BN_LOG_TABLE) % levels::objects_defined % toggle_.at(levels::objects)); + logger(format("[v]erbose...... " BN_LOG_TABLE) % levels::verbose_defined % toggle_.at(levels::verbose)); +} + +// emit version information for libbitcoin libraries +void executor::dump_version() const +{ + logger(format(BN_VERSION_MESSAGE) + % LIBBITCOIN_NODE_VERSION + % LIBBITCOIN_DATABASE_VERSION + % LIBBITCOIN_NETWORK_VERSION + % LIBBITCOIN_SYSTEM_VERSION); +} + // fork flag transitions (candidate chain). void executor::scan_flags() const { @@ -1907,7 +1938,7 @@ bool executor::restore_store(bool details) return true; } -bool executor::backup_store(bool details) +bool executor::hot_backup_store(bool details) { if (!node_) { @@ -1915,6 +1946,12 @@ bool executor::backup_store(bool details) return false; } + if (const auto ec = store_.get_fault()) + { + logger(format(BN_SNAPSHOT_INVALID) % ec.message()); + return false; + } + logger(BN_NODE_BACKUP_STARTED); const auto start = logger::now(); if (const auto ec = node_->snapshot([&](auto event_, auto table) @@ -1934,6 +1971,27 @@ bool executor::backup_store(bool details) return true; } +bool executor::cold_backup_store(bool details) +{ + logger(BN_NODE_BACKUP_STARTED); + const auto start = logger::now(); + if (const auto ec = store_.snapshot([&](auto event_, auto table) + { + if (details) + logger(format(BN_BACKUP) % + full_node::store::events.at(event_) % + full_node::store::tables.at(table)); + })) + { + logger(format(BN_NODE_BACKUP_FAIL) % ec.message()); + return false; + } + + const auto span = duration_cast(logger::now() - start); + logger(format(BN_NODE_BACKUP_COMPLETE) % span.count()); + return true; +} + // Command line options. // ---------------------------------------------------------------------------- @@ -1947,7 +2005,7 @@ bool executor::do_help() return true; } -// --har[d]ware +// --[d]hardware bool executor::do_hardware() { // Intrinsics can be safely compiled for unsupported platforms. @@ -1985,16 +2043,12 @@ bool executor::do_settings() bool executor::do_version() { log_.stop(); - logger(format(BN_VERSION_MESSAGE) - % LIBBITCOIN_NODE_VERSION - % LIBBITCOIN_DATABASE_VERSION - % LIBBITCOIN_NETWORK_VERSION - % LIBBITCOIN_SYSTEM_VERSION); + dump_version(); return true; } -// --[i]nitchain -bool executor::do_initchain() +// --[n]ewstore +bool executor::do_new_store() { log_.stop(); if (!check_store_path(true) || @@ -2019,11 +2073,11 @@ bool executor::do_backup() log_.stop(); return check_store_path() && open_store() - && backup_store(true) + && cold_backup_store(true) && close_store(); } -// --restore[x] +// --[r]estore bool executor::do_restore() { log_.stop(); @@ -2044,8 +2098,8 @@ bool executor::do_flags() return close_store(); } -// --[m]easure -bool executor::do_measure() +// --[i]nformation +bool executor::do_information() { log_.stop(); if (!check_store_path() || @@ -2056,7 +2110,7 @@ bool executor::do_measure() return close_store(); } -// --sl[a]bs +// --[a]slabs bool executor::do_slabs() { log_.stop(); @@ -2068,7 +2122,7 @@ bool executor::do_slabs() return close_store(); } -// --buc[k]ets +// --[k]buckets bool executor::do_buckets() { log_.stop(); @@ -2080,7 +2134,7 @@ bool executor::do_buckets() return close_store(); } -// --collisions[l] +// --[l]collisions bool executor::do_collisions() { log_.stop(); @@ -2092,7 +2146,7 @@ bool executor::do_collisions() return close_store(); } -// --read[r] +// --[t]read bool executor::do_read() { log_.stop(); @@ -2104,7 +2158,7 @@ bool executor::do_read() return close_store(); } -// --write[w] +// --[w]rite bool executor::do_write() { log_.stop(); @@ -2122,13 +2176,13 @@ bool executor::do_write() // [b]ackup void executor::do_hot_backup() { - if (const auto ec = store_.get_fault()) + if (!node_) { - logger(format(BN_SNAPSHOT_INVALID) % ec.message()); + logger(BN_NODE_UNAVAILABLE); return; } - backup_store(true); + hot_backup_store(true); } // [c]lose @@ -2178,8 +2232,8 @@ void executor::do_resume() node_->resume(); } -// [i]nformation -void executor::do_information() const +// [i]nfo +void executor::do_info() const { dump_body_sizes(); dump_records(); @@ -2188,12 +2242,28 @@ void executor::do_information() const ////dump_progress(); } +// [m]enu +void executor::do_menu() const +{ + for (const auto& toggle: toggles_menu_) + logger(format("Toggle: %1%") % toggle.second); + + for (const auto& option: options_menu_) + logger(format("Option: %1%") % option.second); +} + // [t]est void executor::do_test() const { read_test(); } +// [v]ersion +void executor::do_hot_version() +{ + dump_version(); +} + // [w]ork void executor::do_report_work() { @@ -2228,12 +2298,13 @@ void executor::do_reset_store() logger(query_.is_fault() ? BN_NODE_UNRECOVERABLE : BN_NODE_OK); } -// Command line menu selection. +// Command line command selection. // ---------------------------------------------------------------------------- -bool executor::menu() +bool executor::dispatch() { const auto& config = metadata_.configured; + if (config.help) return do_help(); @@ -2252,8 +2323,8 @@ bool executor::menu() if (config.flags) return do_flags(); - if (config.initchain) - return do_initchain(); + if (config.newstore) + return do_new_store(); if (config.buckets) return do_buckets(); @@ -2261,10 +2332,10 @@ bool executor::menu() if (config.collisions) return do_collisions(); - if (config.measure) - return do_measure(); + if (config.information) + return do_information(); - if (config.read) + if (config.test) return do_read(); if (config.settings) @@ -2346,6 +2417,54 @@ void executor::subscribe_events(std::ostream& sink) }); } +void executor::subscribe_connect() +{ + node_->subscribe_connect([&](const code&, const channel::ptr&) + { + log_.write(levels::verbose) << + "{in:" << node_->inbound_channel_count() << "}" + "{ch:" << node_->channel_count() << "}" + "{rv:" << node_->reserved_count() << "}" + "{nc:" << node_->nonces_count() << "}" + "{ad:" << node_->address_count() << "}" + "{ss:" << node_->stop_subscriber_count() << "}" + "{cs:" << node_->connect_subscriber_count() << "}." + << std::endl; + + return true; + }, + [&](const code&, uintptr_t) + { + // By not handling it is possible stop could fire before complete. + // But the handler is not required for termination, so this is ok. + // The error code in the handler can be used to differentiate. + }); +} + +void executor::subscribe_close() +{ + node_->subscribe_close([&](const code&) + { + log_.write(levels::verbose) << + "{in:" << node_->inbound_channel_count() << "}" + "{ch:" << node_->channel_count() << "}" + "{rv:" << node_->reserved_count() << "}" + "{nc:" << node_->nonces_count() << "}" + "{ad:" << node_->address_count() << "}" + "{ss:" << node_->stop_subscriber_count() << "}" + "{cs:" << node_->connect_subscriber_count() << "}." + << std::endl; + + return false; + }, + [&](const code&, size_t) + { + // By not handling it is possible stop could fire before complete. + // But the handler is not required for termination, so this is ok. + // The error code in the handler can be used to differentiate. + }); +} + // Runtime menu selection. void executor::subscribe_capture() { @@ -2359,22 +2478,6 @@ void executor::subscribe_capture() if (token.empty()) return true; - if (token == "1") - { - for (const auto& option: menu_) - logger(format("Option: %1%") % option.second); - - return true; - } - - if (token == "2") - { - for (const auto& toggle: display_) - logger(format("Toggle: %1%") % toggle.second); - - return true; - } - if (toggles_.contains(token)) { const auto toggle = toggles_.at(token); @@ -2382,13 +2485,12 @@ void executor::subscribe_capture() { toggle_.at(toggle) = !toggle_.at(toggle); logger(format("CONSOLE: toggle %1% logging (%2%).") % - display_.at(toggle) % - (toggle_.at(toggle) ? "+" : "-")); + toggles_menu_.at(toggle) % (toggle_.at(toggle) ? "+" : "-")); } else { logger(format("CONSOLE: %1% logging is not compiled.") % - display_.at(toggle)); + toggles_menu_.at(toggle)); } return true; @@ -2425,7 +2527,12 @@ void executor::subscribe_capture() } case menu::info: { - do_information(); + do_info(); + return true; + } + case menu::menu_: + { + do_menu(); return true; } case menu::test: @@ -2433,6 +2540,11 @@ void executor::subscribe_capture() do_test(); return true; } + case menu::version: + { + do_hot_version(); + return true; + } case menu::work: { do_report_work(); @@ -2460,70 +2572,6 @@ void executor::subscribe_capture() }); } -void executor::subscribe_connect() -{ - node_->subscribe_connect([&](const code&, const channel::ptr&) - { - log_.write(levels::verbose) << - "{in:" << node_->inbound_channel_count() << "}" - "{ch:" << node_->channel_count() << "}" - "{rv:" << node_->reserved_count() << "}" - "{nc:" << node_->nonces_count() << "}" - "{ad:" << node_->address_count() << "}" - "{ss:" << node_->stop_subscriber_count() << "}" - "{cs:" << node_->connect_subscriber_count() << "}." - << std::endl; - - return true; - }, - [&](const code&, uintptr_t) - { - // By not handling it is possible stop could fire before complete. - // But the handler is not required for termination, so this is ok. - // The error code in the handler can be used to differentiate. - }); -} - -void executor::subscribe_close() -{ - node_->subscribe_close([&](const code&) - { - log_.write(levels::verbose) << - "{in:" << node_->inbound_channel_count() << "}" - "{ch:" << node_->channel_count() << "}" - "{rv:" << node_->reserved_count() << "}" - "{nc:" << node_->nonces_count() << "}" - "{ad:" << node_->address_count() << "}" - "{ss:" << node_->stop_subscriber_count() << "}" - "{cs:" << node_->connect_subscriber_count() << "}." - << std::endl; - - return false; - }, - [&](const code&, size_t) - { - // By not handling it is possible stop could fire before complete. - // But the handler is not required for termination, so this is ok. - // The error code in the handler can be used to differentiate. - }); -} - -void executor::dump_options() const -{ - logger(BN_NODE_INTERRUPT); - logger(BN_LOG_TABLE_HEADER); - logger(format("Application.. " BN_LOG_TABLE) % levels::application_defined % toggle_.at(levels::application)); - logger(format("News......... " BN_LOG_TABLE) % levels::news_defined % toggle_.at(levels::news)); - logger(format("Session...... " BN_LOG_TABLE) % levels::session_defined % toggle_.at(levels::session)); - logger(format("Protocol..... " BN_LOG_TABLE) % levels::protocol_defined % toggle_.at(levels::protocol)); - logger(format("ProXy........ " BN_LOG_TABLE) % levels::proxy_defined % toggle_.at(levels::proxy)); - logger(format("Remote....... " BN_LOG_TABLE) % levels::remote_defined % toggle_.at(levels::remote)); - logger(format("Fault........ " BN_LOG_TABLE) % levels::fault_defined % toggle_.at(levels::fault)); - logger(format("Quit......... " BN_LOG_TABLE) % levels::quit_defined % toggle_.at(levels::quit)); - logger(format("Object....... " BN_LOG_TABLE) % levels::objects_defined % toggle_.at(levels::objects)); - logger(format("Verbose...... " BN_LOG_TABLE) % levels::verbose_defined % toggle_.at(levels::verbose)); -} - // ---------------------------------------------------------------------------- bool executor::do_run() diff --git a/console/executor.hpp b/console/executor.hpp index cf9de9bd..24b0dab9 100644 --- a/console/executor.hpp +++ b/console/executor.hpp @@ -38,7 +38,7 @@ class executor std::ostream& error); /// Invoke the menu command indicated by the metadata. - bool menu(); + bool dispatch(); private: enum menu : uint8_t @@ -49,7 +49,9 @@ class executor go, hold, info, + menu_, test, + version, work, zeroize }; @@ -57,7 +59,6 @@ class executor using rotator_t = database::file::stream::out::rotator; void logger(const auto& message) const; - void console(const auto& message) const; void stopper(const auto& message); static void initialize_stop() NOEXCEPT; @@ -76,6 +77,7 @@ class executor void dump_progress() const; void dump_collisions() const; void dump_options() const; + void dump_version() const; // Store functions. code open_store_coded(bool details=false); @@ -83,19 +85,20 @@ class executor bool close_store(bool details=false); bool create_store(bool details=false); bool restore_store(bool details=false); - bool backup_store(bool details=false); + bool hot_backup_store(bool details=false); + bool cold_backup_store(bool details = false); bool check_store_path(bool create=false) const; // Command line options. bool do_help(); + bool do_version(); bool do_hardware(); bool do_settings(); - bool do_version(); - bool do_initchain(); + bool do_new_store(); bool do_backup(); bool do_restore(); bool do_flags(); - bool do_measure(); + bool do_information(); bool do_slabs(); bool do_buckets(); bool do_collisions(); @@ -105,14 +108,16 @@ class executor // Runtime options. void do_hot_backup(); + void do_hot_version(); void do_close(); void do_suspend(); void do_resume(); void do_reset_store(); void do_report_work(); - void do_report_condition() const; - void do_information() const; + void do_menu() const; void do_test() const; + void do_info() const; + void do_report_condition() const; void scan_flags() const; void measure_size() const; @@ -135,11 +140,11 @@ class executor // Runtime options. static const std::unordered_map options_; - static const std::unordered_map menu_; + static const std::unordered_map options_menu_; // Runtime toggles. static const std::unordered_map toggles_; - static const std::unordered_map display_; + static const std::unordered_map toggles_menu_; static const std::unordered_map defined_; // Runtime events. diff --git a/console/localize.hpp b/console/localize.hpp index 349dd730..4a6cbaa3 100644 --- a/console/localize.hpp +++ b/console/localize.hpp @@ -171,7 +171,7 @@ namespace node { #define BN_NODE_START_FAIL \ "Node failed to start with error '%1%'." #define BN_NODE_UNAVAILABLE \ - "Command not available until started." + "Command not available until node started." #define BN_NODE_BACKUP_STARTED \ "Snapshot is started." #define BN_NODE_BACKUP_FAIL \ diff --git a/console/main.cpp b/console/main.cpp index 1157fa4a..66e46542 100644 --- a/console/main.cpp +++ b/console/main.cpp @@ -109,5 +109,5 @@ int bc::system::main(int argc, char* argv[]) #endif executor host(metadata, cin, cout, cerr); - return host.menu() ? 0 : -1; + return host.dispatch() ? 0 : -1; } diff --git a/include/bitcoin/node/configuration.hpp b/include/bitcoin/node/configuration.hpp index 2b58fa47..7dc746b5 100644 --- a/include/bitcoin/node/configuration.hpp +++ b/include/bitcoin/node/configuration.hpp @@ -32,17 +32,17 @@ namespace node { #define BN_HARDWARE_VARIABLE "hardware" #define BN_SETTINGS_VARIABLE "settings" #define BN_VERSION_VARIABLE "version" -#define BN_INITCHAIN_VARIABLE "initchain" +#define BN_NEWSTORE_VARIABLE "newstore" #define BN_BACKUP_VARIABLE "backup" #define BN_RESTORE_VARIABLE "restore" #define BN_FLAGS_VARIABLE "flags" -#define BN_MEASURE_VARIABLE "measure" #define BN_SLABS_VARIABLE "slabs" #define BN_BUCKETS_VARIABLE "buckets" #define BN_COLLISIONS_VARIABLE "collisions" +#define BN_INFORMATION_VARIABLE "information" -#define BN_READ_VARIABLE "read" +#define BN_READ_VARIABLE "test" #define BN_WRITE_VARIABLE "write" // This must be lower case but the env var part can be any case. @@ -69,19 +69,19 @@ class BCN_API configuration bool version{}; /// Actions. - bool initchain{}; + bool newstore{}; bool backup{}; bool restore{}; /// Chain scans. bool flags{}; - bool measure{}; + bool information{}; bool slabs{}; bool buckets{}; bool collisions{}; /// Ad-hoc Testing. - bool read{}; + bool test{}; bool write{}; /// Settings. diff --git a/include/bitcoin/node/settings.hpp b/include/bitcoin/node/settings.hpp index 6d001f68..3d95f3a6 100644 --- a/include/bitcoin/node/settings.hpp +++ b/include/bitcoin/node/settings.hpp @@ -42,7 +42,7 @@ class BCN_API settings bool proxy; bool remote; bool fault; - bool quit; + bool quitting; bool objects; bool verbose; diff --git a/src/parser.cpp b/src/parser.cpp index 25b9c10b..28647f0c 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -164,10 +164,10 @@ options_metadata parser::load_options() THROWS ) // Actions. ( - BN_INITCHAIN_VARIABLE ",i", - value(&configured.initchain)-> + BN_NEWSTORE_VARIABLE ",n", + value(&configured.newstore)-> default_value(false)->zero_tokens(), - "Initialize store in configured directory." + "Create new store in configured directory." ) ( BN_BACKUP_VARIABLE ",b", @@ -176,7 +176,7 @@ options_metadata parser::load_options() THROWS "Backup to a snapshot (can also do live)." ) ( - BN_RESTORE_VARIABLE ",x", + BN_RESTORE_VARIABLE ",r", value(&configured.restore)-> default_value(false)->zero_tokens(), "Restore from most recent snapshot." @@ -188,12 +188,6 @@ options_metadata parser::load_options() THROWS default_value(false)->zero_tokens(), "Scan and display all flag transitions." ) - ( - BN_MEASURE_VARIABLE ",m", - value(&configured.measure)-> - default_value(false)->zero_tokens(), - "Scan and display store measures." - ) ( BN_SLABS_VARIABLE ",a", value(&configured.slabs)-> @@ -212,18 +206,24 @@ options_metadata parser::load_options() THROWS default_value(false)->zero_tokens(), "Scan and display hashmap collision stats." ) + ( + BN_INFORMATION_VARIABLE ",i", + value(&configured.information)-> + default_value(false)->zero_tokens(), + "Scan and display store information." + ) // Ad-hoc Testing. ( - BN_READ_VARIABLE ",r", - value(&configured.read)-> + BN_READ_VARIABLE ",t", + value(&configured.test)-> default_value(false)->zero_tokens(), - "Read test and display performance." + "Run built-in read test and display." ) ( BN_WRITE_VARIABLE ",w", value(&configured.write)-> default_value(false)->zero_tokens(), - "Write test and display performance." + "Run built-in write test and display." ); return description; @@ -987,9 +987,9 @@ options_metadata parser::load_settings() THROWS #endif #if defined(HAVE_LOGQ) ( - "log.quit", - value(&configured.log.quit), - "Enable quit logging, defaults to false." + "log.quitting", + value(&configured.log.quitting), + "Enable quitting logging, defaults to false." ) #endif #if defined(HAVE_LOGO) diff --git a/src/settings.cpp b/src/settings.cpp index a2b49bcd..76749499 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -37,7 +37,7 @@ settings::settings() NOEXCEPT proxy{ false /*levels::proxy_defined*/ }, remote{ levels::remote_defined }, fault{ levels::fault_defined }, - quit{ false /*levels::quit_defined*/ }, + quitting{ false /*levels::quitting_defined*/ }, objects{ false /*levels::objects_defined*/ }, verbose{ false /*levels::verbose_defined*/ }, maximum_size{ 1'000'000_u32 } diff --git a/test/configuration.cpp b/test/configuration.cpp index 6e847adb..1bf95de5 100644 --- a/test/configuration.cpp +++ b/test/configuration.cpp @@ -26,20 +26,21 @@ BOOST_AUTO_TEST_SUITE(configuration_tests) BOOST_AUTO_TEST_CASE(configuration__construct1__none_context__expected) { const node::configuration instance(chain::selection::none); + BOOST_REQUIRE(instance.file.empty()); BOOST_REQUIRE(!instance.help); BOOST_REQUIRE(!instance.hardware); BOOST_REQUIRE(!instance.settings); BOOST_REQUIRE(!instance.version); - BOOST_REQUIRE(!instance.initchain); + BOOST_REQUIRE(!instance.newstore); BOOST_REQUIRE(!instance.backup); BOOST_REQUIRE(!instance.restore); BOOST_REQUIRE(!instance.flags); - BOOST_REQUIRE(!instance.measure); + BOOST_REQUIRE(!instance.information); BOOST_REQUIRE(!instance.slabs); BOOST_REQUIRE(!instance.buckets); BOOST_REQUIRE(!instance.collisions); - BOOST_REQUIRE(!instance.read); + BOOST_REQUIRE(!instance.test); BOOST_REQUIRE(!instance.write); BOOST_REQUIRE_EQUAL(instance.log.application, levels::application_defined); @@ -49,18 +50,18 @@ BOOST_AUTO_TEST_CASE(configuration__construct1__none_context__expected) BOOST_REQUIRE_EQUAL(instance.log.proxy, false /*levels::proxy_defined*/); BOOST_REQUIRE_EQUAL(instance.log.remote, levels::remote_defined); BOOST_REQUIRE_EQUAL(instance.log.fault, levels::fault_defined); - BOOST_REQUIRE_EQUAL(instance.log.quit, false /*levels::quit_defined*/); + BOOST_REQUIRE_EQUAL(instance.log.quitting, false /*levels::quitting_defined*/); BOOST_REQUIRE_EQUAL(instance.log.objects, false /*levels::objects_defined*/); BOOST_REQUIRE_EQUAL(instance.log.verbose, false /*levels::verbose_defined*/); BOOST_REQUIRE_EQUAL(instance.log.maximum_size, 1'000'000_u32); + BOOST_REQUIRE_EQUAL(instance.log.log_file1(), "bn_end.log"); + BOOST_REQUIRE_EQUAL(instance.log.log_file2(), "bn_begin.log"); + BOOST_REQUIRE_EQUAL(instance.log.events_file(), "events.log"); BOOST_REQUIRE_EQUAL(instance.log.path, ""); #if defined(HAVE_MSC) BOOST_REQUIRE_EQUAL(instance.log.symbols, ""); #endif - BOOST_REQUIRE_EQUAL(instance.log.log_file1(), "bn_end.log"); - BOOST_REQUIRE_EQUAL(instance.log.log_file2(), "bn_begin.log"); - BOOST_REQUIRE_EQUAL(instance.log.events_file(), "events.log"); } BOOST_AUTO_TEST_SUITE_END() diff --git a/test/settings.cpp b/test/settings.cpp index 47410cbd..8f1905be 100644 --- a/test/settings.cpp +++ b/test/settings.cpp @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE(settings__log__default_context__expected) BOOST_REQUIRE_EQUAL(log.proxy, false /*levels::proxy_defined*/); BOOST_REQUIRE_EQUAL(log.remote, levels::remote_defined); BOOST_REQUIRE_EQUAL(log.fault, levels::fault_defined); - BOOST_REQUIRE_EQUAL(log.quit, false /*levels::quit_defined*/); + BOOST_REQUIRE_EQUAL(log.quitting, false /*levels::quitting_defined*/); BOOST_REQUIRE_EQUAL(log.objects, false /*levels::objects_defined*/); BOOST_REQUIRE_EQUAL(log.verbose, false /*levels::verbose_defined*/); BOOST_REQUIRE_EQUAL(log.maximum_size, 1'000'000_u32);