diff options
Diffstat (limited to 'src/test/test_dns.c')
-rw-r--r-- | src/test/test_dns.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/test/test_dns.c b/src/test/test_dns.c index 6a8e92cb47..19dcb02931 100644 --- a/src/test/test_dns.c +++ b/src/test/test_dns.c @@ -18,9 +18,9 @@ NS(test_main)(void *arg) uint32_t ttl_mid = MIN_DNS_TTL_AT_EXIT / 2 + MAX_DNS_TTL_AT_EXIT / 2; - tt_int_op(dns_clip_ttl(MIN_DNS_TTL_AT_EXIT - 1),==,MIN_DNS_TTL_AT_EXIT); - tt_int_op(dns_clip_ttl(ttl_mid),==,MAX_DNS_TTL_AT_EXIT); - tt_int_op(dns_clip_ttl(MAX_DNS_TTL_AT_EXIT + 1),==,MAX_DNS_TTL_AT_EXIT); + tt_int_op(dns_clip_ttl(MIN_DNS_TTL_AT_EXIT - 1),OP_EQ,MIN_DNS_TTL_AT_EXIT); + tt_int_op(dns_clip_ttl(ttl_mid),OP_EQ,MAX_DNS_TTL_AT_EXIT); + tt_int_op(dns_clip_ttl(MAX_DNS_TTL_AT_EXIT + 1),OP_EQ,MAX_DNS_TTL_AT_EXIT); done: return; @@ -172,10 +172,10 @@ NS(test_main)(void *arg) retval = dns_resolve(exitconn); - tt_int_op(retval,==,1); - tt_str_op(resolved_name,==,last_resolved_hostname); + tt_int_op(retval,OP_EQ,1); + tt_str_op(resolved_name,OP_EQ,last_resolved_hostname); tt_assert(conn_for_resolved_cell == exitconn); - tt_int_op(n_send_resolved_hostname_cell_replacement,==, + tt_int_op(n_send_resolved_hostname_cell_replacement,OP_EQ, prev_n_send_resolved_hostname_cell_replacement + 1); tt_assert(exitconn->on_circuit == NULL); @@ -201,12 +201,12 @@ NS(test_main)(void *arg) retval = dns_resolve(exitconn); - tt_int_op(retval,==,1); + tt_int_op(retval,OP_EQ,1); tt_assert(conn_for_resolved_cell == exitconn); - tt_int_op(n_send_resolved_cell_replacement,==, + tt_int_op(n_send_resolved_cell_replacement,OP_EQ, prev_n_send_resolved_cell_replacement + 1); tt_assert(last_resolved == fake_resolved); - tt_int_op(last_answer_type,==,0xff); + tt_int_op(last_answer_type,OP_EQ,0xff); tt_assert(exitconn->on_circuit == NULL); /* CASE 3: The purpose of exit connection is not EXIT_PURPOSE_RESOLVE @@ -229,12 +229,12 @@ NS(test_main)(void *arg) retval = dns_resolve(exitconn); - tt_int_op(retval,==,1); + tt_int_op(retval,OP_EQ,1); tt_assert(on_circuit->n_streams == exitconn); tt_assert(exitconn->next_stream == nextconn); - tt_int_op(prev_n_send_resolved_cell_replacement,==, + tt_int_op(prev_n_send_resolved_cell_replacement,OP_EQ, n_send_resolved_cell_replacement); - tt_int_op(prev_n_send_resolved_hostname_cell_replacement,==, + tt_int_op(prev_n_send_resolved_hostname_cell_replacement,OP_EQ, n_send_resolved_hostname_cell_replacement); /* CASE 4: _impl returns 0. @@ -253,8 +253,8 @@ NS(test_main)(void *arg) retval = dns_resolve(exitconn); - tt_int_op(retval,==,0); - tt_int_op(exitconn->base_.state,==,EXIT_CONN_STATE_RESOLVING); + tt_int_op(retval,OP_EQ,0); + tt_int_op(exitconn->base_.state,OP_EQ,EXIT_CONN_STATE_RESOLVING); tt_assert(on_circuit->resolving_streams == exitconn); tt_assert(exitconn->next_stream == nextconn); @@ -278,12 +278,12 @@ NS(test_main)(void *arg) retval = dns_resolve(exitconn); - tt_int_op(retval,==,-1); - tt_int_op(n_send_resolved_cell_replacement,==, + tt_int_op(retval,OP_EQ,-1); + tt_int_op(n_send_resolved_cell_replacement,OP_EQ, prev_n_send_resolved_cell_replacement + 1); - tt_int_op(last_answer_type,==,RESOLVED_TYPE_ERROR); - tt_int_op(n_dns_cancel_pending_resolve_replacement,==,1); - tt_int_op(n_connection_free,==,prev_n_connection_free + 1); + tt_int_op(last_answer_type,OP_EQ,RESOLVED_TYPE_ERROR); + tt_int_op(n_dns_cancel_pending_resolve_replacement,OP_EQ,1); + tt_int_op(n_connection_free,OP_EQ,prev_n_connection_free + 1); tt_assert(last_freed_conn == TO_CONN(exitconn)); done: @@ -351,9 +351,9 @@ NS(test_main)(void *arg) resolved_addr = &(exitconn->base_.addr); - tt_int_op(retval,==,1); + tt_int_op(retval,OP_EQ,1); tt_assert(tor_addr_eq(resolved_addr, (const tor_addr_t *)&addr_to_compare)); - tt_int_op(exitconn->address_ttl,==,DEFAULT_DNS_TTL); + tt_int_op(exitconn->address_ttl,OP_EQ,DEFAULT_DNS_TTL); done: tor_free(on_circ); @@ -393,7 +393,7 @@ NS(test_main)(void *arg) retval = dns_resolve_impl(exitconn, 1, on_circ, NULL, &made_pending, NULL); - tt_int_op(retval,==,-1); + tt_int_op(retval,OP_EQ,-1); done: tor_free(TO_CONN(exitconn)->address); @@ -436,7 +436,7 @@ NS(test_main)(void *arg) retval = dns_resolve_impl(exitconn, 1, on_circ, NULL, &made_pending, NULL); - tt_int_op(retval,==,-1); + tt_int_op(retval,OP_EQ,-1); done: NS_UNMOCK(router_my_exit_policy_is_reject_star); @@ -478,7 +478,7 @@ NS(test_main)(void *arg) retval = dns_resolve_impl(exitconn, 1, on_circ, NULL, &made_pending, NULL); - tt_int_op(retval,==,-1); + tt_int_op(retval,OP_EQ,-1); tor_free(TO_CONN(exitconn)->address); @@ -488,7 +488,7 @@ NS(test_main)(void *arg) retval = dns_resolve_impl(exitconn, 1, on_circ, NULL, &made_pending, NULL); - tt_int_op(retval,==,-1); + tt_int_op(retval,OP_EQ,-1); done: NS_UNMOCK(router_my_exit_policy_is_reject_star); @@ -546,8 +546,8 @@ NS(test_main)(void *arg) retval = dns_resolve_impl(exitconn, 1, on_circ, NULL, &made_pending, NULL); - tt_int_op(retval,==,0); - tt_int_op(made_pending,==,1); + tt_int_op(retval,OP_EQ,0); + tt_int_op(made_pending,OP_EQ,1); pending_conn = cache_entry->pending_connections; @@ -628,8 +628,8 @@ NS(test_main)(void *arg) retval = dns_resolve_impl(exitconn, 1, on_circ, NULL, &made_pending, &resolve_out); - tt_int_op(retval,==,0); - tt_int_op(made_pending,==,0); + tt_int_op(retval,OP_EQ,0); + tt_int_op(made_pending,OP_EQ,0); tt_assert(resolve_out == cache_entry); tt_assert(last_exitconn == exitconn); @@ -699,8 +699,8 @@ NS(test_main)(void *arg) retval = dns_resolve_impl(exitconn, 1, on_circ, NULL, &made_pending, NULL); - tt_int_op(retval,==,0); - tt_int_op(made_pending,==,1); + tt_int_op(retval,OP_EQ,0); + tt_int_op(made_pending,OP_EQ,1); cache_entry = dns_get_cache_entry(&query); @@ -712,7 +712,7 @@ NS(test_main)(void *arg) tt_assert(pending_conn->conn == exitconn); tt_assert(last_launched_resolve == cache_entry); - tt_str_op(cache_entry->address,==,TO_CONN(exitconn)->address); + tt_str_op(cache_entry->address,OP_EQ,TO_CONN(exitconn)->address); done: NS_UNMOCK(router_my_exit_policy_is_reject_star); |