move-only: Detail_CheckNumFormatSpecifiers and G_TRANSLATION_FUN

This is required for a future commit. Can be reviewed via the git
options --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space

Also move util::detail::Hex to a proper namespace instead of an inline
namespace so it doesn't conflict with the new util::detail namespace, and
won't create other problems for callers trying to use the inline namespaces.

Also fix a misleading comment in util_string_tests.cpp.

Co-Authored-By: Ryan Ofsky <ryan@ofsky.org>
This commit is contained in:
MarcoFalke
2024-10-09 11:42:44 +02:00
parent faff8403f0
commit fa72646f2b
4 changed files with 88 additions and 85 deletions

View File

@@ -16,13 +16,13 @@ BOOST_AUTO_TEST_SUITE(util_string_tests)
template <unsigned NumArgs>
inline void PassFmt(util::ConstevalFormatString<NumArgs> fmt)
{
// This was already executed at compile-time, but is executed again at run-time to avoid -Wunused.
decltype(fmt)::Detail_CheckNumFormatSpecifiers(fmt.fmt);
// Execute compile-time check again at run-time to get code coverage stats
util::detail::CheckNumFormatSpecifiers<NumArgs>(fmt.fmt);
}
template <unsigned WrongNumArgs>
inline void FailFmtWithError(const char* wrong_fmt, std::string_view error)
{
BOOST_CHECK_EXCEPTION(util::ConstevalFormatString<WrongNumArgs>::Detail_CheckNumFormatSpecifiers(wrong_fmt), const char*, HasReason(error));
BOOST_CHECK_EXCEPTION(util::detail::CheckNumFormatSpecifiers<WrongNumArgs>(wrong_fmt), const char*, HasReason{error});
}
BOOST_AUTO_TEST_CASE(ConstevalFormatString_NumSpec)