summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-09-08 06:54:27 +0200
committerMarkus Armbruster <armbru@redhat.com>2021-09-08 15:30:10 +0200
commit71f03ef9f66b020d58acad5227e886102db41127 (patch)
treed910eb158c9f91270b4b4664e6b6b0fe76bf4304
parente2ff14a5740c2fe3714a56221792b6d74bc64c08 (diff)
downloadqemu-71f03ef9f66b020d58acad5227e886102db41127.zip
tests/qapi-schema: Cover 'not' condition with empty argument
We flag this, but the error message is bogus: bad-if-not.json:2: 'if' condition [] of struct is useless The next commit will fix it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210908045428.2689093-5-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r--tests/qapi-schema/bad-if-not.err2
-rw-r--r--tests/qapi-schema/bad-if-not.json3
-rw-r--r--tests/qapi-schema/bad-if-not.out0
-rw-r--r--tests/qapi-schema/meson.build1
4 files changed, 6 insertions, 0 deletions
diff --git a/tests/qapi-schema/bad-if-not.err b/tests/qapi-schema/bad-if-not.err
new file mode 100644
index 0000000000..b3acdd679a
--- /dev/null
+++ b/tests/qapi-schema/bad-if-not.err
@@ -0,0 +1,2 @@
+bad-if-not.json: In struct 'TestIfStruct':
+bad-if-not.json:2: 'if' condition [] of struct is useless
diff --git a/tests/qapi-schema/bad-if-not.json b/tests/qapi-schema/bad-if-not.json
new file mode 100644
index 0000000000..9fdaacc47b
--- /dev/null
+++ b/tests/qapi-schema/bad-if-not.json
@@ -0,0 +1,3 @@
+# check 'if not' with empy argument
+{ 'struct': 'TestIfStruct', 'data': { 'foo': 'int' },
+ 'if': { 'not': '' } }
diff --git a/tests/qapi-schema/bad-if-not.out b/tests/qapi-schema/bad-if-not.out
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/qapi-schema/bad-if-not.out
diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build
index 4697c070bc..6b2a4ce41a 100644
--- a/tests/qapi-schema/meson.build
+++ b/tests/qapi-schema/meson.build
@@ -43,6 +43,7 @@ schemas = [
'bad-if-key.json',
'bad-if-keys.json',
'bad-if-list.json',
+ 'bad-if-not.json',
'bad-type-bool.json',
'bad-type-dict.json',
'bad-type-int.json',