+ if (icu_iter_next(iter))
+ {
+ yaz_log(YLOG_WARN, "test_iter: expecting 0 before icu_iter_first");
+ return 0;
+ }
+
+ result = wrbuf_alloc();
+ icu_iter_first(iter, input);
+ while (icu_iter_next(iter))
+ {
+ wrbuf_puts(result, "[");
+ wrbuf_puts(result, icu_iter_get_norm(iter));
+ wrbuf_puts(result, "]");
+ }
+
+ second = wrbuf_alloc();
+ icu_iter_first(iter, input);
+ while (icu_iter_next(iter))
+ {
+ wrbuf_puts(second, "[");
+ wrbuf_puts(second, icu_iter_get_norm(iter));
+ wrbuf_puts(second, "]");
+ }
+
+ icu_iter_destroy(iter);
+
+ if (strcmp(expected, wrbuf_cstr(result)))
+ {
+ yaz_log(YLOG_WARN, "test_iter: input=%s expected=%s got=%s",
+ input, expected, wrbuf_cstr(result));
+ success = 0;
+ }
+
+ if (strcmp(expected, wrbuf_cstr(second)))
+ {
+ yaz_log(YLOG_WARN, "test_iter: input=%s expected=%s got=%s (2nd)",
+ input, expected, wrbuf_cstr(second));
+ success = 0;
+ }
+
+ wrbuf_destroy(result);
+ wrbuf_destroy(second);
+ return success;