aboutsummaryrefslogtreecommitdiff
path: root/tests/qapi-schema/union-clash-branches.json
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-03-23 10:40:25 +0100
committerMarkus Armbruster <armbru@redhat.com>2021-03-23 22:31:53 +0100
commitd83b47646ec2bdf4f7be9c2078f1bcbbb0544b2e (patch)
tree03ea4debaeddf5cf4339facbbcd69e58f30e3a5a /tests/qapi-schema/union-clash-branches.json
parent407efbf9e776ade8e8d09b778851834f91b225a1 (diff)
qapi: Enforce union and alternate branch naming rules
Union branch names should use '-', not '_'. Enforce this. The only offenders are in tests/. Fix them. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-29-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Commit message typo fixed]
Diffstat (limited to 'tests/qapi-schema/union-clash-branches.json')
-rw-r--r--tests/qapi-schema/union-clash-branches.json6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/qapi-schema/union-clash-branches.json b/tests/qapi-schema/union-clash-branches.json
index 3bece8c948..7bdda0b0da 100644
--- a/tests/qapi-schema/union-clash-branches.json
+++ b/tests/qapi-schema/union-clash-branches.json
@@ -1,5 +1,7 @@
# Union branch name collision
-# Reject a union that would result in a collision in generated C names (this
-# would try to generate two members 'a_b').
+# Naming rules make collision impossible (even with the pragma). If
+# that wasn't the case, then we'd get collisions in generated C: two
+# union members a_b, and two enum members TEST_UNION_A_B.
+{ 'pragma': { 'member-name-exceptions': [ 'TestUnion' ] } }
{ 'union': 'TestUnion',
'data': { 'a-b': 'int', 'a_b': 'str' } }