summaryrefslogtreecommitdiffstats
path: root/tests/expected/misc
diff options
context:
space:
mode:
authorKarel Zak2010-03-30 13:47:33 +0200
committerKarel Zak2010-03-30 13:51:58 +0200
commitcf8de26afe0db5c330f4c913d736dc1f840add88 (patch)
treef84ed27c9f14a7bdf3e98b0fdc79a35b6bb91ec4 /tests/expected/misc
parenthwclock: add --predict for predicting RTC reading at a given time (diff)
downloadkernel-qcow2-util-linux-cf8de26afe0db5c330f4c913d736dc1f840add88.tar.gz
kernel-qcow2-util-linux-cf8de26afe0db5c330f4c913d736dc1f840add88.tar.xz
kernel-qcow2-util-linux-cf8de26afe0db5c330f4c913d736dc1f840add88.zip
lib: add strtosize() function
This function int strtosize(const char *str, uintmax_t *res) supports {K,M,G,T,E,P}iB and {K,M,G,T,E,P}B suffixes. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/expected/misc')
-rw-r--r--tests/expected/misc/strtosize23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/expected/misc/strtosize b/tests/expected/misc/strtosize
new file mode 100644
index 000000000..b7cb24617
--- /dev/null
+++ b/tests/expected/misc/strtosize
@@ -0,0 +1,23 @@
+test_strtosize: invalid size '-1' value
+ 0 : 0
+ 1 : 1
+ 123 : 123
+ 18446744073709551615 : 18446744073709551615
+ 1K : 1024
+ 1KiB : 1024
+ 1M : 1048576
+ 1MiB : 1048576
+ 1G : 1073741824
+ 1GiB : 1073741824
+ 1T : 1099511627776
+ 1TiB : 1099511627776
+ 1P : 1125899906842624
+ 1PiB : 1125899906842624
+ 1E : 1152921504606846976
+ 1EiB : 1152921504606846976
+ 1KB : 1000
+ 1MB : 1000000
+ 1GB : 1000000000
+ 1TB : 1000000000000
+ 1PB : 1000000000000000
+ 1EB : 1000000000000000000