[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 02/18] tests/qapi-schema: Drop temporary 'prefix'
From: |
Markus Armbruster |
Subject: |
[PATCH 02/18] tests/qapi-schema: Drop temporary 'prefix' |
Date: |
Tue, 30 Jul 2024 10:10:16 +0200 |
Recent commit "qapi: Smarter camel_to_upper() to reduce need for
'prefix'" added a temporary 'prefix' to delay changing the generated
code.
Revert it. This changes TestUnionEnumA's generated enumeration
constant prefix from TEST_UNION_ENUMA to TEST_UNION_ENUM_A.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
tests/unit/test-qobject-input-visitor.c | 4 ++--
tests/unit/test-qobject-output-visitor.c | 4 ++--
tests/qapi-schema/qapi-schema-test.json | 1 -
tests/qapi-schema/qapi-schema-test.out | 1 -
4 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/tests/unit/test-qobject-input-visitor.c
b/tests/unit/test-qobject-input-visitor.c
index 024e26c49e..5479e68237 100644
--- a/tests/unit/test-qobject-input-visitor.c
+++ b/tests/unit/test-qobject-input-visitor.c
@@ -720,7 +720,7 @@ static void
test_visitor_in_union_in_union(TestInputVisitorData *data,
visit_type_TestUnionInUnion(v, NULL, &tmp, &error_abort);
g_assert_cmpint(tmp->type, ==, TEST_UNION_ENUM_VALUE_A);
- g_assert_cmpint(tmp->u.value_a.type_a, ==, TEST_UNION_ENUMA_VALUE_A1);
+ g_assert_cmpint(tmp->u.value_a.type_a, ==, TEST_UNION_ENUM_A_VALUE_A1);
g_assert_cmpint(tmp->u.value_a.u.value_a1.integer, ==, 2);
g_assert_cmpint(strcmp(tmp->u.value_a.u.value_a1.name, "fish"), ==, 0);
@@ -734,7 +734,7 @@ static void
test_visitor_in_union_in_union(TestInputVisitorData *data,
visit_type_TestUnionInUnion(v, NULL, &tmp, &error_abort);
g_assert_cmpint(tmp->type, ==, TEST_UNION_ENUM_VALUE_A);
- g_assert_cmpint(tmp->u.value_a.type_a, ==, TEST_UNION_ENUMA_VALUE_A2);
+ g_assert_cmpint(tmp->u.value_a.type_a, ==, TEST_UNION_ENUM_A_VALUE_A2);
g_assert_cmpint(tmp->u.value_a.u.value_a2.integer, ==, 1729);
g_assert_cmpint(tmp->u.value_a.u.value_a2.size, ==, 87539319);
diff --git a/tests/unit/test-qobject-output-visitor.c
b/tests/unit/test-qobject-output-visitor.c
index 1535b3ad17..3455f3b107 100644
--- a/tests/unit/test-qobject-output-visitor.c
+++ b/tests/unit/test-qobject-output-visitor.c
@@ -359,7 +359,7 @@ static void
test_visitor_out_union_in_union(TestOutputVisitorData *data,
TestUnionInUnion *tmp = g_new0(TestUnionInUnion, 1);
tmp->type = TEST_UNION_ENUM_VALUE_A;
- tmp->u.value_a.type_a = TEST_UNION_ENUMA_VALUE_A1;
+ tmp->u.value_a.type_a = TEST_UNION_ENUM_A_VALUE_A1;
tmp->u.value_a.u.value_a1.integer = 42;
tmp->u.value_a.u.value_a1.name = g_strdup("fish");
@@ -377,7 +377,7 @@ static void
test_visitor_out_union_in_union(TestOutputVisitorData *data,
visitor_reset(data);
tmp = g_new0(TestUnionInUnion, 1);
tmp->type = TEST_UNION_ENUM_VALUE_A;
- tmp->u.value_a.type_a = TEST_UNION_ENUMA_VALUE_A2;
+ tmp->u.value_a.type_a = TEST_UNION_ENUM_A_VALUE_A2;
tmp->u.value_a.u.value_a2.integer = 1729;
tmp->u.value_a.u.value_a2.size = 87539319;
diff --git a/tests/qapi-schema/qapi-schema-test.json
b/tests/qapi-schema/qapi-schema-test.json
index 0f5f54e621..8ca977c49d 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -119,7 +119,6 @@
'data': [ 'value-a', 'value-b' ] }
{ 'enum': 'TestUnionEnumA',
- 'prefix': 'TEST_UNION_ENUMA', # TODO drop
'data': [ 'value-a1', 'value-a2' ] }
{ 'struct': 'TestUnionTypeA1',
diff --git a/tests/qapi-schema/qapi-schema-test.out
b/tests/qapi-schema/qapi-schema-test.out
index add7346f49..4617eb4e98 100644
--- a/tests/qapi-schema/qapi-schema-test.out
+++ b/tests/qapi-schema/qapi-schema-test.out
@@ -108,7 +108,6 @@ enum TestUnionEnum
member value-a
member value-b
enum TestUnionEnumA
- prefix TEST_UNION_ENUMA
member value-a1
member value-a2
object TestUnionTypeA1
--
2.45.0
- [PATCH 00/18] qapi: Reduce use of 'prefix'., Markus Armbruster, 2024/07/30
- [PATCH 06/18] qapi/ebpf: Drop temporary 'prefix', Markus Armbruster, 2024/07/30
- [PATCH 07/18] qapi/machine: Drop temporary 'prefix', Markus Armbruster, 2024/07/30
- [PATCH 03/18] qapi/block-core: Drop temporary 'prefix', Markus Armbruster, 2024/07/30
- [PATCH 02/18] tests/qapi-schema: Drop temporary 'prefix',
Markus Armbruster <=
- [PATCH 08/18] qapi/ui: Drop temporary 'prefix', Markus Armbruster, 2024/07/30
- [PATCH 01/18] qapi: Smarter camel_to_upper() to reduce need for 'prefix', Markus Armbruster, 2024/07/30
- Re: [PATCH 01/18] qapi: Smarter camel_to_upper() to reduce need for 'prefix', Daniel P . Berrangé, 2024/07/30
- Re: [PATCH 01/18] qapi: Smarter camel_to_upper() to reduce need for 'prefix', Markus Armbruster, 2024/07/30
- Re: [PATCH 01/18] qapi: Smarter camel_to_upper() to reduce need for 'prefix', Avihai Horon, 2024/07/30
- Re: [PATCH 01/18] qapi: Smarter camel_to_upper() to reduce need for 'prefix', Markus Armbruster, 2024/07/31
- Re: [PATCH 01/18] qapi: Smarter camel_to_upper() to reduce need for 'prefix', Avihai Horon, 2024/07/31
- Re: [PATCH 01/18] qapi: Smarter camel_to_upper() to reduce need for 'prefix', Markus Armbruster, 2024/07/31
Re: [PATCH 01/18] qapi: Smarter camel_to_upper() to reduce need for 'prefix', Kevin Wolf, 2024/07/31
[PATCH 04/18] qapi/common: Drop temporary 'prefix', Markus Armbruster, 2024/07/30