struct fts_filter *norm;
const char *token, *error;
string_t *str;
- unsigned int i;
+ unichar_t i;
test_begin("fts filter normalizer bad data");
test_assert(fts_filter_create(fts_filter_normalizer_icu, NULL, NULL, settings, &norm, &error) == 0);
str = t_str_new(128);
for (i = 1; i < 0x1ffff; i++) {
+ if (!uni_is_valid_ucs4(i)) continue;
str_truncate(str, 0);
uni_ucs4_to_utf8_c(i, str);
token = str_c(str);
}
str_truncate(str, 0);
- uni_ucs4_to_utf8_c(0x7fffffff, str);
+ uni_ucs4_to_utf8_c(UNICHAR_T_MAX, str);
token = str_c(str);
test_assert(fts_filter_filter(norm, &token, &error) >= 0);