mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 06:48:05 +01:00
Fix a unit test bug for passing arguments to tor_parse_ulong.
We wanted to make sure -50 was a bad input, but instead we were passing a 'min' that was greater than 'max'.
This commit is contained in:
parent
7ba47ca1fd
commit
2a4a815f58
1 changed files with 3 additions and 1 deletions
|
@ -2001,9 +2001,11 @@ test_util_parse_integer(void *arg)
|
|||
tt_int_op(10UL,OP_EQ, tor_parse_ulong("10",10,10,100,NULL,NULL));
|
||||
tt_int_op(0UL,OP_EQ, tor_parse_ulong("8",8,0,100,NULL,NULL));
|
||||
tt_int_op(50UL,OP_EQ, tor_parse_ulong("50",10,50,100,NULL,NULL));
|
||||
tt_int_op(0UL,OP_EQ, tor_parse_ulong("-50",10,-100,100,NULL,NULL));
|
||||
tt_int_op(0UL,OP_EQ, tor_parse_ulong("-50",10,0,100,NULL,NULL));
|
||||
tt_int_op(0UL,OP_EQ, tor_parse_ulong("50",-1,50,100,&i,NULL));
|
||||
tt_int_op(0,OP_EQ, i);
|
||||
tt_int_op(0UL,OP_EQ, tor_parse_ulong("-50",10,0,100,&i,NULL));
|
||||
tt_int_op(0,OP_EQ, i);
|
||||
|
||||
/* Test parse_uint64 */
|
||||
tt_assert(U64_LITERAL(10) == tor_parse_uint64("10 x",10,0,100, &i, &cp));
|
||||
|
|
Loading…
Add table
Reference in a new issue