+ ok(bt_ctf_stream_get_packet_context(NULL) == NULL,
+ "bt_ctf_stream_get_packet_context handles NULL correctly");
+ packet_context = bt_ctf_stream_get_packet_context(stream);
+ ok(packet_context,
+ "bt_ctf_stream_get_packet_context returns a packet context");
+
+ packet_context_field = bt_ctf_field_structure_get_field(packet_context,
+ "packet_size");
+ ok(packet_context_field,
+ "Packet context contains the default packet_size field.");
+ bt_ctf_field_put(packet_context_field);
+ packet_context_field = bt_ctf_field_structure_get_field(packet_context,
+ "custom_field");
+ ok(bt_ctf_field_unsigned_integer_set_value(packet_context_field, 8) == 0,
+ "Custom packet context field value successfully set.");
+
+ ok(bt_ctf_stream_set_packet_context(NULL, packet_context_field) < 0,
+ "bt_ctf_stream_set_packet_context handles a NULL stream correctly");
+ ok(bt_ctf_stream_set_packet_context(stream, NULL) < 0,
+ "bt_ctf_stream_set_packet_context handles a NULL packet context correctly");
+ ok(bt_ctf_stream_set_packet_context(stream, packet_context) == 0,
+ "Successfully set a stream's packet context");
+