Skip to contentSkip to conversation

tests/qapi-schema: Fix enum misuse in flat union type tests

PATCH In review Markus Armbruster 2 participants 4 messages Mar 10, 2014 – Mar 11, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/qapi-schema: Fix enum misuse in flat union type tests

Screwed up in commit 2fc0043. Currently harmless, because the enum values happen to be identical.

---
 tests/test-qmp-input-visitor.c  | 2 +-
 tests/test-qmp-output-visitor.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tests/test-qmp-input-visitor.c +1 -1
index 2dffafc..0b9256b 100644
@@ -315,7 +315,7 @@ static void test_visitor_in_union_flat(TestInputVisitorData *data,
 
     visit_type_UserDefFlatUnion(v, &tmp, NULL, &err);
     g_assert(err == NULL);
-    g_assert_cmpint(tmp->kind, ==, USER_DEF_UNION_KIND_A);
+    g_assert_cmpint(tmp->kind, ==, USER_DEF_FLAT_UNION_KIND_A);
     /* TODO g_assert_cmpint(tmp->integer, ==, 41); */
     g_assert_cmpint(tmp->a->boolean, ==, true);
     qapi_free_UserDefFlatUnion(tmp);
tests/test-qmp-output-visitor.c +1 -1
index 105f4cf..603616a 100644
@@ -449,7 +449,7 @@ static void test_visitor_out_union_flat(TestOutputVisitorData *data,
     Error *err = NULL;
 
     UserDefFlatUnion *tmp = g_malloc0(sizeof(UserDefFlatUnion));
-    tmp->kind = USER_DEF_UNION_KIND_A;
+    tmp->kind = USER_DEF_FLAT_UNION_KIND_A;
     tmp->a = g_malloc0(sizeof(UserDefA));
     /* TODO when generator bug is fixed: tmp->integer = 41; */
     tmp->a->boolean = true;
Signature · 1 line
1.8.1.4
#1 lore raw
Quoted 2 lines · On Mon, 10 Mar 2014 15:54:50 +0100 Markus Armbruster <[email protected]> wrote:

Screwed up in commit 2fc0043. Currently harmless, because the enum values happen to be identical.

I'm afraid this conflicts with Wenchao's series:

[PATCH V9 00/10] qapi script: support enum as discriminator and better enum name

Which is already merged in my qmp queue:

git://repo.or.cz/qemu/qmp-unstable.git queue/qmp

Quoted 34 lines
---
 tests/test-qmp-input-visitor.c  | 2 +-
 tests/test-qmp-output-visitor.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tests/test-qmp-input-visitor.c +1 -1
index 2dffafc..0b9256b 100644
@@ -315,7 +315,7 @@ static void test_visitor_in_union_flat(TestInputVisitorData *data,
 
     visit_type_UserDefFlatUnion(v, &tmp, NULL, &err);
     g_assert(err == NULL);
-    g_assert_cmpint(tmp->kind, ==, USER_DEF_UNION_KIND_A);
+    g_assert_cmpint(tmp->kind, ==, USER_DEF_FLAT_UNION_KIND_A);
     /* TODO g_assert_cmpint(tmp->integer, ==, 41); */
     g_assert_cmpint(tmp->a->boolean, ==, true);
     qapi_free_UserDefFlatUnion(tmp);
tests/test-qmp-output-visitor.c +1 -1
index 105f4cf..603616a 100644
@@ -449,7 +449,7 @@ static void test_visitor_out_union_flat(TestOutputVisitorData *data,
     Error *err = NULL;
 
     UserDefFlatUnion *tmp = g_malloc0(sizeof(UserDefFlatUnion));
-    tmp->kind = USER_DEF_UNION_KIND_A;
+    tmp->kind = USER_DEF_FLAT_UNION_KIND_A;
     tmp->a = g_malloc0(sizeof(UserDefA));
     /* TODO when generator bug is fixed: tmp->integer = 41; */
     tmp->a->boolean = true;
#2 lore raw
Quoted 6 lines · Luiz Capitulino
Quoted 2 lines · On Mon, 10 Mar 2014 15:54:50 +0100 Markus Armbruster <[email protected]> wrote:

Screwed up in commit 2fc0043. Currently harmless, because the enum values happen to be identical.

Quoted 8 lines

I'm afraid this conflicts with Wenchao's series:

[PATCH V9 00/10] qapi script: support enum as discriminator and
better enum name

Which is already merged in my qmp queue:

git://repo.or.cz/qemu/qmp-unstable.git queue/qmp

Conflicts because it fixes the bug silently.

If we want a record of the bug fix, we can either rebase his series on top of mine, or amend one of his commit messages. I'm not sure it's worth the bother, though. I can give it a try if you think it's worthwhile.

#3 lore raw
Quoted 15 lines · On Tue, 11 Mar 2014 10:19:20 +0100 Markus Armbruster <[email protected]> wrote:
Quoted 13 lines · Luiz Capitulino
Quoted 2 lines · On Mon, 10 Mar 2014 15:54:50 +0100 Markus Armbruster <[email protected]> wrote:

Screwed up in commit 2fc0043. Currently harmless, because the enum values happen to be identical.

I'm afraid this conflicts with Wenchao's series:

[PATCH V9 00/10] qapi script: support enum as discriminator and
better enum name

Which is already merged in my qmp queue:

Quoted 8 lines
Quoted 1 line

git://repo.or.cz/qemu/qmp-unstable.git queue/qmp

Conflicts because it fixes the bug silently.

If we want a record of the bug fix, we can either rebase his series on top of mine, or amend one of his commit messages. I'm not sure it's worth the bother, though. I can give it a try if you think it's worthwhile.

I don't think it is.