diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check-qom-interface.c | 11 | ||||
-rw-r--r-- | tests/check-qom-proplist.c | 16 | ||||
-rw-r--r-- | tests/test-qdev-global-props.c | 13 |
3 files changed, 20 insertions, 20 deletions
diff --git a/tests/check-qom-interface.c b/tests/check-qom-interface.c index 2177f0dce5..c99be97ed8 100644 --- a/tests/check-qom-interface.c +++ b/tests/check-qom-interface.c @@ -16,20 +16,19 @@ #define TYPE_TEST_IF "test-interface" -#define TEST_IF_CLASS(klass) \ - OBJECT_CLASS_CHECK(TestIfClass, (klass), TYPE_TEST_IF) -#define TEST_IF_GET_CLASS(obj) \ - OBJECT_GET_CLASS(TestIfClass, (obj), TYPE_TEST_IF) +typedef struct TestIfClass TestIfClass; +DECLARE_CLASS_CHECKERS(TestIfClass, TEST_IF, + TYPE_TEST_IF) #define TEST_IF(obj) \ INTERFACE_CHECK(TestIf, (obj), TYPE_TEST_IF) typedef struct TestIf TestIf; -typedef struct TestIfClass { +struct TestIfClass { InterfaceClass parent_class; uint32_t test; -} TestIfClass; +}; static const TypeInfo test_if_info = { .name = TYPE_TEST_IF, diff --git a/tests/check-qom-proplist.c b/tests/check-qom-proplist.c index e1e0a96661..1571606c1c 100644 --- a/tests/check-qom-proplist.c +++ b/tests/check-qom-proplist.c @@ -33,8 +33,8 @@ typedef struct DummyObject DummyObject; typedef struct DummyObjectClass DummyObjectClass; -#define DUMMY_OBJECT(obj) \ - OBJECT_CHECK(DummyObject, (obj), TYPE_DUMMY) +DECLARE_INSTANCE_CHECKER(DummyObject, DUMMY_OBJECT, + TYPE_DUMMY) typedef enum DummyAnimal DummyAnimal; @@ -196,12 +196,12 @@ typedef struct DummyBackendClass DummyBackendClass; #define TYPE_DUMMY_BUS "qemu-dummy-bus" #define TYPE_DUMMY_BACKEND "qemu-dummy-backend" -#define DUMMY_DEV(obj) \ - OBJECT_CHECK(DummyDev, (obj), TYPE_DUMMY_DEV) -#define DUMMY_BUS(obj) \ - OBJECT_CHECK(DummyBus, (obj), TYPE_DUMMY_BUS) -#define DUMMY_BACKEND(obj) \ - OBJECT_CHECK(DummyBackend, (obj), TYPE_DUMMY_BACKEND) +DECLARE_INSTANCE_CHECKER(DummyDev, DUMMY_DEV, + TYPE_DUMMY_DEV) +DECLARE_INSTANCE_CHECKER(DummyBus, DUMMY_BUS, + TYPE_DUMMY_BUS) +DECLARE_INSTANCE_CHECKER(DummyBackend, DUMMY_BACKEND, + TYPE_DUMMY_BACKEND) struct DummyDev { Object parent_obj; diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c index 1e6b0f33ff..8a3c14d92c 100644 --- a/tests/test-qdev-global-props.c +++ b/tests/test-qdev-global-props.c @@ -31,19 +31,20 @@ #define TYPE_STATIC_PROPS "static_prop_type" -#define STATIC_TYPE(obj) \ - OBJECT_CHECK(MyType, (obj), TYPE_STATIC_PROPS) +typedef struct MyType MyType; +DECLARE_INSTANCE_CHECKER(MyType, STATIC_TYPE, + TYPE_STATIC_PROPS) #define TYPE_SUBCLASS "static_prop_subtype" #define PROP_DEFAULT 100 -typedef struct MyType { +struct MyType { DeviceState parent_obj; uint32_t prop1; uint32_t prop2; -} MyType; +}; static Property static_props[] = { DEFINE_PROP_UINT32("prop1", MyType, prop1, PROP_DEFAULT), @@ -127,8 +128,8 @@ static void test_static_globalprop(void) } #define TYPE_DYNAMIC_PROPS "dynamic-prop-type" -#define DYNAMIC_TYPE(obj) \ - OBJECT_CHECK(MyType, (obj), TYPE_DYNAMIC_PROPS) +DECLARE_INSTANCE_CHECKER(MyType, DYNAMIC_TYPE, + TYPE_DYNAMIC_PROPS) #define TYPE_UNUSED_HOTPLUG "hotplug-type" #define TYPE_UNUSED_NOHOTPLUG "nohotplug-type" |