/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "net.h"
#include "str.h"
#include "safe-mkstemp.h"
#include "randgen.h"
#include "istream.h"
#include "ostream.h"
#include <fcntl.h>
#include <unistd.h>
static void test_ostream_file_random_once(void)
{
int fd;
if (fd == -1)
for (i = 0; i < 10; i++) {
if (i_rand_limit(10) == 0)
}
if (ret < 0)
i_fatal("pread() failed: %m");
else {
}
i_close_fd(&fd);
}
static void test_ostream_file_random(void)
{
unsigned int i;
test_begin("ostream pwrite random");
for (i = 0; i < 100; i++) T_BEGIN {
} T_END;
test_end();
}
static void test_ostream_file_send_istream_file(void)
{
int fd;
test_begin("ostream file send istream file");
/* temp file istream */
if (fd == -1)
i_fatal("creat(.temp.istream) failed: %m");
/* temp file ostream */
if (fd == -1)
i_fatal("creat(.temp.ostream) failed: %m");
/* test that writing works between two files */
/* test that writing works within the same file */
/* forwards: 4567 -> 4677 */
/* backwards: 1234 -> 11234 */
i_close_fd(&fd);
i_unlink(".temp.istream");
i_unlink(".temp.ostream");
test_end();
}
static void test_ostream_file_send_istream_sendfile(void)
{
test_begin("ostream file send istream sendfile()");
/* temp file istream */
if (fd == -1)
i_fatal("creat(.temp.istream) failed: %m");
/* temp socket ostream */
/* test that sendfile() works */
i_unlink(".temp.istream");
test_end();
}
void test_ostream_file(void)
{
}