aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-09-11 18:47:19 -0400
committerNick Mathewson <nickm@torproject.org>2019-09-11 18:47:19 -0400
commitded6d9fcb47fededa8cb2dd835772eb3036ef36d (patch)
tree28e1c2f87f1b1f77125e02ebbb33f826c088993f /src/test/test_router.c
parent25ed698fb8a4f438c2fc804cdb2b0bf92e641f59 (diff)
downloadtor-ded6d9fcb47fededa8cb2dd835772eb3036ef36d.tar.gz
tor-ded6d9fcb47fededa8cb2dd835772eb3036ef36d.zip
Run test_operator_cleanup on our unit tests
Coccinelle doesn't understand it when we use "==" and "!=" and so on as arguments to macros. To solve this, we prefer OP_EQ, OP_NE, and so on. This commit is automatically generated by running ./scripts/coccinelle/test_operator_cleanup over all of the source code in src.
Diffstat (limited to 'src/test/test_router.c')
-rw-r--r--src/test/test_router.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/test_router.c b/src/test/test_router.c
index 5477ab51e9..24c7d32bc1 100644
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@ -92,13 +92,13 @@ test_router_dump_router_to_string_no_bridge_distribution_method(void *arg)
options->BridgeRelay = 1;
/* Generate keys which router_dump_router_to_string() expects to exist. */
- tt_int_op(0, ==, curve25519_keypair_generate(&ntor_keypair, 0));
- tt_int_op(0, ==, ed25519_keypair_generate(&signing_keypair, 0));
+ tt_int_op(0, OP_EQ, curve25519_keypair_generate(&ntor_keypair, 0));
+ tt_int_op(0, OP_EQ, ed25519_keypair_generate(&signing_keypair, 0));
/* Set up part of our routerinfo_t so that we don't trigger any other
* assertions in router_dump_router_to_string(). */
router = (routerinfo_t*)router_get_my_routerinfo();
- tt_ptr_op(router, !=, NULL);
+ tt_ptr_op(router, OP_NE, NULL);
/* The real router_get_my_routerinfo() looks up onion_curve25519_pkey using
* get_current_curve25519_keypair(), but we don't initialise static data in
@@ -115,9 +115,9 @@ test_router_dump_router_to_string_no_bridge_distribution_method(void *arg)
&ntor_keypair,
&signing_keypair);
crypto_pk_free(onion_pkey);
- tt_ptr_op(desc, !=, NULL);
+ tt_ptr_op(desc, OP_NE, NULL);
found = strstr(desc, needle);
- tt_ptr_op(found, !=, NULL);
+ tt_ptr_op(found, OP_NE, NULL);
done:
NS_UNMOCK(router_get_my_routerinfo);