]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: added tests against strtosize
authorYann Droneaud <yann@droneaud.fr>
Wed, 31 Mar 2010 14:51:52 +0000 (16:51 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 31 Mar 2010 15:15:01 +0000 (17:15 +0200)
- test empty string, white spaces
- test hexadecimal

Signed-off-by: Yann Droneaud <yann@droneaud.fr>
tests/expected/misc/strtosize
tests/ts/misc/strtosize

index b7cb24617b90f261db1b7febc0ac177de15a809f..04a2d590c4d8a9d4490a4bc7895ad03b368fa3bd 100644 (file)
@@ -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
index 4668823c608159dd9f7b139a00365dc52675dc3c..41b45492dad98557c5f789c220811a915b71a2d0 100755 (executable)
@@ -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