/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "istream.h"
#include "istream-try.h"
void test_istream_try(void)
{
test_begin("istream try");
test_istream_set_size(test_inputs[0], 0);
/* nonblocking read */
switch (test) {
case 0:
/* stream 0 is available */
break;
case 1:
/* stream 1 is available, but not used before 0 */
/* continue failing stream 0 -> 1 is available */
break;
case 2:
/* both streams are available - stream 0 is read */
break;
case 3:
/* stream 0 fails */
/* continue making stream 1 available */
break;
case 4:
/* stream 1 fails */
break;
case 5:
/* stream 0 fails, stream 1 is available */
break;
case 6:
/* stream 0 is available, stream 1 fails */
break;
case 7:
/* both streams fail */
break;
case 8:
/* stream 0 fails with EINVAL, stream 1 with EIO */
break;
case 9:
/* stream 0 fails with EIO, stream 1 with EINVAL */
break;
case 10:
/* stream 0 fails with EIO, stream 1 would work.. */
break;
}
i_stream_unref(&test_inputs[0]);
}
test_end();
}