forked from arc/libarc-validate
72 lines
2.0 KiB
C++
72 lines
2.0 KiB
C++
#ifndef arc__validate__asserts_hxx_
|
|
#define arc__validate__asserts_hxx_
|
|
|
|
#include <arc/validate/except.hxx>
|
|
|
|
#include <source_location>
|
|
#include <string>
|
|
|
|
#define ARC_VALIDATE_ASSERT_TRUE(expr) \
|
|
::arc::validate::asserts::assert_true(expr)
|
|
|
|
namespace arc::validate::asserts
|
|
{
|
|
|
|
template<typename T>
|
|
void
|
|
assert_true(T const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename T>
|
|
void
|
|
assert_false(T const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename T>
|
|
void
|
|
assert_nullptr(T const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename T>
|
|
void
|
|
assert_not_nullptr(T const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename L, typename R>
|
|
void
|
|
assert_equal(L const&, R const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename L, typename R>
|
|
void
|
|
assert_not_equal(L const&, R const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename L, typename R>
|
|
void
|
|
assert_less_than(L const&, R const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename L, typename R>
|
|
void
|
|
assert_less_than_or_equal(L const&, R const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename L, typename R>
|
|
void
|
|
assert_greater_than(L const&, R const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename L, typename R>
|
|
void
|
|
assert_greater_than_or_equal(L const&, R const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename E, typename F>
|
|
void
|
|
assert_throws(F const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename F>
|
|
void
|
|
assert_throws_any(F const&, std::source_location = std::source_location::current());
|
|
|
|
template<typename F>
|
|
void
|
|
assert_does_not_throw(F const&, std::source_location = std::source_location::current());
|
|
|
|
} // namespace arc::validate::asserts
|
|
|
|
#include <arc/validate/asserts.txx>
|
|
|
|
#endif
|