]> git.proxmox.com Git - mirror_qemu.git/blobdiff - tests/check-qom-interface.c
usb-mtp: fix return status of delete
[mirror_qemu.git] / tests / check-qom-interface.c
index f06380ef14d810c3743fc7ca8c1b7bb9acc97ed4..2177f0dce5d2f45ac2e4615a22e28de6b918e7fe 100644 (file)
@@ -9,7 +9,7 @@
  * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
  * See the COPYING.LIB file in the top-level directory.
  */
-#include <glib.h>
+#include "qemu/osdep.h"
 
 #include "qom/object.h"
 #include "qemu/module.h"
@@ -23,9 +23,7 @@
 #define TEST_IF(obj) \
      INTERFACE_CHECK(TestIf, (obj), TYPE_TEST_IF)
 
-typedef struct TestIf {
-    Object parent_obj;
-} TestIf;
+typedef struct TestIf TestIf;
 
 typedef struct TestIfClass {
     InterfaceClass parent_class;
@@ -76,6 +74,7 @@ static void test_interface_impl(const char *type)
 
     g_assert(iobj);
     g_assert(ioc->test == PATTERN);
+    object_unref(obj);
 }
 
 static void interface_direct_test(void)