ir: add tests for bt_ctf_trace_get_clock_by_name()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 16 Mar 2015 22:56:26 +0000 (18:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 17 Mar 2015 02:45:43 +0000 (22:45 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/lib/test_ctf_writer.c

index ff7f47ee1e0f83684becf163465e2d9b8c3f5f24..c4512cb39dd0d55770d150f853443aab2b6f5989 100644 (file)
@@ -1866,6 +1866,18 @@ int main(int argc, char **argv)
        ok(ret_clock == clock,
                "bt_ctf_trace_get_clock returns the right clock instance");
        bt_ctf_clock_put(ret_clock);
+       ok(!bt_ctf_trace_get_clock_by_name(trace, NULL),
+               "bt_ctf_trace_get_clock_by_name correctly handles NULL (trace)");
+       ok(!bt_ctf_trace_get_clock_by_name(NULL, clock_name),
+               "bt_ctf_trace_get_clock_by_name correctly handles NULL (clock name)");
+       ok(!bt_ctf_trace_get_clock_by_name(NULL, NULL),
+               "bt_ctf_trace_get_clock_by_name correctly handles NULL (both)");
+       ret_clock = bt_ctf_trace_get_clock_by_name(trace, clock_name);
+       ok(ret_clock == clock,
+               "bt_ctf_trace_get_clock_by_name returns the right clock instance");
+       bt_ctf_clock_put(ret_clock);
+       ok(!bt_ctf_trace_get_clock_by_name(trace, "random"),
+               "bt_ctf_trace_get_clock_by_name fails when the requested clock doesn't exist");
 
        ok(!bt_ctf_clock_get_name(NULL),
                "bt_ctf_clock_get_name correctly handles NULL");
This page took 0.026909 seconds and 4 git commands to generate.