summaryrefslogtreecommitdiff
path: root/src/test/test_util.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@ev0ke.net>2015-02-12 11:36:35 -0500
committerteor <teor2345@gmail.com>2015-05-06 18:05:15 +1000
commitdcf0f808c0bd9b20a0a7d4f3e52155a83cdce2a4 (patch)
tree3ba1d7fd9d61525364dbc4896649559539f9f89b /src/test/test_util.c
parentaecc354ee77f2e94d084c4e5bd19b57125db9e07 (diff)
downloadtor-dcf0f808c0bd9b20a0a7d4f3e52155a83cdce2a4.tar.gz
tor-dcf0f808c0bd9b20a0a7d4f3e52155a83cdce2a4.zip
Test: change INT64_MAX to DBL_MAX in laplace test
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r--src/test/test_util.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 21737f6e13..2f05ce8522 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -19,6 +19,7 @@
#endif
#include <math.h>
#include <ctype.h>
+#include <values.h>
/* XXXX this is a minimal wrapper to make the unit tests compile with the
* changed tor_timegm interface. */
@@ -4156,10 +4157,10 @@ test_util_laplace(void *arg)
add_laplace_noise(0, 0.0, delta_f, epsilon));
tt_assert(INT64_MIN ==
add_laplace_noise(0, 0.0,
- INT64_MAX, 1));
+ DBL_MAX, 1));
tt_assert(INT64_MIN ==
add_laplace_noise(INT64_MIN, 0.0,
- INT64_MAX, 1));
+ DBL_MAX, 1));
/* does it play nice with INT64_MAX? */
tt_assert((INT64_MIN + INT64_MAX) ==
@@ -4180,13 +4181,13 @@ test_util_laplace(void *arg)
noscale_df, noscale_eps));
tt_assert(INT64_MIN ==
add_laplace_noise(0, min_dbl_error,
- INT64_MAX, 1));
+ DBL_MAX, 1));
tt_assert((INT64_MAX + INT64_MIN) ==
add_laplace_noise(INT64_MAX, min_dbl_error,
- INT64_MAX, 1));
+ DBL_MAX, 1));
tt_assert(INT64_MIN ==
add_laplace_noise(INT64_MIN, min_dbl_error,
- INT64_MAX, 1));
+ DBL_MAX, 1));
/* does it play nice with INT64_MAX? */
tt_assert((INT64_MAX - 35) ==
@@ -4223,10 +4224,10 @@ test_util_laplace(void *arg)
delta_f, epsilon));
tt_assert((INT64_MIN + INT64_MAX) ==
add_laplace_noise(INT64_MIN, max_dbl_lt_one,
- INT64_MAX, 1));
+ DBL_MAX, 1));
tt_assert(INT64_MAX ==
add_laplace_noise(INT64_MAX, max_dbl_lt_one,
- INT64_MAX, 1));
+ DBL_MAX, 1));
/* does it play nice with INT64_MIN? */
tt_assert((INT64_MIN + 35) ==
add_laplace_noise(INT64_MIN, max_dbl_lt_one,