From: Markus Armbruster Date: Tue, 23 Mar 2021 09:40:15 +0000 (+0100) Subject: tests/qapi-schema: Rename returns-whitelist to returns-bad-type X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ef8b3829f6d194c856d7db34e14117e8ed90a396;p=qemu.git tests/qapi-schema: Rename returns-whitelist to returns-bad-type This test covers returning "bad" types. Pragma returns-whitelist is just one aspect. Naming it returns-whitelist is suboptimal. Rename to returns-bad-type. Signed-off-by: Markus Armbruster Message-Id: <20210323094025.3569441-19-armbru@redhat.com> Reviewed-by: Eric Blake --- diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index ffc276b765..4e7635f0a8 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -166,9 +166,9 @@ schemas = [ 'reserved-type-list.json', 'returns-alternate.json', 'returns-array-bad.json', + 'returns-bad-type.json', 'returns-dict.json', 'returns-unknown.json', - 'returns-whitelist.json', 'string-code-point-31.json', 'string-code-point-127.json', 'struct-base-clash-deep.json', diff --git a/tests/qapi-schema/returns-bad-type.err b/tests/qapi-schema/returns-bad-type.err new file mode 100644 index 0000000000..2c270de9ad --- /dev/null +++ b/tests/qapi-schema/returns-bad-type.err @@ -0,0 +1,2 @@ +returns-bad-type.json: In command 'no-way-this-will-get-whitelisted': +returns-bad-type.json:14: command's 'returns' cannot take array type ['int'] diff --git a/tests/qapi-schema/returns-bad-type.json b/tests/qapi-schema/returns-bad-type.json new file mode 100644 index 0000000000..da209329b1 --- /dev/null +++ b/tests/qapi-schema/returns-bad-type.json @@ -0,0 +1,15 @@ +# we enforce that 'returns' be a dict or array of dict unless whitelisted + +{ 'pragma': { 'returns-whitelist': [ + 'human-monitor-command', 'query-tpm-models', 'guest-get-time' ] } } + +{ 'command': 'human-monitor-command', + 'data': {'command-line': 'str', '*cpu-index': 'int'}, + 'returns': 'str' } +{ 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] } +{ 'command': 'query-tpm-models', 'returns': ['TpmModel'] } +{ 'command': 'guest-get-time', + 'returns': 'int' } + +{ 'command': 'no-way-this-will-get-whitelisted', + 'returns': [ 'int' ] } diff --git a/tests/qapi-schema/returns-bad-type.out b/tests/qapi-schema/returns-bad-type.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/qapi-schema/returns-whitelist.err b/tests/qapi-schema/returns-whitelist.err deleted file mode 100644 index c6e46b9b86..0000000000 --- a/tests/qapi-schema/returns-whitelist.err +++ /dev/null @@ -1,2 +0,0 @@ -returns-whitelist.json: In command 'no-way-this-will-get-whitelisted': -returns-whitelist.json:14: command's 'returns' cannot take array type ['int'] diff --git a/tests/qapi-schema/returns-whitelist.json b/tests/qapi-schema/returns-whitelist.json deleted file mode 100644 index da209329b1..0000000000 --- a/tests/qapi-schema/returns-whitelist.json +++ /dev/null @@ -1,15 +0,0 @@ -# we enforce that 'returns' be a dict or array of dict unless whitelisted - -{ 'pragma': { 'returns-whitelist': [ - 'human-monitor-command', 'query-tpm-models', 'guest-get-time' ] } } - -{ 'command': 'human-monitor-command', - 'data': {'command-line': 'str', '*cpu-index': 'int'}, - 'returns': 'str' } -{ 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] } -{ 'command': 'query-tpm-models', 'returns': ['TpmModel'] } -{ 'command': 'guest-get-time', - 'returns': 'int' } - -{ 'command': 'no-way-this-will-get-whitelisted', - 'returns': [ 'int' ] } diff --git a/tests/qapi-schema/returns-whitelist.out b/tests/qapi-schema/returns-whitelist.out deleted file mode 100644 index e69de29bb2..0000000000