aboutsummaryrefslogtreecommitdiff
path: root/src/test/test.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-08-09 13:47:42 -0400
committerNick Mathewson <nickm@torproject.org>2012-08-09 14:15:58 -0400
commit07df4dd52d3ab2eea2e8a8fc3222a5d297d077de (patch)
treeb11ca0fc673180ab78d37d699f6e1e3790735d7d /src/test/test.h
parent9bfb274abb9f9e5d445a75f0b67b433be823a730 (diff)
downloadtor-07df4dd52d3ab2eea2e8a8fc3222a5d297d077de.tar.gz
tor-07df4dd52d3ab2eea2e8a8fc3222a5d297d077de.zip
Refactor the core of choosing by weights into a function
This eliminates duplicated code, and lets us test a hairy piece of functionality.
Diffstat (limited to 'src/test/test.h')
-rw-r--r--src/test/test.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test.h b/src/test/test.h
index 0b6e6c60cb..6dcb9490bd 100644
--- a/src/test/test.h
+++ b/src/test/test.h
@@ -65,6 +65,10 @@
#define test_memeq_hex(expr1, hex) test_mem_op_hex(expr1, ==, hex)
+#define tt_double_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,double,(val1_ op val2_),"%f", \
+ TT_EXIT_TEST_FUNCTION)
+
const char *get_fname(const char *name);
crypto_pk_t *pk_generate(int idx);