mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-28 02:00:59 -06:00
Use throw std::runtime_error() instead of std::abort() in test
This commit is contained in:
parent
b81faa9221
commit
f28cfec56b
@ -50,20 +50,20 @@
|
||||
#define CHECK(value, expected) \
|
||||
{ \
|
||||
if ((value) != (expected)) \
|
||||
std::abort(); \
|
||||
throw std::runtime_error("Test failed: " + std::to_string(value) + " != " + std::to_string(expected)); \
|
||||
}
|
||||
|
||||
#define CHECK_CLOSE(value, expected, reltol) \
|
||||
{ \
|
||||
if (std::fabs((expected) - (value)) > 1e-14 && \
|
||||
std::fabs(((expected) - (value))/((expected) + (value))) > reltol) \
|
||||
std::abort(); \
|
||||
throw std::runtime_error("Test failed: " + std::to_string(value) + " != " + std::to_string(expected)); \
|
||||
}
|
||||
|
||||
#define REQUIRE(cond) \
|
||||
{ \
|
||||
if (!(cond)) \
|
||||
std::abort(); \
|
||||
throw std::runtime_error("Test condition failed"); \
|
||||
}
|
||||
|
||||
BEGIN_PROPERTIES
|
||||
|
Loading…
Reference in New Issue
Block a user