#include <babeltrace/ctf-ir/event-class.h>
#include <babeltrace/ctf-ir/stream-class.h>
#include <babeltrace/ctf-ir/trace.h>
#include <babeltrace/ctf-ir/event-class.h>
#include <babeltrace/ctf-ir/stream-class.h>
#include <babeltrace/ctf-ir/trace.h>
ret = bt_field_type_enumeration_unsigned_add_mapping(root_iron_parallel, "RED", 0, 0);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_iron_parallel, "RED", 0, 0);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_iron_parallel, "BLUE", 1, 1);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_iron_parallel, "BLUE", 1, 1);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_iron_parallel, "YELLOW", 2, 2);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_iron_parallel, "YELLOW", 2, 2);
ret = bt_field_type_variant_add_field(root_iron_fire_keen_elem, root_iron_fire_keen_elem_RED, "RED");
ret = bt_field_type_variant_add_field(root_iron_fire_keen_elem, root_iron_fire_keen_elem_RED, "RED");
ret = bt_field_type_variant_add_field(root_iron_fire_keen_elem, root_iron_fire_keen_elem_BLUE, "BLUE");
ret = bt_field_type_variant_add_field(root_iron_fire_keen_elem, root_iron_fire_keen_elem_BLUE, "BLUE");
ret = bt_field_type_variant_add_field(root_iron_fire_keen_elem, root_iron_fire_keen_elem_YELLOW, "YELLOW");
ret = bt_field_type_variant_add_field(root_iron_fire_keen_elem, root_iron_fire_keen_elem_YELLOW, "YELLOW");
ret = bt_field_type_enumeration_unsigned_add_mapping(root_clover_square, "YOUNG", 0, 0);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_clover_square, "YOUNG", 0, 0);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_clover_square, "OLD", 1, 1);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_clover_square, "OLD", 1, 1);
struct bt_field_type *ft_tag = NULL;
sc = bt_trace_get_stream_class_by_index(trace, 0);
struct bt_field_type *ft_tag = NULL;
sc = bt_trace_get_stream_class_by_index(trace, 0);
ph = bt_trace_get_packet_header_field_type(trace);
ok(ph, "Trace packet header still exists after successful validation");
ph = bt_trace_get_packet_header_field_type(trace);
ok(ph, "Trace packet header still exists after successful validation");
/* Validation happens here */
ret = bt_trace_add_stream_class(trace, sc);
/* Validation happens here */
ret = bt_trace_add_stream_class(trace, sc);
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with length in unavailable root is invalid");
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with length in unavailable root is invalid");
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with root as its length is invalid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with root as its length is invalid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with length after it is invalid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with length after it is invalid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with ancestor as its length is invalid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with ancestor as its length is invalid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with itself as its length is invalid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with itself as its length is invalid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep),
"Variant FT with non-enum FT as its tag FT is invalid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep),
"Variant FT with non-enum FT as its tag FT is invalid");
BT_PUT(ep);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_a, "GLASS", 0, 0);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_a, "GLASS", 0, 0);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_a, "OF", 1, 1);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_a, "OF", 1, 1);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_a, "WATER", 2, 2);
ret = bt_field_type_enumeration_unsigned_add_mapping(root_a, "WATER", 2, 2);
ok(try_add_event_class_to_trace(NULL, ep) == 0,
"Variant FT with mismatching tag FT is valid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep) == 0,
"Variant FT with mismatching tag FT is valid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with non-enum length FT is invalid");
BT_PUT(ep);
ok(try_add_event_class_to_trace(NULL, ep),
"Sequence FT with non-enum length FT is invalid");
BT_PUT(ep);