qemu-e2k/tests
Eduardo Habkost e3f9fe2d40 cutils: unsigned int parsing functions
There are lots of duplicate parsing code using strto*() in QEMU, and
most of that code is broken in one way or another. Even the visitors
code have duplicate integer parsing code[1]. This introduces functions
to help parsing unsigned int values: parse_uint() and parse_uint_full().

Parsing functions for signed ints and floats will be submitted later.

parse_uint_full() has all the checks made by opts_type_uint64() at
opts-visitor.c:

 - Check for NULL (returns -EINVAL)
 - Check for negative numbers (returns -EINVAL)
 - Check for empty string (returns -EINVAL)
 - Check for overflow or other errno values set by strtoll() (returns
   -errno)
 - Check for end of string (reject invalid characters after number)
   (returns -EINVAL)

parse_uint() does everything above except checking for the end of the
string, so callers can continue parsing the remainder of string after
the number.

Unit tests included.

[1] string-input-visitor.c:parse_int() could use the same parsing code
    used by opts-visitor.c:opts_type_int(), instead of duplicating that
    logic.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-02-04 14:38:33 -06:00
..
qemu-iotests block: Adds mirroring tests for resized images 2013-02-01 14:58:28 +01:00
tcg target-mips: fix incorrect test for MTHLIP 2013-01-31 23:42:04 +01:00
.gitignore target-i386: Topology & APIC ID utility functions 2013-01-27 14:34:27 +01:00
Makefile cutils: unsigned int parsing functions 2013-02-04 14:38:33 -06:00
check-block.sh Add 'make check-block' 2012-03-12 15:14:07 +01:00
check-qdict.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
check-qfloat.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
check-qint.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
check-qjson.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
check-qlist.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
check-qstring.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
fdc-test.c fdc-tests: add tests for VERIFY command 2012-11-14 18:19:22 +01:00
hd-geo-test.c qtest: Test we don't put hard disk info into CMOS for a CD-ROM 2012-07-17 16:48:31 +02:00
libi2c-omap.c libqtest: Prepare I2C libqos 2013-01-16 12:14:20 -06:00
libi2c.c libqtest: Prepare I2C libqos 2013-01-16 12:14:20 -06:00
libi2c.h libqtest: Prepare I2C libqos 2013-01-16 12:14:20 -06:00
libqtest.c libqtest: Wait for the right child PID after killing QEMU 2013-02-01 10:43:34 -06:00
libqtest.h qtest: Add function to send QMP commands 2012-05-10 10:32:11 +02:00
m48t59-test.c tests: Fix {rtc, m48t59}-test build on illumos 2013-01-30 11:18:38 +01:00
qemu-iotests-quick.sh make check: Add qemu-iotests subset 2012-03-12 15:14:07 +01:00
rtc-test.c tests: Fix {rtc, m48t59}-test build on illumos 2013-01-30 11:18:38 +01:00
test-aio.c aio: Fix return value of aio_poll() 2013-01-17 10:51:42 +01:00
test-coroutine.c block: move include files to include/block/ 2012-12-19 08:31:31 +01:00
test-cutils.c cutils: unsigned int parsing functions 2013-02-04 14:38:33 -06:00
test-hbitmap.c hbitmap: add assertion on hbitmap_iter_init 2013-01-25 18:18:35 +01:00
test-iov.c test-iov: add iov_discard_front/back() testcases 2013-01-02 15:58:09 +01:00
test-qmp-commands.c misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
test-qmp-input-strict.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
test-qmp-input-visitor.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
test-qmp-output-visitor.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
test-string-input-visitor.c tests: add fuzzing to visitor tests 2013-01-26 13:32:29 +00:00
test-string-output-visitor.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
test-thread-pool.c block: move include files to include/block/ 2012-12-19 08:31:31 +01:00
test-visitor-serialization.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
test-x86-cpuid.c target-i386: Topology & APIC ID utility functions 2013-01-27 14:34:27 +01:00
test-xbzrle.c Add XBZRLE testing 2013-02-01 08:32:20 +01:00
tmp105-test.c tests: Add tmp105 qtest test case 2013-01-16 12:14:20 -06:00