[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 32/54] qapi: add 'if' to struct members
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v2 32/54] qapi: add 'if' to struct members |
Date: |
Thu, 07 Sep 2017 17:52:10 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Marc-André Lureau <address@hidden> writes:
> Hi
>
> ----- Original Message -----
>> Marc-André Lureau <address@hidden> writes:
[...]
>> > diff --git a/tests/qapi-schema/test-qapi.py
>> > b/tests/qapi-schema/test-qapi.py
>> > index 70054848f0..5d2f67a1d3 100644
>> > --- a/tests/qapi-schema/test-qapi.py
>> > +++ b/tests/qapi-schema/test-qapi.py
>> > @@ -31,7 +31,8 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
>> > print ' base %s' % base.name
>> > for m in members:
>> > print ' member %s: %s optional=%s' % \
>> > - (m.name, m.type.name, m.optional)
>> > + (m.name, m.type.name, m.optional) + \
>> > + (' if=%s' % m.ifcond if m.ifcond else '')
>>
>> Let's keep it simple & stupid:
>>
>> print ' member %s: %s optional=%s if=%s' % \
>> (m.name, m.type.name, m.optional, m.ifcond)
>>
>
> I would rather not modify every existing test please.
>
> The last version of the series uses the trailing , trick instead:
>
> print '%s optional=%s' % (m.type.name, m.optional),
> if m.ifcond:
> print 'if=%s' % m.ifcond,
> print
>
> I think this is easier to deal with, is that ok for you too?
Yes.
>> > self._print_variants(variants)
>> > self._print_if(ifcond)
>>
>> Need negative tests, but I guess they're next.
>>