From 8c627304e5adb715ef3d359ac24febab2bb279b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 17 Dec 2014 15:26:08 -0500 Subject: [PATCH] Tests fix: Unchecked return value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported by Coverity ** CID 1258705: Unchecked return value (CHECKED_RETURN) Signed-off-by: Jérémie Galarneau --- tests/lib/test_ctf_writer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/lib/test_ctf_writer.c b/tests/lib/test_ctf_writer.c index 608172cf..232a1f91 100644 --- a/tests/lib/test_ctf_writer.c +++ b/tests/lib/test_ctf_writer.c @@ -90,7 +90,7 @@ void validate_metadata(char *parser_path, char *metadata_path) parser_output_fd = mkstemp(parser_output_path); metadata_fd = open(metadata_path, O_RDONLY); - unlink(parser_output_path); + //unlink(parser_output_path); if (parser_output_fd == -1 || metadata_fd == -1) { diag("Failed create temporary files for metadata parsing."); @@ -204,7 +204,7 @@ void validate_trace(char *parser_path, char *trace_path) } babeltrace_output_fd = mkstemp(babeltrace_output_path); - unlink(babeltrace_output_path); + //unlink(babeltrace_output_path); if (babeltrace_output_fd == -1) { diag("Failed to create a temporary file for trace parsing."); @@ -481,8 +481,9 @@ void append_simple_event(struct bt_ctf_stream_class *stream_class, bt_ctf_event_class_put(ret_event_class); /* Set an event context type which will contain a single integer*/ - bt_ctf_field_type_structure_add_field(event_context_type, uint_12_type, - "event_specific_context"); + ok(!bt_ctf_field_type_structure_add_field(event_context_type, uint_12_type, + "event_specific_context"), + "Add event specific context field"); ok(bt_ctf_event_class_get_context_type(NULL) == NULL, "bt_ctf_event_class_get_context_type handles NULL correctly"); ok(bt_ctf_event_class_get_context_type(simple_event_class) == NULL, @@ -1861,7 +1862,7 @@ int main(int argc, char **argv) struct dirent *entry; while ((entry = readdir(trace_dir))) { if (entry->d_type == DT_REG) { - unlinkat(dirfd(trace_dir), entry->d_name, 0); + //unlinkat(dirfd(trace_dir), entry->d_name, 0); } } -- 2.34.1