]> Git Repo - qemu.git/blobdiff - tests/test-qmp-commands.c
iotests: Add test for oVirt-like storage migration
[qemu.git] / tests / test-qmp-commands.c
index 597fb44fc81fca7952178ffc901c7f124a09c22d..e8f619d331960f9eaca0bf5f7faeb1526c88146a 100644 (file)
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include <glib.h>
 #include "qemu-common.h"
 #include "qapi/qmp/types.h"
 #include "test-qmp-commands.h"
@@ -228,14 +227,13 @@ static void test_dealloc_partial(void)
         QDECREF(ud2_dict);
     }
 
-    /* verify partial success */
-    assert(ud2 != NULL);
-    assert(ud2->string0 != NULL);
-    assert(strcmp(ud2->string0, text) == 0);
-    assert(ud2->dict1 == NULL);
-
-    /* confirm & release construction error */
+    /* verify that visit_type_XXX() cleans up properly on error */
     error_free_or_abort(&err);
+    assert(!ud2);
+
+    /* Manually create a partial object, leaving ud2->dict1 at NULL */
+    ud2 = g_new0(UserDefTwo, 1);
+    ud2->string0 = g_strdup(text);
 
     /* tear down partial object */
     qapi_free_UserDefTwo(ud2);
This page took 0.024242 seconds and 4 git commands to generate.