/* Copyright (c) 2016-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "str.h"
#include "istream-private.h"
#include "istream-jsonstr.h"
static const struct {
const char *input;
const char *output;
int stream_errno;
} tests[] = {
{ "foo\\\\\\\"\\b\\f\\n\\r\\t\\u0001\\uffff\"",
"foo\\\"\b\f\n\r\t\001\xEF\xBF\xBF", 0 },
{ "\\ud801\\udc37\"", "\xf0\x90\x90\xb7", 0 }, /* valid codepoint */
{ "\"", "", 0 },
};
static void
unsigned int skip_count)
{
const unsigned char *data;
for (i = 1; i < json_input_len;) {
break;
test_assert_idx(ret == 0, i);
if (i + skip_count < json_input_len)
i += skip_count;
else
i++;
}
while (ret > 0 && stream_errno != 0)
if (stream_errno == 0) {
if (size > 0)
}
}
static void
{
for (unsigned int i = 1; i <= 5; i++)
}
static void test_istream_jsonstr_autoretry(void)
{
test_begin("istream-jsonstr autoretry");
test_end();
}
static void test_istream_jsonstr_partial(void)
{
test_begin("istream-jsonstr partial");
test_end();
}
void test_istream_jsonstr(void)
{
unsigned int i;
for (i = 0; i < N_ELEMENTS(tests); i++) {
test_end();
}
}