diff options
author | Yang Tse <yangsita@gmail.com> | 2011-11-24 18:18:42 +0100 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2011-11-24 18:18:42 +0100 |
commit | c482e946f7ae003ce54ee05b5cca6d6ce8172f14 (patch) | |
tree | 9b6b9e6c28b7d0d3e85f2f0a470e5db6f6e46bbb /tests | |
parent | 46bd8b330ac2d8acf0a648a6c4fdfd0f25a4b75e (diff) |
lib573.c: fix double data type variable comparison with zero
Diffstat (limited to 'tests')
-rw-r--r-- | tests/libtest/lib573.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/libtest/lib573.c b/tests/libtest/lib573.c index 943f6e8c8..50aedfa6c 100644 --- a/tests/libtest/lib573.c +++ b/tests/libtest/lib573.c @@ -38,6 +38,12 @@ int test(char *URL) int res = 0; int running = 1; double connect_time = 0.0; + double dbl_epsilon; + + dbl_epsilon = 1.0; + do { + dbl_epsilon /= 2.0; + } while ((double)(1.0 + (dbl_epsilon/2.0)) > (double)1.0); start_test_timing(); @@ -81,8 +87,8 @@ int test(char *URL) } curl_easy_getinfo(c, CURLINFO_CONNECT_TIME, &connect_time); - if (connect_time <= 0.0) { - fprintf(stderr, "connect time is <=0.0\n"); + if (connect_time < dbl_epsilon) { + fprintf(stderr, "connect time is < epsilon\n"); res = TEST_ERR_MAJOR_BAD; } |