test-unichar.c revision bcb4e51a409d94ae670de96afb8483a4f7855294
/* Copyright (c) 2007-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "str.h"
#include "buffer.h"
#include "unichar.h"
static void test_unichar_uni_utf8_strlen(void)
{
static const char input[] = "\xC3\xA4\xC3\xA4\0a";
test_begin("uni_utf8_strlen()");
test_end();
test_begin("uni_utf8_strlen_n()");
test_end();
}
static void test_unichar_uni_utf8_partial_strlen_n(void)
{
static const char input[] = "\xC3\xA4\xC3\xA4\0a";
test_begin("uni_utf8_partial_strlen_n()");
test_end();
}
static void test_unichar_valid_unicode(void)
{
struct {
const char *input;
bool valid;
} test_cases[] = {
};
test_begin("unichar valid unicode");
if (test_cases[i].valid) {
} else {
}
}
test_end();
}
static void test_unichar_surrogates(void)
{
test_begin("unichar surrogates");
orig = 0x10437;
test_end();
}
void test_unichar(void)
{
static const char overlong_utf8[] = "\xf8\x80\x95\x81\xa1";
static const char collate_in[] = "\xc3\xbc \xc2\xb3";
static const char collate_exp[] = "U\xcc\x88 3";
test_begin("unichars encode/decode");
/* skip surrogates */
continue;
/* The bottom 6 bits should be irrelevant to code coverage,
only test 000000, 111111, and something in between. */
str_truncate(str, 0);
if ((chr & 0x63) == 0) {
/* virtually truncate the byte string */
while (--utf8len > 0)
/* actually truncate the byte stream */
while (--utf8len > 0) {
}
}
}
test_end();
test_begin("unichar collation");
test_end();
}