From fa1c303eeec58ca02aef82a31d750bd2fdccc091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Thu, 25 Jan 2024 23:16:28 +0100 Subject: [PATCH] Update enum tests --- nano/core_test/enums.cpp | 18 ++++++++++++++++++ nano/lib/logging_enums.hpp | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/nano/core_test/enums.cpp b/nano/core_test/enums.cpp index ae60532ed2..a6dc3c8a77 100644 --- a/nano/core_test/enums.cpp +++ b/nano/core_test/enums.cpp @@ -20,4 +20,22 @@ TEST (enums, stat_dir) { ASSERT_FALSE (nano::to_string (static_cast (0)).empty ()); ASSERT_FALSE (nano::to_string (nano::stat::dir::_last).empty ()); +} + +TEST (enums, log_type) +{ + ASSERT_FALSE (nano::log::to_string (static_cast (0)).empty ()); + ASSERT_FALSE (nano::log::to_string (nano::log::type::_last).empty ()); +} + +TEST (enums, log_detail) +{ + ASSERT_FALSE (nano::log::to_string (static_cast (0)).empty ()); + ASSERT_FALSE (nano::log::to_string (nano::log::detail::_last).empty ()); +} + +TEST (enums, log_category) +{ + ASSERT_FALSE (nano::log::to_string (static_cast (0)).empty ()); + ASSERT_FALSE (nano::log::to_string (nano::log::type::_last).empty ()); } \ No newline at end of file diff --git a/nano/lib/logging_enums.hpp b/nano/lib/logging_enums.hpp index 9effd61474..af2ebfda84 100644 --- a/nano/lib/logging_enums.hpp +++ b/nano/lib/logging_enums.hpp @@ -76,6 +76,8 @@ enum class type bootstrap, bootstrap_lazy, bootstrap_legacy, + + _last // Must be the last enum }; enum class detail @@ -112,6 +114,7 @@ enum class detail requesting_account_or_head, requesting_pending, + _last // Must be the last enum }; // TODO: Additionally categorize logs by categories which can be enabled/disabled independently @@ -121,6 +124,8 @@ enum class category work_generation, // ... + + _last // Must be the last enum }; }