From 77241071d48404b0a4e3af58147df0e3edf37a59 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 3 Aug 2017 11:39:23 -0400 Subject: [PATCH] Fix: unchecked return value in ctf-writer test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit CID 1376151 (#1 of 1): Unchecked return value (CHECKED_RETURN)38. check_return: Calling bt_ctf_field_type_enumeration_add_mapping_unsigned without checking return value (as is done elsewhere 7 out of 8 times). Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- tests/lib/test_ctf_writer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/lib/test_ctf_writer.c b/tests/lib/test_ctf_writer.c index d3c7a961..fd73d997 100644 --- a/tests/lib/test_ctf_writer.c +++ b/tests/lib/test_ctf_writer.c @@ -60,7 +60,7 @@ #define DEFAULT_CLOCK_TIME 0 #define DEFAULT_CLOCK_VALUE 0 -#define NR_TESTS 621 +#define NR_TESTS 622 static int64_t current_time = 42; static unsigned int packet_resize_test_length = PACKET_RESIZE_TEST_DEF_LENGTH; @@ -320,8 +320,8 @@ void append_simple_event(struct bt_ctf_stream_class *stream_class, ok(bt_ctf_field_type_enumeration_add_mapping_unsigned(enum_type_unsigned, "event clock int float", 5, 22) == 0, "bt_ctf_field_type_enumeration_add_mapping_unsigned accepts enumeration mapping strings containing reserved keywords"); - bt_ctf_field_type_enumeration_add_mapping_unsigned(enum_type_unsigned, mapping_name_test, - 42, 42); + ok(bt_ctf_field_type_enumeration_add_mapping_unsigned(enum_type_unsigned, mapping_name_test, + 42, 42) == 0, "bt_ctf_field_type_enumeration_add_mapping_unsigned accepts single-value ranges"); ok(bt_ctf_field_type_enumeration_add_mapping_unsigned(enum_type_unsigned, mapping_name_test, 43, 51) == 0, "bt_ctf_field_type_enumeration_add_mapping_unsigned accepts duplicate mapping names"); ok(bt_ctf_field_type_enumeration_add_mapping_unsigned(enum_type_unsigned, "something", -- 2.34.1