]> granicus.if.org Git - icu/commitdiff
skeleton for unit test in icu
authorYounies <younies.mahmoud@gmail.com>
Thu, 16 Jan 2020 16:16:19 +0000 (17:16 +0100)
committerYounies <younies.mahmoud@gmail.com>
Thu, 16 Jan 2020 19:35:08 +0000 (20:35 +0100)
icu4c/source/test/intltest/Makefile.in
icu4c/source/test/intltest/intltest.vcxproj
icu4c/source/test/intltest/intltest.vcxproj.filters
icu4c/source/test/intltest/itformat.cpp
icu4c/source/test/intltest/unitstest.cpp [new file with mode: 0644]

index bcab2c98ba25c9069aaee3e834291b31592802a2..594d491f6f73efe65eb534e3ae019c0857556b24 100644 (file)
@@ -68,7 +68,8 @@ numbertest_modifiers.o numbertest_patternmodifier.o numbertest_patternstring.o \
 string_segment_test.o \
 numbertest_parse.o numbertest_doubleconversion.o numbertest_skeletons.o \
 static_unisets_test.o numfmtdatadriventest.o numbertest_range.o erarulestest.o \
-formattedvaluetest.o formatted_string_builder_test.o numbertest_permutation.o
+formattedvaluetest.o formatted_string_builder_test.o numbertest_permutation.o \
+unitstest.o
 
 DEPS = $(OBJECTS:.o=.d)
 
index dbdb3e0f06cc9dc6dc1f0ba7a8cf6bf54510c18b..8d0dc75689e053855db58cf9bb75785424dbb692 100644 (file)
     <ClCompile Include="formattedvaluetest.cpp" />
     <ClCompile Include="localebuildertest.cpp" />
     <ClCompile Include="localematchertest.cpp" />
+    <ClCompile Include="unitstest.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="colldata.h" />
index 0bf336b01abdcf1cbffc497ede90e27b36d69cbd..f068ff80e7fd920377c182f4bfed09e307232aa5 100644 (file)
     <ClCompile Include="localematchertest.cpp">
       <Filter>locales &amp; resources</Filter>
     </ClCompile>
+    <ClCompile Include="unitstest.cpp">
+      <Filter>formatting</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="itrbbi.h">
index 870728a9a0a90b4b94ef37d6c43cbe3f1ae5978f..9126d528fa25ff60bd47beb2f5ffcb17630f2a6a 100644 (file)
@@ -74,6 +74,7 @@ extern IntlTest *createScientificNumberFormatterTest();
 extern IntlTest *createFormattedValueTest();
 extern IntlTest *createFormattedStringBuilderTest();
 extern IntlTest *createStringSegmentTest();
+extern IntlTest *createUnitsTest();
 
 
 #define TESTCLASS(id, TestClass)          \
@@ -247,6 +248,15 @@ void IntlTestFormat::runIndexedTest( int32_t index, UBool exec, const char* &nam
             callTest(*test, par);
           }
           break;
+        case 56:
+          name = "UnitsTest";
+          if (exec) {
+            logln("UnitsTest test---");
+            logln((UnicodeString)"");
+            LocalPointer<IntlTest> test(createUnitsTest());
+            callTest(*test, par);
+          }
+          break;
         default: name = ""; break; //needed to end loop
     }
     if (exec) {
diff --git a/icu4c/source/test/intltest/unitstest.cpp b/icu4c/source/test/intltest/unitstest.cpp
new file mode 100644 (file)
index 0000000..c0d52d3
--- /dev/null
@@ -0,0 +1,40 @@
+// © 2020 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html#License
+
+#include "unicode/utypes.h"
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "intltest.h"
+
+
+class UnitsTest : public IntlTest {
+public:
+    UnitsTest() {}
+
+    void runIndexedTest(int32_t index, UBool exec, const char *&name, char *par=NULL);
+
+    void testBasic();
+};
+
+extern IntlTest *createUnitsTest() {
+    return new UnitsTest();
+}
+
+void UnitsTest::runIndexedTest(int32_t index, UBool exec, const char *&name, char * /*par*/) {
+    if(exec) {
+        logln("TestSuite UnitsTest: ");
+    }
+    TESTCASE_AUTO_BEGIN;
+    TESTCASE_AUTO(testBasic);
+    TESTCASE_AUTO_END;
+}
+
+void UnitsTest::testBasic() {
+    IcuTestErrorCode status(*this, "testBasic");
+
+    assertEquals("message", 1, 2);
+}
+
+
+#endif // !UCONFIG_NO_FORMATTING