ir: add tests for bt_ctf_field_variant_get_current_field()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 25 May 2015 00:33:37 +0000 (20:33 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 25 May 2015 20:23:32 +0000 (16:23 -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 368c1e9fc20a12a9584f6ea5b4814380ffd8f549..12766db9fea0c9fe0a97bb90957f9ae0836fb3f2 100644 (file)
@@ -1334,6 +1334,7 @@ void field_copy_tests()
        struct bt_ctf_field *e = NULL;
        struct bt_ctf_field *v = NULL;
        struct bt_ctf_field *v_selected = NULL;
+       struct bt_ctf_field *v_selected_cur = NULL;
        struct bt_ctf_field *v_selected_0 = NULL;
        struct bt_ctf_field *v_selected_1 = NULL;
        struct bt_ctf_field *v_selected_2 = NULL;
@@ -1497,6 +1498,12 @@ void field_copy_tests()
        /* set v field */
        v_selected = bt_ctf_field_variant_get_field(v, e);
        assert(v_selected);
+       ok(!bt_ctf_field_variant_get_current_field(NULL),
+               "bt_ctf_field_variant_get_current_field handles NULL correctly");
+       v_selected_cur = bt_ctf_field_variant_get_current_field(v);
+       ok(v_selected_cur == v_selected,
+               "bt_ctf_field_variant_get_current_field returns the current field");
+       bt_ctf_field_put(v_selected_cur);
 
        /* set selected v field */
        ret = bt_ctf_field_sequence_set_length(v_selected, len);
This page took 0.026363 seconds and 4 git commands to generate.