#define METADATA_LINE_SIZE 512
#define SEQUENCE_TEST_LENGTH 10
#define ARRAY_TEST_LENGTH 5
-#define PACKET_RESIZE_TEST_LENGTH 100000
+#define PACKET_RESIZE_TEST_DEF_LENGTH 100000
#define DEFAULT_CLOCK_FREQ 1000000000
#define DEFAULT_CLOCK_PRECISION 1
#define DEFAULT_CLOCK_TIME 0
#define DEFAULT_CLOCK_VALUE 0
-#define NR_TESTS 621
+#define NR_TESTS 622
static int64_t current_time = 42;
+static unsigned int packet_resize_test_length = PACKET_RESIZE_TEST_DEF_LENGTH;
/* Return 1 if uuids match, zero if different. */
static
ok(bt_ctf_field_type_enumeration_add_mapping_unsigned(enum_type_unsigned,
"event clock int float", 5, 22) == 0,
"bt_ctf_field_type_enumeration_add_mapping_unsigned accepts enumeration mapping strings containing reserved keywords");
- bt_ctf_field_type_enumeration_add_mapping_unsigned(enum_type_unsigned, mapping_name_test,
- 42, 42);
+ ok(bt_ctf_field_type_enumeration_add_mapping_unsigned(enum_type_unsigned, mapping_name_test,
+ 42, 42) == 0, "bt_ctf_field_type_enumeration_add_mapping_unsigned accepts single-value ranges");
ok(bt_ctf_field_type_enumeration_add_mapping_unsigned(enum_type_unsigned, mapping_name_test,
43, 51) == 0, "bt_ctf_field_type_enumeration_add_mapping_unsigned accepts duplicate mapping names");
ok(bt_ctf_field_type_enumeration_add_mapping_unsigned(enum_type_unsigned, "something",
"bt_ctf_event_get_payload_by_index handles an invalid index correctly");
bt_put(event);
- for (i = 0; i < PACKET_RESIZE_TEST_LENGTH; i++) {
+ for (i = 0; i < packet_resize_test_length; i++) {
event = bt_ctf_event_create(event_class);
struct bt_ctf_field *integer =
bt_ctf_field_create(ep_field_1_type);
}
}
- events_appended = !!(i == PACKET_RESIZE_TEST_LENGTH);
+ events_appended = !!(i == packet_resize_test_length);
ok(bt_ctf_stream_get_discarded_events_count(NULL, &ret_uint64) < 0,
"bt_ctf_stream_get_discarded_events_count handles a NULL stream correctly");
ok(bt_ctf_stream_get_discarded_events_count(stream, NULL) < 0,
int main(int argc, char **argv)
{
+ const char *env_resize_length;
char trace_path[] = "/tmp/ctfwriter_XXXXXX";
char metadata_path[sizeof(trace_path) + 9];
const char *clock_name = "test_clock";
return -1;
}
+ env_resize_length = getenv("PACKET_RESIZE_TEST_LENGTH");
+ if (env_resize_length) {
+ packet_resize_test_length =
+ (unsigned int) atoi(env_resize_length);
+ }
+
plan_tests(NR_TESTS);
if (!bt_mkdtemp(trace_path)) {