tests: A few check-qom-proplist fixes
cover tests: A few check-qom-proplist fixes
A few fixes on check-qom-proplist that will ensure we test both class properties and object properties, and catch errors when registering properties in test code.
Eduardo Habkost (2):
tests: check-qom-proplist: Remove "bv" class property from class
tests: check-qom-proplist: Use &error_abort to catch errors
tests/check-qom-proplist.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/2 tests: check-qom-proplist: Remove "bv" class property from class
The object_property_add_bool() call in dummy_init() was always failing because there was a "bv" class property already. Remove the class property so both object properties and class properties are covered by the test code.
--- tests/check-qom-proplist.c | 4 ---- 1 file changed, 4 deletions(-)
tests/check-qom-proplist.c +0 -4
@@ -129,10 +129,6 @@ static void dummy_init(Object *obj)static void dummy_class_init (ObjectClass *cls,void *data) { -object_class_property_add_bool (cls,"bv" , - dummy_get_bv, - dummy_set_bv, -NULL ); object_class_property_add_str(cls, "sv", dummy_get_sv, dummy_set_sv,
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH 1/2] tests: check-qom-proplist: Remove "bv" class property from class
Quoted 9 lines · Eduardo Habkost
The
object_property_add_bool()call indummy_init()was always failing because there was a "bv" class property already. Remove the class property so both object properties and class properties are covered by the test code.Signed-off-by Eduardo Habkost <[email protected]>--- tests/check-qom-proplist.c | 4 ---- 1 file changed, 4 deletions(-)
Regards,
Daniel
Signature · 3 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
PATCH 2/2 tests: check-qom-proplist: Use &error_abort to catch errors
In reply to Eduardo HabkostUse &error_abort so we don't ignore any errors on the property registration calls.
--- tests/check-qom-proplist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/check-qom-proplist.c +3 -3
@@ -123,7 +123,7 @@ static void dummy_init(Object *obj)object_property_add_bool (obj,"bv" , dummy_get_bv, dummy_set_bv, -NULL ); + &error_abort); }
@@ -132,13 +132,13 @@ static void dummy_class_init(ObjectClass *cls, void *data)object_class_property_add_str (cls,"sv" , dummy_get_sv, dummy_set_sv, -NULL ); + &error_abort);object_class_property_add_enum (cls,"av" ,"DummyAnimal" , dummy_animal_map, dummy_get_av, dummy_set_av, -NULL ); + &error_abort); }
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH 2/2] tests: check-qom-proplist: Use &error_abort to catch errors
Quoted 7 lines · Eduardo Habkost
Use
&error_abortso we don't ignore any errors on the property registration calls.Signed-off-by Eduardo Habkost <[email protected]>--- tests/check-qom-proplist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Regards,
Daniel
Signature · 3 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
Ping?
Markus, do you want to merge this through your tree?
Quoted 14 lines · Eduardo Habkost
A few fixes on check-qom-proplist that will ensure we test both class properties and object properties, and catch errors when registering properties in test code.
Eduardo Habkost (2):
tests: check-qom-proplist: Remove "bv" class property from class
tests: check-qom-proplist: Use&error_abortto catch errorstests/check-qom-proplist.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)Signature · 1 line
2.7.4
Signature · 1 line
Eduardo
Andreas Färber
Reviewed-byAm 17.10.2016 um 23:02 schrieb Eduardo Habkost:
Quoted 11 lines
Ping?
Markus, do you want to merge this through your tree?
Quoted 6 lines · Eduardo Habkost
A few fixes on check-qom-proplist that will ensure we test both class properties and object properties, and catch errors when registering properties in test code.
Eduardo Habkost (2):
tests: check-qom-proplist: Remove "bv" class property from class
This part I didn't quite understand from looking at the patch, but...
Quoted 1 line
Quoted 1 line
tests: check-qom-proplist: Use
&error_abortto catch errors
For this one:
Regards,
Andreas
Quoted 2 lines
Quoted 2 lines
tests/check-qom-proplist.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)
Quoted 6 lines · Andreas Färber
Am 17.10.2016 um 23:02 schrieb Eduardo Habkost:
Quoted 5 lines
Ping?
Markus, do you want to merge this through your tree?
On Tue, Oct 11, 2016 at 09:37:45AM -0300, Eduardo Habkost wrote:
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
A few fixes on check-qom-proplist that will ensure we test both class properties and object properties, and catch errors when registering properties in test code.
Eduardo Habkost (2):
tests: check-qom-proplist: Remove "bv" class property from classThis part I didn't quite understand from looking at the patch, but...
The "bv" property was being registered twice (as class property and as instance property). The instance property registration was always failing because of that.
One of them has to go away. I decided to remove the class property because this allows the test code to cover both instance properties ("bv") and class properties ("sv").
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
tests: check-qom-proplist: Use
&error_abortto catch errorsFor this one:
Reviewed-by Andreas Färber <[email protected]>
Thanks!
Signature · 1 line
Eduardo
Pinging again.
Quoted 23 lines · Eduardo Habkost
Ping?
Markus, do you want to merge this through your tree?
Quoted 14 lines · Eduardo Habkost
A few fixes on check-qom-proplist that will ensure we test both class properties and object properties, and catch errors when registering properties in test code.
Eduardo Habkost (2):
tests: check-qom-proplist: Remove "bv" class property from class
tests: check-qom-proplist: Use&error_abortto catch errorstests/check-qom-proplist.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)Signature · 1 line
2.7.4Signature · 1 line
Eduardo
Signature · 1 line
Eduardo
Quoted 3 lines · Eduardo Habkost
A few fixes on check-qom-proplist that will ensure we test both class properties and object properties, and catch errors when registering properties in test code.
Series
Excessively long delay considering how simple these patches are. My apologies.