[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 22/50] tests: add some enum members tests
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v3 22/50] tests: add some enum members tests |
Date: |
Fri, 08 Dec 2017 18:58:09 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Marc-André Lureau <address@hidden> writes:
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
> tests/Makefile.include | 3 +++
> tests/qapi-schema/enum-dict-member-invalid.err | 1 +
> tests/qapi-schema/enum-dict-member-invalid.exit | 1 +
> tests/qapi-schema/enum-dict-member-invalid.json | 2 ++
> tests/qapi-schema/enum-dict-member-invalid.out | 0
> tests/qapi-schema/enum-dict-member-invalid2.err | 1 +
> tests/qapi-schema/enum-dict-member-invalid2.exit | 1 +
> tests/qapi-schema/enum-dict-member-invalid2.json | 2 ++
> tests/qapi-schema/enum-dict-member-invalid2.out | 0
> tests/qapi-schema/enum-if-invalid.err | 1 +
> tests/qapi-schema/enum-if-invalid.exit | 1 +
> tests/qapi-schema/enum-if-invalid.json | 3 +++
> tests/qapi-schema/enum-if-invalid.out | 0
> 13 files changed, 16 insertions(+)
> create mode 100644 tests/qapi-schema/enum-dict-member-invalid.err
> create mode 100644 tests/qapi-schema/enum-dict-member-invalid.exit
> create mode 100644 tests/qapi-schema/enum-dict-member-invalid.json
> create mode 100644 tests/qapi-schema/enum-dict-member-invalid.out
> create mode 100644 tests/qapi-schema/enum-dict-member-invalid2.err
> create mode 100644 tests/qapi-schema/enum-dict-member-invalid2.exit
> create mode 100644 tests/qapi-schema/enum-dict-member-invalid2.json
> create mode 100644 tests/qapi-schema/enum-dict-member-invalid2.out
> create mode 100644 tests/qapi-schema/enum-if-invalid.err
> create mode 100644 tests/qapi-schema/enum-if-invalid.exit
> create mode 100644 tests/qapi-schema/enum-if-invalid.json
> create mode 100644 tests/qapi-schema/enum-if-invalid.out
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index a9f0ddbe01..0aa532f029 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -443,6 +443,9 @@ qapi-schema += empty.json
> qapi-schema += enum-bad-name.json
> qapi-schema += enum-bad-prefix.json
> qapi-schema += enum-clash-member.json
> +qapi-schema += enum-dict-member-invalid.json
> +qapi-schema += enum-dict-member-invalid2.json
> +qapi-schema += enum-if-invalid.json
> qapi-schema += enum-int-member.json
> qapi-schema += enum-member-case.json
> qapi-schema += enum-missing-data.json
> diff --git a/tests/qapi-schema/enum-dict-member-invalid.err
> b/tests/qapi-schema/enum-dict-member-invalid.err
> new file mode 100644
> index 0000000000..d12cca0df3
> --- /dev/null
> +++ b/tests/qapi-schema/enum-dict-member-invalid.err
> @@ -0,0 +1 @@
> +tests/qapi-schema/enum-dict-member-invalid.json:2: Dictionary member of enum
> 'MyEnum' must have a 'name' key
> diff --git a/tests/qapi-schema/enum-dict-member-invalid.exit
> b/tests/qapi-schema/enum-dict-member-invalid.exit
> new file mode 100644
> index 0000000000..d00491fd7e
> --- /dev/null
> +++ b/tests/qapi-schema/enum-dict-member-invalid.exit
> @@ -0,0 +1 @@
> +1
> diff --git a/tests/qapi-schema/enum-dict-member-invalid.json
> b/tests/qapi-schema/enum-dict-member-invalid.json
> new file mode 100644
> index 0000000000..9cf8406867
> --- /dev/null
> +++ b/tests/qapi-schema/enum-dict-member-invalid.json
> @@ -0,0 +1,2 @@
> +# we reject any enum member that is not a string or a dict with 'name'
> +{ 'enum': 'MyEnum', 'data': [ { 'value': 'str' } ] }
> diff --git a/tests/qapi-schema/enum-dict-member-invalid.out
> b/tests/qapi-schema/enum-dict-member-invalid.out
> new file mode 100644
> index 0000000000..e69de29bb2
> diff --git a/tests/qapi-schema/enum-dict-member-invalid2.err
> b/tests/qapi-schema/enum-dict-member-invalid2.err
> new file mode 100644
> index 0000000000..f7dc1a2b33
> --- /dev/null
> +++ b/tests/qapi-schema/enum-dict-member-invalid2.err
> @@ -0,0 +1 @@
> +tests/qapi-schema/enum-dict-member-invalid2.json:2: Dictionnary has unknown
> keys: bad-key (allowed: name, if)
> diff --git a/tests/qapi-schema/enum-dict-member-invalid2.exit
> b/tests/qapi-schema/enum-dict-member-invalid2.exit
> new file mode 100644
> index 0000000000..d00491fd7e
> --- /dev/null
> +++ b/tests/qapi-schema/enum-dict-member-invalid2.exit
> @@ -0,0 +1 @@
> +1
> diff --git a/tests/qapi-schema/enum-dict-member-invalid2.json
> b/tests/qapi-schema/enum-dict-member-invalid2.json
> new file mode 100644
> index 0000000000..6664c59201
> --- /dev/null
> +++ b/tests/qapi-schema/enum-dict-member-invalid2.json
> @@ -0,0 +1,2 @@
> +# we reject any enum member that is not a string or a dict with 'name'
> +{ 'enum': 'MyEnum', 'data': [ { 'name': 'foo', 'bad-key': 'str' } ] }
> diff --git a/tests/qapi-schema/enum-dict-member-invalid2.out
> b/tests/qapi-schema/enum-dict-member-invalid2.out
> new file mode 100644
> index 0000000000..e69de29bb2
> diff --git a/tests/qapi-schema/enum-if-invalid.err
> b/tests/qapi-schema/enum-if-invalid.err
> new file mode 100644
> index 0000000000..54c3cf887b
> --- /dev/null
> +++ b/tests/qapi-schema/enum-if-invalid.err
> @@ -0,0 +1 @@
> +tests/qapi-schema/enum-if-invalid.json:2: 'if' condition must be a string or
> a list of strings
> diff --git a/tests/qapi-schema/enum-if-invalid.exit
> b/tests/qapi-schema/enum-if-invalid.exit
> new file mode 100644
> index 0000000000..d00491fd7e
> --- /dev/null
> +++ b/tests/qapi-schema/enum-if-invalid.exit
> @@ -0,0 +1 @@
> +1
> diff --git a/tests/qapi-schema/enum-if-invalid.json
> b/tests/qapi-schema/enum-if-invalid.json
> new file mode 100644
> index 0000000000..60bd0ef1d7
> --- /dev/null
> +++ b/tests/qapi-schema/enum-if-invalid.json
> @@ -0,0 +1,3 @@
> +# check invalid 'if' type
> +{ 'enum': 'TestIfEnum', 'data':
> + [ 'foo', { 'name' : 'bar', 'if': { 'val': 'foo' } } ] }
> diff --git a/tests/qapi-schema/enum-if-invalid.out
> b/tests/qapi-schema/enum-if-invalid.out
> new file mode 100644
> index 0000000000..e69de29bb2
These tests are related to the coverage gap I mentioned in my review of
PATCH 19.
I think it makes sense to add related new tests together, right when we
add whatever they test.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v3 22/50] tests: add some enum members tests,
Markus Armbruster <=