added location to ASSERT()
This commit is contained in:
parent
dadebf0a4b
commit
00874526f5
|
|
@ -30,7 +30,7 @@ constexpr auto make_copy(auto& value) -> std::remove_cvref_t<decltype(value)> {
|
|||
#define TEST_SKIP(...) _ret_val_from_ctx<__VA_ARGS__>(ReturnCode::SKIPPED)
|
||||
#define TEST_SKIP_MSG(msg, ...) _ret_val_from_ctx<__VA_ARGS__>(ReturnCode::SKIPPED, msg)
|
||||
|
||||
#define ASSERT(condition, ...) ASSERT_MSG((condition), nullptr, __VA_ARGS__)
|
||||
#define ASSERT(condition, ...) ASSERT_MSG((condition), "Condition (" #condition ") evaluated to false" _LOCATION, __VA_ARGS__)
|
||||
#define ASSERT_MSG(condition, msg, ...) { if (!(condition)) return _ret_val_from_ctx<__VA_ARGS__>(ReturnCode::FAILED, msg); } static_assert(true, "")
|
||||
#define ASSERT_THROWS(operation, exception_type, ...) if not consteval { try { operation; ASSERT_MSG(false, #operation " did not throw " #exception_type _LOCATION, __VA_ARGS__); } catch (exception_type &e) {} } static_assert(true, "")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue