]> granicus.if.org Git - vnstat/commitdiff
modify testscase to bypass possible test framework limitations and fix test errors...
authorTeemu Toivola <git@humdi.net>
Sat, 10 Dec 2016 15:01:19 +0000 (17:01 +0200)
committerTeemu Toivola <git@humdi.net>
Sat, 10 Dec 2016 15:01:19 +0000 (17:01 +0200)
tests/misc_tests.c

index c35a72d23b8fe8d9c4ef9fac318e24251fa6ac7b..7815bdf100971f963bf89dd769cd998fe12e85f2 100644 (file)
@@ -37,12 +37,14 @@ END_TEST
 START_TEST(getunitdivisor_returns_something_with_all_cfg_combinations)
 {
        int j;
+       char div[16];
 
        for (j=1; j<=(UNITPREFIXCOUNT+1); j++) {
+               snprintf(div, 15, "%"PRIu64"", getunitdivisor(_i, j));
                if (j>UNITPREFIXCOUNT) {
-                       ck_assert_int_eq(getunitdivisor(_i, j), 0);
+                       ck_assert_str_eq(div, "0");
                } else {
-                       ck_assert_int_ne(getunitdivisor(_i, j), 0);
+                       ck_assert_str_ne(div, "0");
                }
        }
 }