From 58e6a6aaebc32683f041925351d8a8101c86abda Mon Sep 17 00:00:00 2001 From: U+039b <*@0x39b.fr> Date: Sat, 18 Jun 2016 18:43:44 +0200 Subject: Fix #19063: Add check in utility macro --- src/test/test_util.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/test/test_util.c') diff --git a/src/test/test_util.c b/src/test/test_util.c index 893fc34792..9086437629 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -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); -- cgit v1.2.3-54-g00ecf