Unverified Commit 95b45696 authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #1510

Return the result from check functions
parents 7b96836a 16dba433
......@@ -39,12 +39,13 @@ void runnable::run() {
}
}
void runnable::check(bool value, const detail::source_location& location) {
bool runnable::check(bool value, const detail::source_location& location) {
if (value) {
reporter::instance->pass(location);
return;
}
} else {
reporter::instance->fail("should be true", location);
}
return value;
}
block& runnable::current_block() {
......
......@@ -55,7 +55,7 @@ public:
/// Checks whether `lhs` and `rhs` are equal.
template <class T0, class T1>
void check_eq(const T0& lhs, const T1& rhs,
bool check_eq(const T0& lhs, const T1& rhs,
const detail::source_location& location
= detail::source_location::current()) {
if (std::is_integral_v<T0> && std::is_integral_v<T1>) {
......@@ -64,13 +64,14 @@ public:
}
if (lhs == rhs) {
reporter::instance->pass(location);
return;
return true;
}
reporter::instance->fail(binary_predicate::eq, stringify(lhs),
stringify(rhs), location);
return false;
}
void check(bool value, const detail::source_location& location
bool check(bool value, const detail::source_location& location
= detail::source_location::current());
block& current_block();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment