mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
C90 compliance for #13104 fixes
This commit is contained in:
parent
9e595a95a8
commit
2491eadf00
@ -3277,6 +3277,7 @@ test_util_di_ops(void)
|
|||||||
/* exhaustively white-box test tor_memeq
|
/* exhaustively white-box test tor_memeq
|
||||||
* against each possible (single-byte) bit difference
|
* against each possible (single-byte) bit difference
|
||||||
* some arithmetic bugs only appear with certain bit patterns */
|
* some arithmetic bugs only appear with certain bit patterns */
|
||||||
|
{
|
||||||
const uint8_t z = 0;
|
const uint8_t z = 0;
|
||||||
uint8_t ii = 0;
|
uint8_t ii = 0;
|
||||||
for (i = 0; i < 256; i++) {
|
for (i = 0; i < 256; i++) {
|
||||||
@ -3292,6 +3293,7 @@ test_util_di_ops(void)
|
|||||||
test_eq(tor_memcmp(&z, &ii, 1) > 0 ? GT : EQ, z > ii ? GT : EQ);
|
test_eq(tor_memcmp(&z, &ii, 1) > 0 ? GT : EQ, z > ii ? GT : EQ);
|
||||||
test_eq(tor_memcmp(&ii, &z, 1) < 0 ? LT : EQ, ii < z ? LT : EQ);
|
test_eq(tor_memcmp(&ii, &z, 1) < 0 ? LT : EQ, ii < z ? LT : EQ);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tt_int_op(1, ==, safe_mem_is_zero("", 0));
|
tt_int_op(1, ==, safe_mem_is_zero("", 0));
|
||||||
tt_int_op(1, ==, safe_mem_is_zero("", 1));
|
tt_int_op(1, ==, safe_mem_is_zero("", 1));
|
||||||
|
Loading…
Reference in New Issue
Block a user