/**
@brief Creates a default CTF IR event class named \p name.
-The event class is created \em without an event context
-\link ctfirfieldtypes field type\endlink and with an empty event
-payload field type.
+On success, the context and payload field types are empty structure
+field types. You can modify those default field types after the
+event class is created with
+bt_ctf_event_class_set_context_type() and
+bt_ctf_event_class_set_payload_type().
Upon creation, the event class's ID is <em>not set</em>. You
can set it to a specific value with bt_ctf_event_class_set_id(). If it
goto error;
}
+ event_class->context = bt_ctf_field_type_structure_create();
+ if (!event_class->context) {
+ goto error;
+ }
+
event_class->attributes = bt_ctf_attributes_create();
if (!event_class->attributes) {
goto error;
#define DEFAULT_CLOCK_TIME 0
#define DEFAULT_CLOCK_VALUE 0
-#define NR_TESTS 614
+#define NR_TESTS 612
static int64_t current_time = 42;
"Add event specific context field");
ok(bt_ctf_event_class_get_context_type(NULL) == NULL,
"bt_ctf_event_class_get_context_type handles NULL correctly");
- ok(bt_ctf_event_class_get_context_type(simple_event_class) == NULL,
- "bt_ctf_event_class_get_context_type returns NULL when no event context type is set");
ok(bt_ctf_event_class_set_context_type(NULL, event_context_type) < 0,
"bt_ctf_event_class_set_context_type handles a NULL event class correctly");
/* Define a stream event context containing a my_integer field. */
ok(bt_ctf_stream_class_get_event_context_type(NULL) == NULL,
"bt_ctf_stream_class_get_event_context_type handles NULL correctly");
- ok(bt_ctf_stream_class_get_event_context_type(
- stream_class) == NULL,
- "bt_ctf_stream_class_get_event_context_type returns NULL when no stream event context type was set.");
stream_event_context_type = bt_ctf_field_type_structure_create();
bt_ctf_field_type_structure_add_field(stream_event_context_type,
integer_type, "common_event_context");