+void CanonicalIteratorTest::characterTest(UnicodeString &s, UChar32 ch, CanonicalIterator &it)
+{
+ UErrorCode status = U_ZERO_ERROR;
+ UnicodeString decomp, comp;
+ UBool gotDecomp = FALSE;
+ UBool gotComp = FALSE;
+ UBool gotSource = FALSE;
+
+ Normalizer::decompose(s, FALSE, 0, decomp, status);
+ Normalizer::compose(s, FALSE, 0, comp, status);
+
+ // skip characters that don't have either decomp.
+ // need quick test for this!
+ if (s == decomp && s == comp) {
+ return;
+ }
+
+ it.setSource(s, status);
+
+ for (;;) {
+ UnicodeString item = it.next();
+ if (item.isBogus()) break;
+ if (item == s) gotSource = TRUE;
+ if (item == decomp) gotDecomp = TRUE;
+ if (item == comp) gotComp = TRUE;
+ }
+
+ if (!gotSource || !gotDecomp || !gotComp) {
+ errln("FAIL CanonicalIterator: " + s + (int)ch);
+ }
+}
+