Re: [Qemu-devel] [PATCH v9 04/27] qapi: Simplify error testing in test-qmp-*

2015-11-05 Thread Eric Blake
On 11/05/2015 12:53 AM, Markus Armbruster wrote: > Eric Blake writes: > >> On 11/04/2015 01:40 AM, Markus Armbruster wrote: >> >>> By moving err into data, we can let test teardown take care of cleaning up any collected error; it also gives us fewer lines of code between repeated t

Re: [Qemu-devel] [PATCH v9 04/27] qapi: Simplify error testing in test-qmp-*

2015-11-04 Thread Markus Armbruster
Eric Blake writes: > On 11/04/2015 01:40 AM, Markus Armbruster wrote: > >> >>> By moving err into data, we can let test teardown take care >>> of cleaning up any collected error; it also gives us fewer >>> lines of code between repeated tests where init runs teardown >>> on our behalf. >> >> Th

Re: [Qemu-devel] [PATCH v9 04/27] qapi: Simplify error testing in test-qmp-*

2015-11-04 Thread Eric Blake
On 11/04/2015 01:40 AM, Markus Armbruster wrote: > >> By moving err into data, we can let test teardown take care >> of cleaning up any collected error; it also gives us fewer >> lines of code between repeated tests where init runs teardown >> on our behalf. > > This part isn't as obvious. > >

Re: [Qemu-devel] [PATCH v9 04/27] qapi: Simplify error testing in test-qmp-*

2015-11-04 Thread Markus Armbruster
Eric Blake writes: > By using &error_abort, we can avoid a local err variable in > situations where we expect success. This part is a no-brainer. Bonus: before we abort(), we print Unexpected error in FUNC() at FILE:LINE: THE-ERROR-MESSAGE to stdout on unexpected errors, which is a wh

[Qemu-devel] [PATCH v9 04/27] qapi: Simplify error testing in test-qmp-*

2015-11-03 Thread Eric Blake
By using &error_abort, we can avoid a local err variable in situations where we expect success. By moving err into data, we can let test teardown take care of cleaning up any collected error; it also gives us fewer lines of code between repeated tests where init runs teardown on our behalf. Signe