Skip to contentSkip to conversation

tests: A few check-qom-proplist fixes

PATCH In review Eduardo Habkost 4 participants 10 messages Oct 11, 2016 – Nov 3, 2016

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index a16cefc..693dc4c 100644
@@ -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
Reviewed-by on v1 1/2
#2 lore raw

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 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(-)

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/ :|
#3 lore raw

PATCH 2/2 tests: check-qom-proplist: Use &error_abort to catch errors

In reply to Eduardo Habkost

Use &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
index 693dc4c..a92acc9 100644
@@ -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
Reviewed-by on v1 2/2
#4 lore raw

Re: [Qemu-devel] [PATCH 2/2] tests: check-qom-proplist: Use &error_abort to catch errors

Quoted 7 lines · Eduardo Habkost

Use &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(-)

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/ :|
#5 lore raw
In reply to 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_abort to catch errors

 tests/check-qom-proplist.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
Signature · 1 line
2.7.4
Signature · 1 line
Eduardo
Reviewed-by
#6 lore raw

Am 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_abort to 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)
#7 lore raw
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 class

This 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_abort to catch errors

For this one:

Thanks!

Signature · 1 line
Eduardo
#8 lore raw
In reply to Eduardo Habkost

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_abort to catch errors

 tests/check-qom-proplist.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
Signature · 1 line
2.7.4
Signature · 1 line
Eduardo
Signature · 1 line
Eduardo