10USERVER_NAMESPACE_BEGIN
12namespace utest::
impl {
14template <
typename ExceptionType>
15bool IsSubtype(
const std::exception& ex)
noexcept {
17 std::is_base_of_v<std::exception, ExceptionType>,
18 "Exception types not inherited from std::exception are not supported");
19 if constexpr (std::is_same_v<ExceptionType, std::exception>) {
22 return dynamic_cast<
const ExceptionType*>(&ex) !=
nullptr;
26std::string AssertThrow(std::function<
void()> statement,
27 std::string_view statement_text,
28 std::function<
bool(
const std::exception&)> type_checker,
29 const std::type_info& expected_type,
30 std::string_view message_substring);
32std::string AssertNoThrow(std::function<
void()> statement,
33 std::string_view statement_text);