[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] unittests: use tt_i64_op() instead of tt_int_op() in laplace tests.



commit 354ddf87126b60e9113bb14ded46280191478fec
Author: George Kadianakis <desnacked@xxxxxxxxxx>
Date:   Thu Jan 15 15:14:33 2015 +0000

    unittests: use tt_i64_op() instead of tt_int_op() in laplace tests.
---
 src/test/test_util.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/test/test_util.c b/src/test/test_util.c
index 0d45a0b..4039a09 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -4654,25 +4654,25 @@ test_util_laplace(void *arg)
   const double delta_f = 15.0, epsilon = 0.3; /* b = 15.0 / 0.3 = 50.0 */
   (void)arg;
 
-  tt_int_op(INT64_MIN, ==, sample_laplace_distribution(mu, b, 0.0));
-  tt_int_op(-69, ==, sample_laplace_distribution(mu, b, 0.01));
-  tt_int_op(24, ==, sample_laplace_distribution(mu, b, 0.5));
-  tt_int_op(24, ==, sample_laplace_distribution(mu, b, 0.51));
-  tt_int_op(117, ==, sample_laplace_distribution(mu, b, 0.99));
+  tt_i64_op(INT64_MIN, ==, sample_laplace_distribution(mu, b, 0.0));
+  tt_i64_op(-69, ==, sample_laplace_distribution(mu, b, 0.01));
+  tt_i64_op(24, ==, sample_laplace_distribution(mu, b, 0.5));
+  tt_i64_op(24, ==, sample_laplace_distribution(mu, b, 0.51));
+  tt_i64_op(117, ==, sample_laplace_distribution(mu, b, 0.99));
 
   /* >>> laplace.ppf([0.0, 0.1, 0.25, 0.5, 0.75, 0.9, 0.99],
    * ...             loc = 0, scale = 50)
    * array([         -inf,  -80.47189562,  -34.65735903,    0.        ,
    *          34.65735903,   80.47189562,  195.60115027])
    */
-  tt_int_op(INT64_MIN + 20, ==,
+  tt_i64_op(INT64_MIN + 20, ==,
             add_laplace_noise(20, 0.0, delta_f, epsilon));
-  tt_int_op(-60, ==, add_laplace_noise(20, 0.1, delta_f, epsilon));
-  tt_int_op(-14, ==, add_laplace_noise(20, 0.25, delta_f, epsilon));
-  tt_int_op(20, ==, add_laplace_noise(20, 0.5, delta_f, epsilon));
-  tt_int_op(54, ==, add_laplace_noise(20, 0.75, delta_f, epsilon));
-  tt_int_op(100, ==, add_laplace_noise(20, 0.9, delta_f, epsilon));
-  tt_int_op(215, ==, add_laplace_noise(20, 0.99, delta_f, epsilon));
+  tt_i64_op(-60, ==, add_laplace_noise(20, 0.1, delta_f, epsilon));
+  tt_i64_op(-14, ==, add_laplace_noise(20, 0.25, delta_f, epsilon));
+  tt_i64_op(20, ==, add_laplace_noise(20, 0.5, delta_f, epsilon));
+  tt_i64_op(54, ==, add_laplace_noise(20, 0.75, delta_f, epsilon));
+  tt_i64_op(100, ==, add_laplace_noise(20, 0.9, delta_f, epsilon));
+  tt_i64_op(215, ==, add_laplace_noise(20, 0.99, delta_f, epsilon));
 
  done:
   ;

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits