]> Git Repo - qemu.git/blobdiff - tests/check-qom-proplist.c
tests/docker/Makefile.include: only force SID to NOCACHE if old
[qemu.git] / tests / check-qom-proplist.c
index 432b66585fea16c3f40a861e7cbc86def91b9102..92898e15205179d2eb41a84fe29b42e361250d50 100644 (file)
@@ -46,11 +46,13 @@ enum DummyAnimal {
     DUMMY_LAST,
 };
 
-static const char *const dummy_animal_map[DUMMY_LAST + 1] = {
-    [DUMMY_FROG] = "frog",
-    [DUMMY_ALLIGATOR] = "alligator",
-    [DUMMY_PLATYPUS] = "platypus",
-    [DUMMY_LAST] = NULL,
+const QEnumLookup dummy_animal_map = {
+    .array = (const char *const[]) {
+        [DUMMY_FROG] = "frog",
+        [DUMMY_ALLIGATOR] = "alligator",
+        [DUMMY_PLATYPUS] = "platypus",
+    },
+    .size = DUMMY_LAST
 };
 
 struct DummyObject {
@@ -142,7 +144,7 @@ static void dummy_class_init(ObjectClass *cls, void *data)
                                   NULL);
     object_class_property_add_enum(cls, "av",
                                    "DummyAnimal",
-                                   dummy_animal_map,
+                                   &dummy_animal_map,
                                    dummy_get_av,
                                    dummy_set_av,
                                    NULL);
@@ -428,6 +430,8 @@ static void test_dummy_createcmdl(void)
     g_assert(err == NULL);
     error_free(err);
 
+    object_unref(OBJECT(dobj));
+
     /*
      * cmdline-parsing via qemu_opts_parse() results in a QemuOpts entry
      * corresponding to the Object's ID to be added to the QemuOptsList
This page took 0.024129 seconds and 4 git commands to generate.