[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/5] tests/qapi-schema: Cover 'not' condition with empty argument
From: |
Markus Armbruster |
Subject: |
[PATCH 4/5] tests/qapi-schema: Cover 'not' condition with empty argument |
Date: |
Wed, 8 Sep 2021 06:54:27 +0200 |
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>
---
tests/qapi-schema/bad-if-not.err | 2 ++
tests/qapi-schema/bad-if-not.json | 3 +++
tests/qapi-schema/bad-if-not.out | 0
tests/qapi-schema/meson.build | 1 +
4 files changed, 6 insertions(+)
create mode 100644 tests/qapi-schema/bad-if-not.err
create mode 100644 tests/qapi-schema/bad-if-not.json
create mode 100644 tests/qapi-schema/bad-if-not.out
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
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',
--
2.31.1
- [PATCH 0/5] qapi: Another round of minor fixes and cleanups, Markus Armbruster, 2021/09/08
- [PATCH 4/5] tests/qapi-schema: Cover 'not' condition with empty argument,
Markus Armbruster <=
- [PATCH 3/5] qapi: Bury some unused code in class Indentation, Markus Armbruster, 2021/09/08
- [PATCH 5/5] qapi: Fix bogus error for 'if': { 'not': '' }, Markus Armbruster, 2021/09/08
- [PATCH 1/5] qapi: Fix a botched type annotation, Markus Armbruster, 2021/09/08
- [PATCH 2/5] qapi: Drop Indentation.__bool__(), Markus Armbruster, 2021/09/08
- Re: [PATCH 0/5] qapi: Another round of minor fixes and cleanups, Marc-André Lureau, 2021/09/08
- Re: [PATCH 0/5] qapi: Another round of minor fixes and cleanups, Markus Armbruster, 2021/09/13