bt_ctf_field_type_structure_add_field is not setting the return
value to a negative value if the parameter validation fails. The
function would abort while appearing to have succeeded.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
validate_identifier(field_name) ||
(type->declaration->id != CTF_TYPE_STRUCT) ||
bt_ctf_field_type_validate(field_type)) {
validate_identifier(field_name) ||
(type->declaration->id != CTF_TYPE_STRUCT) ||
bt_ctf_field_type_validate(field_type)) {
ok(!enumeration_array_type,
"Check enumeration types are validated when creating an array");
ok(bt_ctf_field_type_structure_add_field(composite_structure_type,
ok(!enumeration_array_type,
"Check enumeration types are validated when creating an array");
ok(bt_ctf_field_type_structure_add_field(composite_structure_type,
- enumeration_type, "enumeration") == 0,
+ enumeration_type, "enumeration"),
"Check enumeration types are validated when adding them as structure members");
enumeration = bt_ctf_field_create(enumeration_type);
ok(!enumeration,
"Check enumeration types are validated when adding them as structure members");
enumeration = bt_ctf_field_create(enumeration_type);
ok(!enumeration,