[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 3.5/3] fixup! tests: Enhance qobject output to co
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v2 3.5/3] fixup! tests: Enhance qobject output to cover partial visit |
Date: |
Fri, 4 Nov 2016 08:16:24 -0500 |
[adds comments. No commit body change]
Signed-off-by: Eric Blake <address@hidden>
---
tests/test-qobject-output-visitor.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tests/test-qobject-output-visitor.c
b/tests/test-qobject-output-visitor.c
index fdae0d5..7646bb4 100644
--- a/tests/test-qobject-output-visitor.c
+++ b/tests/test-qobject-output-visitor.c
@@ -260,10 +260,12 @@ static void
test_visitor_out_partial_visit(TestOutputVisitorData *data,
/* Various checks that a mid-visit abort doesn't leak or double-free. */
const char *str = "hi";
Error *err = NULL;
- UserDefAlternate uda = { .type = QTYPE_QDICT,
- .u.udfu = { .integer = 1,
- .string = (char *) "bye",
- .enum1 = -1 } };
+ UserDefAlternate uda = {
+ .type = QTYPE_QDICT,
+ .u.udfu = { .integer = 1,
+ .string = (char *) "bye",
+ .enum1 = -1 } /* intentionally bad */
+ };
UserDefAlternate *obj = &uda;
/* Abort within a nested object with no data members */
@@ -286,6 +288,7 @@ static void
test_visitor_out_partial_visit(TestOutputVisitorData *data,
visit_type_UserDefUnionBase_members(data->ov,
(UserDefUnionBase *)&uda.u.udfu,
&err);
+ /* error expected because of bad "enum1" discriminator value */
error_free_or_abort(&err);
visitor_reset(data);
}
--
2.7.4
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [PATCH v2 3.5/3] fixup! tests: Enhance qobject output to cover partial visit,
Eric Blake <=