mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user