QemuOpt: add unit tests
PATCH v3 1/1 QemuOpt: add unit tests
Cover basic aspects and API usage for QemuOpt. The current implementation covers the API's planned to be changed by Chunyan Liu in his QEMUOptionParameter replacement/cleanup job.
Other APIs should be covered in future improvements.
Signed-off-by Leandro Dorileo <[email protected]>
Reviewed-by Eric Blake <[email protected]>
---
Notes:
v3:
+ fix a typo (s/dinamically/dynamically/);
v2:
+ fixed comments;
+ make use of g_assert_cmpstr();
+ use error_abort instead of a local_err for qemu_opts_absorb_qdict();
+ asserts on QemuOptsList (empty and list name);
+ added test_qemu_opt_unset();
+ asserts on qemu_opt_*_set() return;
+ added test_qemu_opts_reset();
+ added test_qemu_opts_set();
tests/Makefile | 3 + tests/test-qemu-opts.c | 455 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 458 insertions(+) create mode 100644 tests/test-qemu-opts.c
tests/Makefile +3 -0
@@ -60,6 +60,8 @@ check-unit-y += tests/test-qdev-global-props$(EXESUF) check-unit-y += tests/check-qom-interface$(EXESUF) gcov-files-check-qom-interface-y = qom/object.c check-unit-y += tests/test-vmstate$(EXESUF) +check-unit-y += tests/test-qemu-opts$(EXESUF) +gcov-files-test-qemu-opts-y = qom/test-qemu-opts.c check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
@@ -272,6 +274,7 @@ tests/qom-test$(EXESUF): tests/qom-test.o tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y) tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y) tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o +tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o libqemuutil.a libqemustub.a # QTest rules
tests/test-qemu-opts.c new file +455 -0
455 lines not on this page · raw message
Signature · 1 line
1.9.1