+ dataerrln((UnicodeString)"FAIL:" + message + " failed Got-->" + prettify(result)+ ", Expected--> " + prettify(expected) );
+}
+
+
+//
+// callEverything call all of the const (non-destructive) methods on a
+// transliterator, just to verify that they don't fail in some
+// destructive way.
+//
+#define CEASSERT(a) {if (!(a)) { \
+errln("FAIL at line %d from line %d: %s", __LINE__, line, #a); return; }}
+
+void TransliteratorAPITest::callEverything(const Transliterator *tr, int line) {
+ Transliterator *clonedTR = tr->clone();
+ CEASSERT(clonedTR != NULL);
+
+ int32_t maxcl = tr->getMaximumContextLength();
+ CEASSERT(clonedTR->getMaximumContextLength() == maxcl);
+
+ UnicodeString id;
+ UnicodeString clonedId;
+ id = tr->getID();
+ clonedId = clonedTR->getID();
+ CEASSERT(id == clonedId);
+
+ const UnicodeFilter *filter = tr->getFilter();
+ const UnicodeFilter *clonedFilter = clonedTR->getFilter();
+ if (filter == NULL || clonedFilter == NULL) {
+ // If one filter is NULL they better both be NULL.
+ CEASSERT(filter == clonedFilter);
+ } else {
+ CEASSERT(filter != clonedFilter);
+ }
+
+ UnicodeString rules;
+ UnicodeString clonedRules;
+ rules = tr->toRules(rules, FALSE);
+ clonedRules = clonedTR->toRules(clonedRules, FALSE);
+ CEASSERT(rules == clonedRules);
+
+ UnicodeSet sourceSet;
+ UnicodeSet clonedSourceSet;
+ tr->getSourceSet(sourceSet);
+ clonedTR->getSourceSet(clonedSourceSet);
+ CEASSERT(clonedSourceSet == sourceSet);
+
+ UnicodeSet targetSet;
+ UnicodeSet clonedTargetSet;
+ tr->getTargetSet(targetSet);
+ clonedTR->getTargetSet(clonedTargetSet);
+ CEASSERT(targetSet == clonedTargetSet);
+
+ UClassID classID = tr->getDynamicClassID();
+ CEASSERT(classID == clonedTR->getDynamicClassID());
+ CEASSERT(classID != 0);
+
+ delete clonedTR;