From: Yann Droneaud Date: Wed, 31 Mar 2010 14:51:52 +0000 (+0200) Subject: tests: added tests against strtosize X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a609340ed20f08d7afa8f1b52125130f3363b12c;p=util-linux tests: added tests against strtosize - test empty string, white spaces - test hexadecimal Signed-off-by: Yann Droneaud --- diff --git a/tests/expected/misc/strtosize b/tests/expected/misc/strtosize index b7cb2461..04a2d590 100644 --- a/tests/expected/misc/strtosize +++ b/tests/expected/misc/strtosize @@ -21,3 +21,10 @@ test_strtosize: invalid size '-1' value 1TB : 1000000000000 1PB : 1000000000000000 1EB : 1000000000000000000 +test_strtosize: invalid size '' value +test_strtosize: invalid size ' ' value + 1 : 1 +test_strtosize: invalid size '1 ' value + 0x0a : 10 + 0xff00 : 65280 + 0x80000000 : 2147483648 diff --git a/tests/ts/misc/strtosize b/tests/ts/misc/strtosize index 4668823c..41b45492 100755 --- a/tests/ts/misc/strtosize +++ b/tests/ts/misc/strtosize @@ -47,5 +47,14 @@ $TS_HELPER_STRTOSIZE 1TB >> $TS_OUTPUT 2>&1 $TS_HELPER_STRTOSIZE 1PB >> $TS_OUTPUT 2>&1 $TS_HELPER_STRTOSIZE 1EB >> $TS_OUTPUT 2>&1 +$TS_HELPER_STRTOSIZE "" >> $TS_OUTPUT 2>&1 +$TS_HELPER_STRTOSIZE " " >> $TS_OUTPUT 2>&1 +$TS_HELPER_STRTOSIZE " 1" >> $TS_OUTPUT 2>&1 +$TS_HELPER_STRTOSIZE "1 " >> $TS_OUTPUT 2>&1 + +$TS_HELPER_STRTOSIZE 0x0a >> $TS_OUTPUT 2>&1 +$TS_HELPER_STRTOSIZE 0xff00 >> $TS_OUTPUT 2>&1 +$TS_HELPER_STRTOSIZE 0x80000000 >> $TS_OUTPUT 2>&1 + ts_finalize