/* Copyright (c) 2016-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "istream.h"
#include "ostream.h"
#include "iostream-temp.h"
#include <unistd.h>
#include <fcntl.h>
static void test_iostream_temp_create_sized_memory(void)
{
test_begin("iostream_temp_create_sized() memory");
/* now we'll try to switch to writing to a file, but it'll fail */
test_expect_error_string("safe_mkstemp");
test_end();
}
static void test_iostream_temp_create_sized_disk(void)
{
test_begin("iostream_temp_create_sized() disk");
test_end();
}
static void test_iostream_temp_create_write_error(void)
{
test_begin("iostream_temp_create_sized() write error");
const unsigned char *data;
test_end();
}
static void test_iostream_temp_istream(void)
{
int fd;
test_begin("iostream_temp istream");
if (fd == -1)
i_fatal("create(.temp.istream) failed: %m");
/* a working fd-dup */
/* non-working fd-dup: write data before sending istream */
i_stream_seek(input, 0);
test_expect_error_string("safe_mkstemp");
/* non-working fd-dup: write data after sending istream */
i_stream_seek(input, 0);
test_expect_error_string("safe_mkstemp");
/* non-working fd-dup: send two istreams */
i_stream_seek(input, 0);
test_expect_error_string("safe_mkstemp");
i_unlink(".temp.istream");
test_end();
}
void test_iostream_temp(void)
{
}