test-str-sanitize.c revision 83060e2c2b3d75bda70ac9cc3e55ff1f677acc0f
/* Copyright (c) 2007-2014 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "str-sanitize.h"
struct str_sanitize_test {
const char *str;
unsigned int max_len;
const char *sanitized; /* NULL for no change */
};
void test_str_sanitize(void)
{
static struct str_sanitize_test tests[] = {
{ "abc", 2, "..." },
{ "abcd", 3, "..." },
{ "abcde", 4, "a..." },
{ "\001x\x1fy\x81", 10, "?x?y?" }
};
const char *str;
unsigned int i;
test_begin("str_sanitize");
for (i = 0; i < N_ELEMENTS(tests); i++) {
else
}
test_end();
}