diff --git a/tests/test_media_blocks.c b/tests/test_media_blocks.c index 913d224d..70fa0209 100644 --- a/tests/test_media_blocks.c +++ b/tests/test_media_blocks.c @@ -397,7 +397,8 @@ static void test_relay_generation(void) { char old_path[FILE_IO_PATH_MAX]; snprintf(old_path, sizeof(old_path), "%s", old_source->storage.temporary); struct packet request = request_packet(dl, 0x300); receive(f.client, &request); struct ETCP_ROUTER_CONN* slow = etcp_router_conn_get(f.client, GROUP, 0x300, ETCP_RT_ID_MEDIA_DELIVERY); - queue_set_threshold(slow->send_q, -1, 0); + queue_set_threshold(slow->send_q, 0, 0); + struct ll_entry* pending = queue_entry_new(0); REQUIRE(pending && !queue_data_put(slow->send_q, pending)); struct packet old_chunk = chunk_packet(f.client, 0, 1), old_done = done_packet(f.client); receive(f.client, &old_chunk); receive(f.client, &old_done); poll_ready(); REQUIRE(!download(f.client) && old_source->refs == 1 && old_source->verified && !access(old_path, F_OK)); @@ -406,7 +407,8 @@ static void test_relay_generation(void) { REQUIRE(new_source != old_source && !old_source->indexed && new_source->indexed && new_source->refs == 1); unchanged(f.client, &old_chunk); unchanged(f.client, &old_done); if (cancel_new) REQUIRE(!media_download_cancel(f.client, dl->media_id, NULL, 0)); - capture_blocks = 1; queue_set_threshold(slow->send_q, 0, 0); poll_ready(); + capture_blocks = 1; + pending = queue_data_get(slow->send_q); REQUIRE(pending); queue_entry_free(pending); poll_ready(); REQUIRE(access(old_path, F_OK) && !f.client->md.streams && packet_count == 2); REQUIRE(packets[0].data[0] == MEDIA_SUBCMD_BLOCK_CHUNK && packets[1].data[0] == MEDIA_SUBCMD_BLOCK_DONE); REQUIRE(!memcmp(((struct media_pkt_block_chunk*)packets[0].data)->transfer_id,