/* Copyright (c) 2016-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "istream-private.h"
#include "istream-chain.h"
static void test_istream_chain_basic(void)
{
const unsigned char *data;
test_begin("istream chain");
/* no input */
/* stream1 input */
/* STREAM2 input */
/* EOF */
test_end();
}
static void test_istream_chain_early_end(void)
{
test_begin("istream chain early end");
/* with current implementation we could skip less than 5 and have
v_offset<5, but I don't think that can work in all situations.
the normal case is anyway that we'll read everything up until some
point and skip over all the data up to there. */
test_end();
}
static void test_istream_chain_accumulate(void)
{
const unsigned char *data;
test_begin("istream chain accumulate");
/* no input */
/* first stream */
/* partially skip */
/* second stream */
"bbbbbbbbbbbbbbbbbbbbbbbbb", 33) == 0);
/* partially skip */
/* third stream */
"cccccccccccccccccccccccccccccc", 51) == 0);
/* partially skip */
/* forth stream */
"cccccccccccccccccccccccccccccc"
"ddddddddddddddddddddddddd", 64) == 0);
/* partially skip */
/* fifth stream */
"cccccccccccccccccccccccccccccc"
"ddddddddddddddddddddddddd"
"eeeeeeeeeeeeeeeeeeee", 78) == 0);
/* EOF */
"cccccccccccccccccccccccccccccc"
"ddddddddddddddddddddddddd"
"eeeeeeeeeeeeeeeeeeee", 78) == 0);
/* skip rest */
test_assert(size == 0);
test_end();
}
void test_istream_chain(void)
{
}