From 92e848829cefda0c29759c9e8cf8b6be58597445 Mon Sep 17 00:00:00 2001 From: Alan Liu Date: Mon, 11 Jun 2001 17:21:58 +0000 Subject: [PATCH] ICU-986 add TESTCASE macro to IntlTest header for use by all subclasses X-SVN-Rev: 4933 --- icu4c/source/test/intltest/intltest.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/icu4c/source/test/intltest/intltest.h b/icu4c/source/test/intltest/intltest.h index 9cc0905070..d1f8bed95f 100644 --- a/icu4c/source/test/intltest/intltest.h +++ b/icu4c/source/test/intltest/intltest.h @@ -45,6 +45,28 @@ UnicodeString operator+(const UnicodeString& left, float num); UnicodeString toString(const Formattable& f); // liu //----------------------------------------------------------------------------- +// Use the TESTCASE macro in subclasses of IntlTest. Define the +// runIndexedTest method in this fashion: +// +//| void MyTest::runIndexedTest(int32_t index, UBool exec, +//| const char* &name, char* /*par*/) { +//| switch (index) { +//| TESTCASE(0,TestSomething); +//| TESTCASE(1,TestSomethingElse); +//| TESTCASE(2,TestAnotherThing); +//| default: name = ""; break; +//| } +//| } +#define TESTCASE(id,test) \ + case id: \ + name = #test; \ + if (exec) { \ + logln(#test "---"); \ + logln((UnicodeString)""); \ + test(); \ + } \ + break + class IntlTest { public: