/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "array.h"
static void test_p_strdup(void)
{
test_begin("p_strdup()");
test_end();
}
static void test_p_strdup_empty(void)
{
test_begin("p_strdup_empty()");
test_end();
}
static void test_p_strdup_until(void)
{
char *str;
test_begin("p_strdup_until()");
/* \0 is ignored */
test_end();
}
static void test_p_strarray_dup(void)
{
{ NULL },
{ "a", NULL },
{ "foobar", NULL },
};
const char **ret;
unsigned int i, j;
test_begin("p_strarray_dup");
for (i = 0; i < N_ELEMENTS(input); i++) {
}
}
test_end();
}
static void test_t_strsplit(void)
{
struct {
const char *input;
const char *const *output;
} tests[] = {
/* empty string -> empty array. was this perhaps a mistake for
the API to do this originally?.. can't really change now
anyway. */
{ "", (const char *const []) { NULL } },
};
test_begin("t_strsplit");
for (unsigned int i = 0; i < N_ELEMENTS(tests); i++) {
/* split_str_fast() with single separator */
/* split_str_slow() with a secondary separator */
/* also as suffix */
}
}
test_end();
}
static void test_t_strsplit_spaces(void)
{
struct {
const char *input;
const char *const *output;
} tests[] = {
/* empty strings */
{ "", (const char *const []) { NULL } },
{ "\n", (const char *const []) { NULL } },
{ "\n\n", (const char *const []) { NULL } },
/* normal */
};
test_begin("t_strsplit_spaces");
for (unsigned int i = 0; i < N_ELEMENTS(tests); i++) {
/* test also with a secondary nonexistent separator */
/* also as suffix */
}
}
/* multiple separators */
test_end();
}
static void test_t_str_replace(void)
{
test_begin("t_str_replace");
test_end();
}
static void test_t_str_trim(void)
{
test_begin("t_str_trim");
test_end();
}
static void test_t_str_ltrim(void)
{
test_begin("t_str_ltrim");
test_end();
}
static void test_t_str_rtrim(void)
{
test_begin("t_str_rtrim");
test_end();
}
static const char *const test_strarray_input[] = {
};
static const struct {
const char *separator;
const char *output;
} test_strarray_outputs[] = {
{ "", "helloworldyay" },
{ " ", " hello world yay " },
{ "!-?", "!-?hello!-?world!-?!-?yay!-?" }
};
static const char *const test_strarray_input2[] = {
};
static struct {
const char *separator;
const char *output;
} test_strarray_outputs2[] = {
{ "", "helloworldyay" },
{ " ", " hello world yay " },
{ "!-?", "!-?!-?hello!-?world!-?!-?yay!-?" }
};
static const char *const test_strarray_input3[] = {
};
static struct {
const char *separator;
const char *output;
} test_strarray_outputs3[] = {
{ "", "helloyay" },
{ " ", "hello yay" },
{ "!-?", "hello!-?!-?!-?yay" }
};
static void test_t_strarray_join(void)
{
unsigned int i;
test_begin("t_strarray_join()");
/* empty array -> empty string */
for (i = 0; i < N_ELEMENTS(test_strarray_outputs); i++) {
test_strarray_outputs[i].output) == 0, i);
}
for (i = 0; i < N_ELEMENTS(test_strarray_outputs2); i++) {
test_strarray_outputs2[i].output) == 0, i);
}
for (i = 0; i < N_ELEMENTS(test_strarray_outputs3); i++) {
test_strarray_outputs3[i].output) == 0, i);
}
test_end();
}
static void test_p_array_const_string_join(void)
{
unsigned int i;
char *res;
test_begin("p_array_const_string_join()");
/* empty array -> empty string */
for (i = 0; i < N_ELEMENTS(test_strarray_outputs); i++) {
}
array_free(&arr);
test_end();
}
static void test_mem_equals_timing_safe(void)
{
const struct {
const char *a, *b;
} tests[] = {
{ "", "" },
{ "a", "a" },
{ "b", "a" },
{ "ab", "ab" },
{ "ab", "ba" },
{ "ab", "bc" },
};
test_begin("mem_equals_timing_safe()");
for (unsigned int i = 0; i < N_ELEMENTS(tests); i++) {
}
test_end();
}
static void test_dec2str_buf(void)
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
99, 999, 9999, 65535, 65536, 99999, 999999, 9999999,
99999999, 999999999, 4294967295, 4294967296ULL,
9999999999999999999ULL,
18446744073709551615ULL
};
test_begin("dec2str_buf()");
for (unsigned int i = 0; i < N_ELEMENTS(test_input); i++) {
buf2) == 0, i);
}
test_end();
}
void test_strfuncs(void)
{
}