From ef8b3829f6d194c856d7db34e14117e8ed90a396 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 23 Mar 2021 10:40:15 +0100 Subject: 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 --- tests/qapi-schema/meson.build | 2 +- tests/qapi-schema/returns-bad-type.err | 2 ++ tests/qapi-schema/returns-bad-type.json | 15 +++++++++++++++ tests/qapi-schema/returns-bad-type.out | 0 tests/qapi-schema/returns-whitelist.err | 2 -- tests/qapi-schema/returns-whitelist.json | 15 --------------- tests/qapi-schema/returns-whitelist.out | 0 7 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 tests/qapi-schema/returns-bad-type.err create mode 100644 tests/qapi-schema/returns-bad-type.json create mode 100644 tests/qapi-schema/returns-bad-type.out delete mode 100644 tests/qapi-schema/returns-whitelist.err delete mode 100644 tests/qapi-schema/returns-whitelist.json delete mode 100644 tests/qapi-schema/returns-whitelist.out (limited to 'tests/qapi-schema') diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index ffc276b..4e7635f 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 0000000..2c270de --- /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 0000000..da20932 --- /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 0000000..e69de29 diff --git a/tests/qapi-schema/returns-whitelist.err b/tests/qapi-schema/returns-whitelist.err deleted file mode 100644 index c6e46b9..0000000 --- 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 da20932..0000000 --- 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 e69de29..0000000 -- cgit v1.1