aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/tests.cpp')
-rw-r--r--src/tests/tests.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp
index 6d419310b..a79e05aba 100644
--- a/src/tests/tests.cpp
+++ b/src/tests/tests.cpp
@@ -282,6 +282,20 @@ bool Test::Result::test_rc_fail(const std::string& func, const std::string& why,
return test_success();
}
+bool Test::Result::test_rc(const std::string& func, int expected, int rc)
+ {
+ if(expected != rc)
+ {
+ std::ostringstream err;
+ err << m_who;
+ err << " call to " << func << " unexpectedly returned " << rc;
+ err << " but expecting " << expected;
+ return test_failure(err.str());
+ }
+
+ return test_success();
+ }
+
namespace {
std::string format_time(uint64_t ns)