Fix #19063: Add check in utility macro

This commit is contained in:
U+039b
2016-06-18 18:43:44 +02:00
committed by Nick Mathewson
parent 81cfd5c9a1
commit 58e6a6aaeb
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -1501,6 +1501,11 @@ test_util_strmisc(void *arg)
tt_int_op(-50L,OP_EQ, tor_parse_long("-50 plus garbage",10,-100,100,&i,&cp));
tt_int_op(1,OP_EQ, i);
tt_str_op(cp,OP_EQ, " plus garbage");
/* Illogical min max */
tt_int_op(0L,OP_EQ, tor_parse_long("10",10,50,4,&i,NULL));
tt_int_op(0,OP_EQ, i);
tt_int_op(0L,OP_EQ, tor_parse_long("-50",10,100,-100,&i,NULL));
tt_int_op(0,OP_EQ, i);
/* Out of bounds */
tt_int_op(0L,OP_EQ, tor_parse_long("10",10,50,100,&i,NULL));
tt_int_op(0,OP_EQ, i);