From d45b1de81aa47cef4ca098a4b2725d855b154162 Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Mon, 18 Sep 2006 14:49:23 +0000 Subject: Check for overflow in numeric expansion conditions; forbid negative values for message_size_limit. --- test/scripts/0000-Basic/0002 | 7 +++++++ test/stdout/0002 | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/scripts/0000-Basic/0002 b/test/scripts/0000-Basic/0002 index 251b8d0c5..19e1e856a 100644 --- a/test/scripts/0000-Basic/0002 +++ b/test/scripts/0000-Basic/0002 @@ -187,6 +187,11 @@ hash: ${if eq {1}{2}{${hash_3:invalid}}{NO}} md5: ${if eq {1}{2}{${md5:invalid}}{NO}} mask: ${if eq {1}{2}{${mask:invalid}}{NO}} +# Numeric overflow + +4096M ${if >{1}{4096M}{y}{n}} +4096000000 ${if >{1}{4096000000}{y}{n}} + # Conditions 2=2: ${if ={2}{2}{y}{n}} @@ -200,6 +205,7 @@ mask: ${if eq {1}{2}{${mask:invalid}}{NO}} 2>3: ${if >{2}{3}{y}{n}} 3>3: ${if >{3}{3}{y}{n}} 4>3: ${if >{4}{3}{y}{n}} +1>-1: ${if >{1}{-1}{y}{n}} 2>=3: ${if >={2}{3}{y}{n}} 3>=3: ${if >={3}{3}{y}{n}} 4>=3: ${if >={4}{3}{y}{n}} @@ -210,6 +216,7 @@ mask: ${if eq {1}{2}{${mask:invalid}}{NO}} 3<=3: ${if <={3}{3}{y}{n}} 4<=3: ${if <={4}{3}{y}{n}} 5<=3: ${if <={ 5 } { 3 } {y}{n}} +-3<=1: ${if <={-3}{1}{y}{n}} 5>3k: ${if >{5 } {3k }{y}{n}} 5>3m: ${if >{5 } {3m }{y}{n}} diff --git a/test/stdout/0002 b/test/stdout/0002 index e437faded..96d4047ac 100644 --- a/test/stdout/0002 +++ b/test/stdout/0002 @@ -168,6 +168,11 @@ > md5: NO > mask: NO > +> # Numeric overflow +> +> Failed: absolute value of integer "4096M" is too large (overflow) +> Failed: absolute value of integer "4096000000" is too large (overflow) +> > # Conditions > > 2=2: y @@ -181,6 +186,7 @@ > 2>3: n > 3>3: n > 4>3: y +> 1>-1: y > 2>=3: n > 3>=3: y > 4>=3: y @@ -191,11 +197,12 @@ > 3<=3: y > 4<=3: n > 5<=3: n +> -3<=1: y > > 5>3k: n > 5>3m: n -> Failed: "3z " is not a number -> Failed: "a" is not a number +> Failed: invalid integer "3z " +> Failed: integer expected but "a" found > > def:y y > def:n n -- cgit v1.2.3