test-strfuncs.c revision a8319b1f667a808f335447e9fa10ff66b99705c5
/* Copyright (c) 2009-2015 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
static void test_p_strarray_dup(void)
{
const char *input[][3] = {
{ 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)
{
const char *const *args;
test_begin("t_strsplit");
/* empty string -> empty array. was this perhaps a mistake for the
API to do this originally?.. can't really change now anyway. */
/* two empty strings */
test_end();
}
static void strsplit_verify(const char *str)
{
T_BEGIN {
unsigned int i;
} T_END;
}
static void test_t_strsplit_tab(void)
{
char buf[4096];
unsigned int i, j, max;
test_begin("t_strsplit_tab");
strsplit_verify("");
strsplit_verify("\t");
strsplit_verify("\t\t");
strsplit_verify("foo");
strsplit_verify("foo\tbar");
strsplit_verify("foo\tbar\tbaz");
strsplit_verify("foo\t\tbaz");
for (i = 0; i < sizeof(buf)-1; i++)
buf[i] = '\t';
for (j = 0; j < 256; j++) {
}
for (j = 0; j < 100; j++) {
for (i = 0; i < max; i++) {
if (rand() % 10 == 0)
buf[i] = '\t';
else
buf[i] = 'x';
}
}
test_end();
}
static void test_t_str_replace(void)
{
test_begin("t_str_replace");
test_end();
}
#if 0
static void test_t_str_trim(void)
{
test_begin("t_str_trim");
test_end();
}
#endif
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();
}
void test_strfuncs(void)
{
/*test_t_str_trim();*/
}