+// More convenient macros. These allow easy reordering of the test cases.
+// Copied from intltest.h, and adjusted to not logln() but return a UPerfFunction.
+//
+//| void MyTest::runIndexedTest(int32_t index, UBool exec,
+//| const char* &name, char* /*par*/) {
+//| TESTCASE_AUTO_BEGIN;
+//| TESTCASE_AUTO(TestSomething);
+//| TESTCASE_AUTO(TestSomethingElse);
+//| TESTCASE_AUTO(TestAnotherThing);
+//| TESTCASE_AUTO_END;
+//| return NULL;
+//| }
+#define TESTCASE_AUTO_BEGIN \
+ for(;;) { \
+ int32_t testCaseAutoNumber = 0
+
+#define TESTCASE_AUTO(test) \
+ if (index == testCaseAutoNumber++) { \
+ name = #test; \
+ if (exec) { \
+ return test(); \
+ } \
+ break; \
+ }
+
+#define TESTCASE_AUTO_END \
+ name = ""; \
+ break; \
+ }