diff options
author | Alfred E. Heggestad <aeh@db.org> | 2016-03-21 22:13:04 +0100 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2016-03-21 22:13:04 +0100 |
commit | 5860fdb9a9b26e37852520d4598749f65f893bb5 (patch) | |
tree | 2fbc7a6ec5ccde2d49c3ea79106880126a1de7ed /test/test.h | |
parent | ffe31320d624f61afc536570853538c9df227254 (diff) |
mos: add pseudo Mean Opinion Score routine
thanks to Lorenzo Mangani for the original patch
Diffstat (limited to 'test/test.h')
-rw-r--r-- | test/test.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test.h b/test/test.h index 4a91d28..20ccdcd 100644 --- a/test/test.h +++ b/test/test.h @@ -23,6 +23,16 @@ goto out; \ } +#define ASSERT_DOUBLE_EQ(expected, actual, prec) \ + if (!test_cmp_double((expected), (actual), (prec))) { \ + warning("selftest: ASSERT_DOUBLE_EQ: %s:%u:" \ + " expected=%f, actual=%f\n", \ + __FILE__, __LINE__, \ + (double)(expected), (double)(actual)); \ + err = EINVAL; \ + goto out; \ + } + #define ASSERT_STREQ(expected, actual) \ if (0 != str_cmp((expected), (actual))) { \ warning("selftest: ASSERT_STREQ: %s:%u:" \ @@ -47,6 +57,7 @@ /* helpers */ int re_main_timeout(uint32_t timeout_ms); +bool test_cmp_double(double a, double b, double precision); #ifdef USE_TLS @@ -78,6 +89,7 @@ int test_cmd(void); int test_ua_alloc(void); int test_uag_find_param(void); int test_ua_register(void); +int test_mos(void); int test_call_answer(void); int test_call_reject(void); |