Skip to content

Commit

Permalink
chore: apply code style on adapter-headers
Browse files Browse the repository at this point in the history
  • Loading branch information
DNKpp committed Feb 3, 2025
1 parent 96312ce commit 1a18152
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
13 changes: 5 additions & 8 deletions include/mimic++/adapters/BoostTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,20 @@ namespace mimicpp::reporting::detail::boost_test
};

[[noreturn]]
inline void send_fail(const StringViewT msg)
inline void send_fail(StringViewT const msg)
{
BOOST_TEST_FAIL(msg);
unreachable();
}

inline void send_success(const StringViewT msg)
inline void send_success(StringViewT const msg)
{
BOOST_TEST_MESSAGE(msg);
}

inline void send_warning(const StringViewT msg)
inline void send_warning(StringViewT const msg)
{
BOOST_TEST_MESSAGE(
format::format(
"warning: {}",
msg));
BOOST_TEST_MESSAGE("warning: ") << msg.data();
}
}

Expand All @@ -72,7 +69,7 @@ namespace mimicpp::reporting
namespace mimicpp::reporting::detail::boost_test
{
[[maybe_unused]]
inline const ReporterInstaller<BoostTestReporterT> installer{};
inline ReporterInstaller<BoostTestReporterT> const installer{};
}

#endif
6 changes: 3 additions & 3 deletions include/mimic++/adapters/Catch2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
namespace mimicpp::reporting::detail::catch2
{
[[noreturn]]
inline void send_fail(const StringViewT msg)
inline void send_fail(StringViewT const msg)
{
#ifdef CATCH_CONFIG_PREFIX_ALL
CATCH_FAIL(msg);
Expand All @@ -36,7 +36,7 @@ namespace mimicpp::reporting::detail::catch2
unreachable();
}

inline void send_success(const StringViewT msg)
inline void send_success(StringViewT const msg)
{
#ifdef CATCH_CONFIG_PREFIX_ALL
CATCH_SUCCEED(msg);
Expand All @@ -45,7 +45,7 @@ namespace mimicpp::reporting::detail::catch2
#endif
}

inline void send_warning(const StringViewT msg)
inline void send_warning(StringViewT const msg)
{
#ifdef CATCH_CONFIG_PREFIX_MESSAGES
CATCH_WARN(msg);
Expand Down
8 changes: 4 additions & 4 deletions include/mimic++/adapters/Doctest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ namespace mimicpp::reporting::detail::doctest
using namespace ::doctest;

[[noreturn]]
inline void send_fail(const StringViewT msg)
inline void send_fail(StringViewT const msg)
{
DOCTEST_FAIL(msg);
unreachable();
}

inline void send_success(const StringViewT msg)
inline void send_success(StringViewT const msg)
{
DOCTEST_REQUIRE_MESSAGE(true, msg);
}

inline void send_warning(const StringViewT msg)
inline void send_warning(StringViewT const msg)
{
DOCTEST_MESSAGE(msg);
}
Expand Down Expand Up @@ -67,7 +67,7 @@ namespace mimicpp::reporting
namespace mimicpp::reporting::detail::doctest
{
[[maybe_unused]]
inline const ReporterInstaller<DoctestReporterT> installer{};
inline ReporterInstaller<DoctestReporterT> const installer{};
}

#endif
8 changes: 4 additions & 4 deletions include/mimic++/adapters/gtest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace mimicpp::reporting::detail::gtest
};

[[noreturn]]
inline void send_fail(const StringViewT& msg)
inline void send_fail(StringViewT const msg)
{
// GTEST_FAIL has an immediate return
std::invoke(
Expand All @@ -39,12 +39,12 @@ namespace mimicpp::reporting::detail::gtest
throw failure{};
}

inline void send_success(const StringViewT& msg)
inline void send_success(StringViewT const msg)
{
GTEST_SUCCEED() << msg;
}

inline void send_warning([[maybe_unused]] const StringViewT& msg)
inline void send_warning([[maybe_unused]] StringViewT const msg)
{
// seems unsupported
}
Expand Down Expand Up @@ -73,7 +73,7 @@ namespace mimicpp::reporting
namespace mimicpp::reporting::detail::gtest
{
[[maybe_unused]]
inline const ReporterInstaller<GTestReporterT> installer{};
inline ReporterInstaller<GTestReporterT> const installer{};
}

#endif

0 comments on commit 1a18152

Please sign in to comment.