tests/qapi-schema: Rename a few conditionals
commit40e350f0cc580c722499e9f7061ef7cb5824d047
authorMarkus Armbruster <armbru@redhat.com>
Thu, 16 Mar 2023 07:13:21 +0000 (16 08:13 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 24 Apr 2023 13:21:39 +0000 (24 15:21 +0200)
tree6c522f8f158aebf2c04ff87c585fa426f96420b4
parent8fba2f737a372be07739aefeea16c09614a152f0
tests/qapi-schema: Rename a few conditionals

Positive test case

    { 'enum': 'TestIfEnum',
      'data': [ 'foo', { 'name' : 'bar', 'if': 'TEST_IF_ENUM_BAR' } ],
      'if': 'TEST_IF_ENUM' }

generates

    #if defined(TEST_IF_ENUM)
    typedef enum TestIfEnum {
TEST_IF_ENUM_FOO,
    #if defined(TEST_IF_ENUM_BAR)
TEST_IF_ENUM_BAR,
    #endif /* defined(TEST_IF_ENUM_BAR) */
TEST_IF_ENUM__MAX,
    } TestIfEnum;

Macro TEST_IF_ENUM_BAR clashes with the enumeration constant.
Wouldn't compile with -DTEST_IF_BAR.

Rename the macro to TEST_IF_ENUM_MEMBER.  For consistency, rename
similar macros elsewhere as well.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-11-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
tests/qapi-schema/qapi-schema-test.json
tests/qapi-schema/qapi-schema-test.out