]> granicus.if.org Git - icu/commitdiff
skeleton for unit test in icu
authorYounies <younies.mahmoud@gmail.com>
Thu, 16 Jan 2020 19:07:04 +0000 (20:07 +0100)
committerYounies <younies.mahmoud@gmail.com>
Thu, 16 Jan 2020 19:35:08 +0000 (20:35 +0100)
icu4c/source/test/intltest/unitstest.cpp

index 695ca18d533aa7c7eeb84ab1f819b7cf0650ecff..9b37e224f0d0170eba5609f78810650504bb9c11 100644 (file)
@@ -35,6 +35,9 @@ double testConvert(const char16_t* source , const char16_t* target , double inpu
     if (source == u"meter" && target ==u"foot" && input == 1.0)
         return 3.28084;
 
+    if (source == u"kilometer" && target ==u"foot" && input == 1.0)
+        return 328.084;
+
     return -1;    
 }
 
@@ -49,7 +52,8 @@ void UnitsTest::testBasic() {
         const double expectedValue;
         } testCases[]
         {
-            {u"meter" , u"foot" , 1.0 , 3.28084 }
+            {u"meter" , u"foot" , 1.0 , 3.28084 },
+            {u"kilometer" , u"foot" , 1.0 , 328.084 }
         };
 
         for (size_t i = 0; i < 1; i++)