From: Philippe Proulx Date: Tue, 14 Jul 2015 23:41:34 +0000 (-0400) Subject: test_ctf_writer: add type alignment tests X-Git-Tag: v2.0.0-pre1~1211 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=e8fc5adf1356619cec6d2f9a46dad62c6d9a6c72 test_ctf_writer: add type alignment tests 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 d191d483..6080d324 100644 --- a/tests/lib/test_ctf_writer.c +++ b/tests/lib/test_ctf_writer.c @@ -790,6 +790,14 @@ void append_complex_event(struct bt_ctf_stream_class *stream_class, struct bt_ctf_field *packet_context, *packet_context_field; struct bt_object *obj; + ok(bt_ctf_field_type_set_alignment(int_16_type, 0), + "bt_ctf_field_type_set_alignment handles 0-alignment correctly"); + ok(bt_ctf_field_type_set_alignment(int_16_type, 3), + "bt_ctf_field_type_set_alignment handles wrong alignment correctly (3)"); + ok(bt_ctf_field_type_set_alignment(int_16_type, 24), + "bt_ctf_field_type_set_alignment handles wrong alignment correctly (24)"); + ok(!bt_ctf_field_type_set_alignment(int_16_type, 4), + "bt_ctf_field_type_set_alignment handles correct alignment correctly (4)"); bt_ctf_field_type_set_alignment(int_16_type, 32); bt_ctf_field_type_integer_set_signed(int_16_type, 1); bt_ctf_field_type_integer_set_base(uint_35_type,