From: Philippe Proulx Date: Thu, 11 May 2017 05:12:20 +0000 (-0400) Subject: test_ctf_writer.c: remove negative index tests X-Git-Tag: v2.0.0-pre1~296 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=e9409ac39d5d8a0a269fae703c8ea9ae8e89183e test_ctf_writer.c: remove negative index tests The API's type for indexes is always an unsigned integer now, so we don't need those tests anymore. Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/tests/lib/test_ctf_writer.c b/tests/lib/test_ctf_writer.c index 80e49ca4..324158d4 100644 --- a/tests/lib/test_ctf_writer.c +++ b/tests/lib/test_ctf_writer.c @@ -61,7 +61,7 @@ #define DEFAULT_CLOCK_TIME 0 #define DEFAULT_CLOCK_VALUE 0 -#define NR_TESTS 612 +#define NR_TESTS 609 static int64_t current_time = 42; @@ -2974,8 +2974,6 @@ int main(int argc, char **argv) /* Test bt_ctf_trace_get_environment_field_name */ ok(bt_ctf_trace_get_environment_field_name_by_index(NULL, 0) == NULL, "bt_ctf_trace_get_environment_field_name handles a NULL trace correctly"); - ok(bt_ctf_trace_get_environment_field_name_by_index(trace, -1) == NULL, - "bt_ctf_trace_get_environment_field_name handles an invalid index correctly (negative)"); ok(bt_ctf_trace_get_environment_field_name_by_index(trace, 5) == NULL, "bt_ctf_trace_get_environment_field_name handles an invalid index correctly (too large)"); ret_string = bt_ctf_trace_get_environment_field_name_by_index(trace, 0); @@ -2997,8 +2995,6 @@ int main(int argc, char **argv) /* Test bt_ctf_trace_get_environment_field_value */ ok(bt_ctf_trace_get_environment_field_value_by_index(NULL, 0) == NULL, "bt_ctf_trace_get_environment_field_value handles a NULL trace correctly"); - ok(bt_ctf_trace_get_environment_field_value_by_index(trace, -1) == NULL, - "bt_ctf_trace_get_environment_field_value handles an invalid index correctly (negative)"); ok(bt_ctf_trace_get_environment_field_value_by_index(trace, 5) == NULL, "bt_ctf_trace_get_environment_field_value handles an invalid index correctly (too large)"); obj = bt_ctf_trace_get_environment_field_value_by_index(trace, 1); @@ -3356,8 +3352,6 @@ int main(int argc, char **argv) "bt_ctf_trace_get_clock_class_count returns the correct number of clocks"); ok(!bt_ctf_trace_get_clock_class_by_index(NULL, 0), "bt_ctf_trace_get_clock_class correctly handles NULL"); - ok(!bt_ctf_trace_get_clock_class_by_index(trace, -1), - "bt_ctf_trace_get_clock_class correctly handles negative indexes"); ok(!bt_ctf_trace_get_clock_class_by_index(trace, 1), "bt_ctf_trace_get_clock_class correctly handles out of bound accesses"); ret_clock_class = bt_ctf_trace_get_clock_class_by_index(trace, 0);