Skip to contentSkip to conversation

test: QOM interface casting

PATCH In review Igor Mammedov 2 participants 2 messages Dec 20, 2013 – Dec 24, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 test: QOM interface casting

Add basic regression testing for QOM Interface usage. Test checks casting to interface type/class for following cases:
- interface implementation in leaf class
- interface implementation in intermediate (parent) class

---
- Peter Crosthwaite <[email protected]>
* s/Parent/parent_obj/
* s/parent/parent_class/
- Peter Maydell <[email protected]>
* s/interfacei/interface/
* s/OQM/QOM/ typo
* tests/Makefile split too long line
- Andreas Färber <[email protected]>
* consolidate QOM core object files in dedicated variable
* add SoB and commit message
* fix copy/past errors in tests/Makefile
* prefix test names with "/qom/interface/"
* s/ico/ioc/
* add extra spacing

---
 tests/Makefile              |    6 ++-
 tests/check-qom-interface.c |  105 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+), 1 deletions(-)
 create mode 100644 tests/check-qom-interface.c
tests/Makefile +5 -1
index 93632dd..3b53040 100644
@@ -52,6 +52,8 @@ check-unit-y += tests/test-int128$(EXESUF)
 gcov-files-test-int128-y =
 check-unit-y += tests/test-bitops$(EXESUF)
 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-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 
@@ -137,6 +139,7 @@ test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o
 
 $(test-obj-y): QEMU_INCLUDES += -Itests
 QEMU_CFLAGS += -I$(SRC_PATH)/tests
+qom-core-obj = qom/object.o qom/qom-qobject.o qom/container.o
 
 tests/test-x86-cpuid.o: QEMU_INCLUDES += -I$(SRC_PATH)/target-i386
 
@@ -146,6 +149,7 @@ tests/check-qdict$(EXESUF): tests/check-qdict.o libqemuutil.a
 tests/check-qlist$(EXESUF): tests/check-qlist.o libqemuutil.a
 tests/check-qfloat$(EXESUF): tests/check-qfloat.o libqemuutil.a
 tests/check-qjson$(EXESUF): tests/check-qjson.o libqemuutil.a libqemustub.a
+tests/check-qom-interface$(EXESUF): tests/check-qom-interface.o $(qom-core-obj) libqemuutil.a
 tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(block-obj-y) libqemuutil.a libqemustub.a
 tests/test-aio$(EXESUF): tests/test-aio.o $(block-obj-y) libqemuutil.a libqemustub.a
 tests/test-throttle$(EXESUF): tests/test-throttle.o $(block-obj-y) libqemuutil.a libqemustub.a
@@ -159,7 +163,7 @@ tests/test-int128$(EXESUF): tests/test-int128.o
 tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \
 	hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\
 	hw/core/irq.o \
-	qom/object.o qom/container.o qom/qom-qobject.o \
+	$(qom-core-obj) \
 	$(test-qapi-obj-y) \
 	libqemuutil.a libqemustub.a
 
tests/check-qom-interface.c new file +105 -0

105 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw

Am 20.12.2013 22:14, schrieb Igor Mammedov:

Quoted 21 lines

Add basic regression testing for QOM Interface usage. Test checks casting to interface type/class for following cases:
- interface implementation in leaf class
- interface implementation in intermediate (parent) class

---
- Peter Crosthwaite <[email protected]>
* s/Parent/parent_obj/
* s/parent/parent_class/
- Peter Maydell <[email protected]>
* s/interfacei/interface/
* s/OQM/QOM/ typo
* tests/Makefile split too long line
- Andreas Färber <[email protected]>
* consolidate QOM core object files in dedicated variable
* add SoB and commit message
* fix copy/past errors in tests/Makefile
* prefix test names with "/qom/interface/"
* s/ico/ioc/
* add extra spacing

Quoted 5 lines
---
 tests/Makefile              |    6 ++-
 tests/check-qom-interface.c |  105 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+), 1 deletions(-)
 create mode 100644 tests/check-qom-interface.c

Thanks, queued after the squashed interface fixes:
https://github.com/afaerber/qemu-cpu/commits/qom-next

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg