diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2006-09-18 14:49:23 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2006-09-18 14:49:23 +0000 |
commit | d45b1de81aa47cef4ca098a4b2725d855b154162 (patch) | |
tree | f21b3801fc83f7cb8d058829b51e10bf1a8043c2 /test | |
parent | ddfcd446e8b9bdb55a17d6b950bf55c736505a9e (diff) |
Check for overflow in numeric expansion conditions; forbid negative
values for message_size_limit.
Diffstat (limited to 'test')
-rw-r--r-- | test/scripts/0000-Basic/0002 | 7 | ||||
-rw-r--r-- | test/stdout/0002 | 11 |
2 files changed, 16 insertions, 2 deletions
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 |