micro-test-plus 6.0.1
µTest++ Testing Framework
Loading...
Searching...
No Matches
exceptions.h File Reference

C++ header file with declarations for the µTest++ exception-checking functions. More...

#include "detail.h"
#include "inlines/exceptions-inlines.h"

Go to the source code of this file.

Namespaces

namespace  micro_os_plus
 The primary namespace for the µOS++ framework.
namespace  micro_os_plus::micro_test_plus
 Primary namespace for the µTest++ testing framework.

Functions

template<class Callable_T>
requires std::invocable<Callable_T&>
auto micro_os_plus::micro_test_plus::nothrow (Callable_T &&func)
 Checks whether a callable does not throw any exception, for expect() or require().
template<class Callable_T>
requires std::invocable<Callable_T&>
auto micro_os_plus::micro_test_plus::throws (Callable_T &&func)
 Checks whether a callable throws any exception, for expect() or require().
template<class Exception_T, class Callable_T>
requires std::invocable<Callable_T&>
auto micro_os_plus::micro_test_plus::throws (Callable_T &&func)
 Checks whether a callable throws a specific exception, for expect() or require().

Detailed Description

This header provides the declarations for the exception-checking facilities of the µTest++ framework. It exposes three function templates — throws<Exception_T>(), throws(), and nothrow() — which allow test cases to verify that a callable throws a specific exception, throws any exception, or throws no exception, respectively.

All declarations are conditionally compiled under __cpp_exceptions and reside within the micro_os_plus::micro_test_plus namespace.

This file is included by micro-os-plus/micro-test-plus.h, which is the header that the applications include.

Definition in file exceptions.h.