From a609340ed20f08d7afa8f1b52125130f3363b12c Mon Sep 17 00:00:00 2001 From: Yann Droneaud Date: Wed, 31 Mar 2010 16:51:52 +0200 Subject: [PATCH] tests: added tests against strtosize - test empty string, white spaces - test hexadecimal Signed-off-by: Yann Droneaud --- tests/expected/misc/strtosize | 7 +++++++ tests/ts/misc/strtosize | 9 +++++++++ 2 files changed, 16 insertions(+) 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 -- 2.39.5