/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file
*/
#include "lib.h"
#include "test-lib.h"
#include "mempool.h"
#include "buffer.h"
#include "str.h"
#include "array.h"
#include "istream.h"
#include "ostream.h"
#include "net.h"
#include "iostream-temp.h"
#include "program-client.h"
#include <unistd.h>
static const char *pclient_test_io_string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
"Praesent vehicula ac leo vel placerat. Nullam placerat \n"
"volutpat leo, sed ultricies felis pulvinar quis. Nam \n"
"tempus, augue ut tempor cursus, neque felis commodo lacus, \n"
"sit amet tincidunt arcu justo vel augue. Proin dapibus \n"
"vulputate maximus. Mauris congue lacus felis, sed varius \n"
"leo finibus sagittis. Cum sociis natoque penatibus et magnis \n"
"dis parturient montes, nascetur ridiculus mus. Aliquam \n"
"laoreet arcu a hendrerit consequat. Duis vitae erat tellus.";
static
.client_connect_timeout_msecs = 1000,
.input_idle_timeout_msecs = 5000,
};
static
struct test_server {
int listen_fd;
} test_globals;
struct test_client {
int fd;
enum {
} state;
};
static
{
}
static
{
int cmp;
const char *arg;
case CLIENT_STATE_INIT:
if (cmp == 0) {
} else
return -1;
break;
case CLIENT_STATE_VERSION:
if (cmp == 0)
else
return -1;
break;
case CLIENT_STATE_ARGS:
return 0;
}
break;
case CLIENT_STATE_BODY:
i_panic("Cannot write to ostream-temp: %s",
i_warning("Client stream error: %s",
return -1;
i_debug("waiting for input");
break;
return 1;
i_panic("Cannot write to ostream-temp");
}
break;
}
return 0;
}
static
{
const char *const *args;
unsigned int count;
test_assert(count > 0);
/* return hello world */
}
}
static
{
int ret = 0;
for (;;) {
break;
} else {
break;
}
}
}
}
if (ret < 0)
return;
return;
i_warning("Client prematurely disconnected");
/* incur slight delay to check if the connection gets
prematurely closed */
}
static
{
int fd;
if (fd < 0)
i_fatal("Failed to accept connection: %m");
}
static
void test_program_setup(void) {
test_begin("test_program_setup");
/* create listener */
if (test_globals.listen_fd < 0)
i_fatal("Cannot create unix listener: %m");
test_end();
}
static
void test_program_teardown(void)
{
test_begin("test_program_teardown");
test_end();
}
static
{
}
static
void test_program_success(void) {
test_begin("test_program_success");
int ret;
const char *const args[] = {
};
o_stream_unref(&os);
test_end();
}
static
void test_program_io(void) {
test_begin("test_program_io (async)");
int ret;
const char *const args[] = {
"test_program_io", NULL
};
i_stream_unref(&is);
o_stream_unref(&os);
test_end();
}
static
void test_program_failure(void) {
test_begin("test_program_failure");
int ret;
const char *const args[] = {
"test_program_failure", NULL
};
test_assert(ret == 0);
o_stream_unref(&os);
test_end();
}
static
void test_program_noreply(void) {
test_begin("test_program_noreply");
int ret;
const char *const args[] = {
};
test_end();
}
int main(void)
{
void (*tests[])(void) = {
};
}