X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fctf-writer%2Fctf_writer.c;h=c8fab1b7ce48695c8a68abe5788b4ccda3e8653e;hb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;hp=91b2e6337d406cde49b4dbac3199b223617dbb88;hpb=2242b43d4f50ebdeabb124154fb8ac602c563536;p=babeltrace.git diff --git a/tests/ctf-writer/ctf_writer.c b/tests/ctf-writer/ctf_writer.c index 91b2e633..c8fab1b7 100644 --- a/tests/ctf-writer/ctf_writer.c +++ b/tests/ctf-writer/ctf_writer.c @@ -1,22 +1,7 @@ /* - * test_ctf_writer.c + * SPDX-License-Identifier: GPL-2.0-only * - * CTF Writer test - * - * Copyright 2013 - 2017 - Jérémie Galarneau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; under version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Copyright (C) 2013-2017 Jérémie Galarneau */ #include @@ -97,7 +82,7 @@ void validate_trace(char *parser_path, char *trace_path) { int ret = 0; gint exit_status; - char *argv[] = {parser_path, trace_path, "-o", "dummy", NULL}; + const char *argv[] = {parser_path, trace_path, "-o", "dummy", NULL}; if (!parser_path || !trace_path) { ret = -1; @@ -105,7 +90,7 @@ void validate_trace(char *parser_path, char *trace_path) } if (!g_spawn_sync(NULL, - argv, + (gchar **) argv, NULL, G_SPAWN_STDOUT_TO_DEV_NULL, NULL, @@ -659,11 +644,11 @@ void append_complex_event(struct bt_ctf_stream_class *stream_class, "bt_ctf_event_class_set_log_level succeeds with a valid log level"); ok(bt_ctf_event_class_get_log_level(event_class) == BT_CTF_EVENT_CLASS_LOG_LEVEL_INFO, "bt_ctf_event_class_get_log_level returns the expected log level"); - ok(bt_ctf_event_class_set_emf_uri(NULL, "http://diamon.org/babeltrace/"), + ok(bt_ctf_event_class_set_emf_uri(NULL, "https://babeltrace.org/"), "bt_ctf_event_class_set_emf_uri handles a NULL event class correctly"); - ok(!bt_ctf_event_class_set_emf_uri(event_class, "http://diamon.org/babeltrace/"), + ok(!bt_ctf_event_class_set_emf_uri(event_class, "https://babeltrace.org/"), "bt_ctf_event_class_set_emf_uri succeeds with a valid EMF URI"); - ok(strcmp(bt_ctf_event_class_get_emf_uri(event_class), "http://diamon.org/babeltrace/") == 0, + ok(strcmp(bt_ctf_event_class_get_emf_uri(event_class), "https://babeltrace.org/") == 0, "bt_ctf_event_class_get_emf_uri returns the expected EMF URI"); ok(!bt_ctf_event_class_set_emf_uri(event_class, NULL), "bt_ctf_event_class_set_emf_uri succeeds with NULL (to reset)"); @@ -681,7 +666,7 @@ void append_complex_event(struct bt_ctf_stream_class *stream_class, "bt_ctf_event_class_get_stream_class returns the correct stream class"); bt_ctf_object_put_ref(ret_stream_class); - ok(bt_ctf_event_class_get_field_by_name(event_class, "truie") == NULL, + ok(!bt_ctf_event_class_get_field_by_name(event_class, "truie"), "bt_ctf_event_class_get_field_by_name handles an invalid field name correctly"); ret_field_type = bt_ctf_event_class_get_field_by_name(event_class, "complex_structure"); @@ -836,7 +821,7 @@ void append_complex_event(struct bt_ctf_stream_class *stream_class, } static -void type_field_tests() +void type_field_tests(void) { struct bt_ctf_field *uint_12; struct bt_ctf_field *int_16; @@ -1217,7 +1202,7 @@ void test_empty_stream(struct bt_ctf_writer *writer) ret = bt_ctf_stream_class_set_event_header_type(stream_class, NULL); BT_ASSERT(ret == 0); - ok(bt_ctf_stream_class_get_trace(stream_class) == NULL, + ok(!bt_ctf_stream_class_get_trace(stream_class), "bt_ctf_stream_class_get_trace returns NULL when stream class is orphaned"); stream = bt_ctf_writer_create_stream(writer, stream_class); @@ -1711,7 +1696,7 @@ int main(int argc, char **argv) name.machine); /* Define a clock and add it to the trace */ - ok(bt_ctf_clock_create("signed") == NULL, + ok(!bt_ctf_clock_create("signed"), "Illegal clock name rejected"); clock = bt_ctf_clock_create(clock_name); ok(clock, "Clock created sucessfully"); @@ -1798,9 +1783,9 @@ int main(int argc, char **argv) ok(ret_string && strcmp(ret_string, "test_stream") == 0, "bt_ctf_stream_class_get_name returns a correct stream class name"); - ok(bt_ctf_stream_class_get_clock(stream_class) == NULL, + ok(!bt_ctf_stream_class_get_clock(stream_class), "bt_ctf_stream_class_get_clock returns NULL when a clock was not set"); - ok(bt_ctf_stream_class_get_clock(NULL) == NULL, + ok(!bt_ctf_stream_class_get_clock(NULL), "bt_ctf_stream_class_get_clock handles NULL correctly"); ok(stream_class, "Create stream class"); @@ -2001,7 +1986,7 @@ int main(int argc, char **argv) "Changes to a stream class that was already instantiated fail"); /* Populate the custom packet header field only once for all tests */ - ok(bt_ctf_stream_get_packet_header(NULL) == NULL, + ok(!bt_ctf_stream_get_packet_header(NULL), "bt_ctf_stream_get_packet_header handles NULL correctly"); packet_header = bt_ctf_stream_get_packet_header(stream1); ok(packet_header,