mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 15:43:32 +01:00
Replace the remaining test_assert instances
This commit is contained in:
parent
0e0cef1d60
commit
34bf9b3690
@ -22,8 +22,6 @@
|
|||||||
#define PRETTY_FUNCTION ""
|
#define PRETTY_FUNCTION ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define test_assert(expr) tt_assert(expr)
|
|
||||||
|
|
||||||
#define test_eq(expr1, expr2) tt_int_op((expr1), ==, (expr2))
|
#define test_eq(expr1, expr2) tt_int_op((expr1), ==, (expr2))
|
||||||
#define test_streq(expr1, expr2) tt_str_op((expr1), ==, (expr2))
|
#define test_streq(expr1, expr2) tt_str_op((expr1), ==, (expr2))
|
||||||
|
|
||||||
|
@ -651,13 +651,13 @@ test_addr_ip6_helpers(void)
|
|||||||
#if 0
|
#if 0
|
||||||
/* Try a mask with a wildcard. */
|
/* Try a mask with a wildcard. */
|
||||||
r=tor_addr_parse_mask_ports("*/16",0,&t1, &mask, NULL, NULL);
|
r=tor_addr_parse_mask_ports("*/16",0,&t1, &mask, NULL, NULL);
|
||||||
test_assert(r == -1);
|
tt_assert(r == -1);
|
||||||
r=tor_addr_parse_mask_ports("*4/16",TAPMP_EXTENDED_STAR,
|
r=tor_addr_parse_mask_ports("*4/16",TAPMP_EXTENDED_STAR,
|
||||||
&t1, &mask, NULL, NULL);
|
&t1, &mask, NULL, NULL);
|
||||||
test_assert(r == -1);
|
tt_assert(r == -1);
|
||||||
r=tor_addr_parse_mask_ports("*6/30",TAPMP_EXTENDED_STAR,
|
r=tor_addr_parse_mask_ports("*6/30",TAPMP_EXTENDED_STAR,
|
||||||
&t1, &mask, NULL, NULL);
|
&t1, &mask, NULL, NULL);
|
||||||
test_assert(r == -1);
|
tt_assert(r == -1);
|
||||||
#endif
|
#endif
|
||||||
/* Basic mask tests*/
|
/* Basic mask tests*/
|
||||||
r=tor_addr_parse_mask_ports("1.1.2.2/31",0,&t1, &mask, NULL, NULL);
|
r=tor_addr_parse_mask_ports("1.1.2.2/31",0,&t1, &mask, NULL, NULL);
|
||||||
|
@ -194,7 +194,7 @@ test_dir_formats(void)
|
|||||||
tt_int_op(rp1->bandwidthcapacity,==, r1->bandwidthcapacity);
|
tt_int_op(rp1->bandwidthcapacity,==, r1->bandwidthcapacity);
|
||||||
tt_assert(crypto_pk_cmp_keys(rp1->onion_pkey, pk1) == 0);
|
tt_assert(crypto_pk_cmp_keys(rp1->onion_pkey, pk1) == 0);
|
||||||
tt_assert(crypto_pk_cmp_keys(rp1->identity_pkey, pk2) == 0);
|
tt_assert(crypto_pk_cmp_keys(rp1->identity_pkey, pk2) == 0);
|
||||||
//test_assert(rp1->exit_policy == NULL);
|
//tt_assert(rp1->exit_policy == NULL);
|
||||||
tor_free(buf);
|
tor_free(buf);
|
||||||
|
|
||||||
strlcpy(buf2,
|
strlcpy(buf2,
|
||||||
@ -1094,7 +1094,7 @@ test_vrs_for_v3ns(vote_routerstatus_t *vrs, int voter, time_t now)
|
|||||||
* Didn't expect this, but the old unit test only checked some of them,
|
* Didn't expect this, but the old unit test only checked some of them,
|
||||||
* so don't assert.
|
* so don't assert.
|
||||||
*/
|
*/
|
||||||
/* test_assert(0); */
|
/* tt_assert(0); */
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
@ -2126,7 +2126,7 @@ test_consensus_for_umbw(networkstatus_t *con, time_t now)
|
|||||||
|
|
||||||
tt_assert(con);
|
tt_assert(con);
|
||||||
tt_assert(!con->cert);
|
tt_assert(!con->cert);
|
||||||
// test_assert(con->consensus_method >= MIN_METHOD_TO_CLIP_UNMEASURED_BW_KB);
|
// tt_assert(con->consensus_method >= MIN_METHOD_TO_CLIP_UNMEASURED_BW_KB);
|
||||||
tt_assert(con->consensus_method >= 16);
|
tt_assert(con->consensus_method >= 16);
|
||||||
tt_int_op(4,==, smartlist_len(con->routerstatus_list));
|
tt_int_op(4,==, smartlist_len(con->routerstatus_list));
|
||||||
/* There should be four listed routers; all voters saw the same in this */
|
/* There should be four listed routers; all voters saw the same in this */
|
||||||
|
@ -976,7 +976,7 @@ test_util_string_is_key_value(void *ptr)
|
|||||||
tt_assert(!string_is_key_value(LOG_WARN, "="));
|
tt_assert(!string_is_key_value(LOG_WARN, "="));
|
||||||
|
|
||||||
/* ??? */
|
/* ??? */
|
||||||
/* test_assert(!string_is_key_value(LOG_WARN, "===")); */
|
/* tt_assert(!string_is_key_value(LOG_WARN, "===")); */
|
||||||
done:
|
done:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user