diff options
author | René Korthaus <[email protected]> | 2016-03-06 22:13:45 +0100 |
---|---|---|
committer | René Korthaus <[email protected]> | 2016-03-25 20:37:28 +0100 |
commit | 4835852dec10d3882fd193ee686993571b92210b (patch) | |
tree | 15aee6e274689dfb53204127608bab5f7f6f749d /src/tests/tests.cpp | |
parent | 858cf5c82260e45e5bf51ff17b63f493d8295356 (diff) |
Add more tests for ffi
Diffstat (limited to 'src/tests/tests.cpp')
-rw-r--r-- | src/tests/tests.cpp | 14 |
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) |