/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "istream-private.h"
#include "istream-concat.h"
#include <fcntl.h>
#include <unistd.h>
{
const unsigned char *data;
unsigned int i, j;
for (i = 0; i < STREAM_COUNT; i++) {
test_istream_set_size(streams[i], 0);
}
for (i = 0; i/STREAM_BYTES < STREAM_COUNT; i++) {
if (i < buffer_size) {
} else {
}
for (j = 0; j < size; j++) {
}
}
for (i = 0; i < STREAM_COUNT; i++) {
i_stream_unref(&streams[i]);
}
}
static bool test_istream_concat_random(void)
{
const unsigned char *data;
unsigned char *w_data;
for (i = 0, offset = 0; i < stream_count; i++) {
for (j = 0; j < data_len; j++)
}
if (simult > 0) {
for (i = 0; i < simult; i++)
}
for (i = 0; i < 1000; i++) {
if (i_rand_limit(3) == 0) {
} else {
if (ret == -2) {
test_assert(ret > 0);
for (j = 0; j < size; j++) {
}
}
}
if (test_has_failed())
break;
}
for (i = 0; i < stream_count; i++)
i_stream_unref(&streams[i]);
for (i = 0; i < simult; i++)
i_stream_unref(&limits[i]);
return !test_has_failed();
}
static void test_istream_concat_seek_end(void)
{
test_begin("istream concat seek end");
test_istream_create("s1"),
test_istream_create("s2"),
};
i_stream_unref(&streams[0]);
test_end();
}
static void test_istream_concat_early_end(void)
{
test_begin("istream concat early end");
i_stream_unref(&streams[0]);
test_end();
}
void test_istream_concat(void)
{
unsigned int i;
test_begin("istream concat");
}
test_end();
test_begin("istream concat random");
for (i = 0; i < 100; i++) T_BEGIN {
if(!test_istream_concat_random())
i = 101; /* don't break a T_BEGIN */
} T_END;
test_end();
}