spdlog icon indicating copy to clipboard operation
spdlog copied to clipboard

spdlog-utests do not respect defined SPDLOG_LEVEL_NAMES in the tweakme.h

Open yalov opened this issue 3 months ago • 1 comments

level_to_string_view
-------------------------------------------------------------------------------
spdlog\tests\test_misc.cpp(46)
...............................................................................

spdlog\tests\test_misc.cpp(47): FAILED:
  REQUIRE( spdlog::level::to_string_view(spdlog::level::trace) == "trace" )
with expansion:
  "TRC" == "trace"

yalov avatar Sep 16 '25 11:09 yalov

Thank you for the report. It's surprising that no one noticed this issue.

As a unit test, I believe it should not be affected by tweakme.h. Could you please verify if the test passes after adding #undef SPDLOG_LEVEL_NAMES and #undef SPDLOG_SHORT_LEVEL_NAMES after #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG in tests/includes.h? If you can fix the test, we would appreciate it if you could submit a PR.

https://github.com/gabime/spdlog/blob/f1d748e5e3edfa4b1778edea003bac94781bc7b7/tests/includes.h#L24

 #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG
 
+#undef SPDLOG_LEVEL_NAMES
+#undef SPDLOG_SHORT_LEVEL_NAMES 

tt4g avatar Sep 16 '25 12:09 tt4g