test-ostream-multiplex.c revision ad9afb64630511d5e25bc5bc11c5304986156928
/* Copyright (c) 2017 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "ioloop.h"
#include "str.h"
#include "istream.h"
#include "ostream-private.h"
#include "ostream-multiplex.h"
#include "ostream.h"
#include <unistd.h>
#include "hex-binary.h"
static void test_ostream_multiplex_simple(void)
{
test_begin("ostream multiplex (simple)");
const unsigned char expected[] = {
'\x00','\x00','\x00','\x00','\x05','\x68','\x65',
'\x6c','\x6c','\x6f','\x01','\x00','\x00','\x00',
'\x05','\x77','\x6f','\x72','\x6c','\x64'
};
o_stream_unref(&os);
test_end();
}
static unsigned int channel_counter[2] = {0, 0};
static const char *msgs[] = {
"",
"a",
"bb",
"ccc",
"dddd",
"eeeee",
"ffffff"
};
{
const unsigned char *data;
/* parse stream */
if (dlen > 0) {
}
dlen = 0;
} else if (dlen == 0) {
pos++;
pos += 4;
}
}
}
}
{
if ((i_rand() % 2) != 0)
else
}
}
static void test_ostream_multiplex_stream(void)
{
test_begin("ostream multiplex (stream)");
int fds[2];
i_stream_unref(&is);
o_stream_unref(&os);
i_close_fd(&fds[0]);
test_end();
}
void test_ostream_multiplex(void)
{
}