test-ostream-failure-at.c revision c1d99776b50ef1d65b59c6c14b328a84abc1157e
/* Copyright (c) 2015 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "buffer.h"
#include "ostream.h"
#include "ostream-failure-at.h"
#define TEST_DATA_LENGTH 128
#define TEST_ERRMSG "test-ostream-failure-at error triggered"
void test_ostream_failure_at(void)
{
unsigned char test_data[TEST_DATA_LENGTH];
unsigned int i;
test_begin("ostream failure at");
for (i = 0; i < sizeof(test_data); i++)
test_data[i] = i;
for (i = 0; i < TEST_DATA_LENGTH; i++) {
if (i > 0)
}
/* shouldn't fail */
output->stream_errno == 0);
/* fail at flush */
test_end();
}