summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-09-25 19:05:42 -0700
committerGary E. Miller <gem@rellim.com>2018-09-25 19:05:42 -0700
commita7db680757a23f6d1e9180cc97f0791de3895f0c (patch)
tree1437d32630708c28bfb78d8f8f7d2b3ef89517fd
parentde395192de8133ca1552c37378e62d46ee1f99b8 (diff)
downloadgpsd-a7db680757a23f6d1e9180cc97f0791de3895f0c.tar.gz
test_timespec.c: ex_subtract_float() never returned failure.
Found by cppcheck.
-rw-r--r--test_timespec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/test_timespec.c b/test_timespec.c
index 80644684..00b6c8b4 100644
--- a/test_timespec.c
+++ b/test_timespec.c
@@ -370,21 +370,27 @@ static int ex_subtract_float( void )
/* test strings */
if ( strcmp( buf_r, buf_c) ) {
fail_ts = "FAIL";
+ fail_count++;
}
if ( strcmp( buf_l, buf_c) ) {
fail_l = "FAIL";
+ fail_count++;
}
if ( strcmp( buf_l32, buf_c) ) {
fail_l32 = "FAIL";
+ fail_count++;
}
if ( strcmp( buf_l64, buf_c) ) {
fail_l64 = "FAIL";
+ fail_count++;
}
if ( strcmp( buf_f, buf_c) ) {
fail_f = "FAIL";
+ fail_count++;
}
if ( strcmp( buf_d, buf_c) ) {
fail_d = "FAIL";
+ fail_count++;
}
printf("ts: %21s - %21s = %21s %s\n"
"l; %21s - %21s = %21lld %s\n"
@@ -408,9 +414,9 @@ static int ex_subtract_float( void )
};
if ( fail_count ) {
- // printf("subtract test failed %d tests\n", fail_count );
+ printf("subtract test failed %d tests\n", fail_count );
} else {
- // puts("subtract test succeeded\n");
+ puts("subtract test succeeded\n");
}
return fail_count;
}