Home | History | Annotate | Download | only in convperf
      1 /*
      2 **********************************************************************
      3 * Copyright (c) 2002-2005, International Business Machines
      4 * Corporation and others.  All Rights Reserved.
      5 **********************************************************************
      6 **********************************************************************
      7 */
      8 /**
      9  * This Program tests the performance of ICU's Normalization engine against Windows
     10  * to run it use the command like
     11  *
     12  * c:\normperf.exe -s C:\work\ICUCupertinoRep\icu4c\collation-perf-data  -i 10 -p 15 -f TestNames_Asian.txt -u -e UTF-8  -l
     13  */
     14 #include "convperf.h"
     15 #include "data.h"
     16 #include <stdio.h>
     17 
     18 int main(int argc, const char* argv[]){
     19     UErrorCode status = U_ZERO_ERROR;
     20     ConverterPerformanceTest test(argc, argv, status);
     21     if(U_FAILURE(status)){
     22         return status;
     23     }
     24     if(test.run()==FALSE){
     25         fprintf(stderr,"FAILED: Tests could not be run please check the arguments.\n");
     26         return -1;
     27     }
     28     return 0;
     29 }
     30 
     31 
     32 ConverterPerformanceTest::ConverterPerformanceTest(int32_t argc, const char* argv[], UErrorCode& status)
     33 : UPerfTest(argc,argv,status){
     34 
     35 }
     36 
     37 ConverterPerformanceTest::~ConverterPerformanceTest(){
     38 
     39 }
     40 
     41 UPerfFunction* ConverterPerformanceTest::runIndexedTest(int32_t index, UBool exec,const char* &name, char* par) {
     42     switch (index) {
     43         TESTCASE(0,TestICU_CleanOpenAllConverters);// This calls u_cleanup()
     44         TESTCASE(1,TestICU_OpenAllConverters);// This doesn't call u_cleanup()
     45 
     46         TESTCASE(2,TestICU_UTF8_ToUnicode);
     47         TESTCASE(3,TestICU_UTF8_FromUnicode);
     48         TESTCASE(4,TestWinANSI_UTF8_ToUnicode);
     49         TESTCASE(5,TestWinANSI_UTF8_FromUnicode);
     50         TESTCASE(6,TestWinIML2_UTF8_ToUnicode);
     51         TESTCASE(7,TestWinIML2_UTF8_FromUnicode);
     52 
     53         TESTCASE(8,TestICU_Latin1_ToUnicode);
     54         TESTCASE(9,TestICU_Latin1_FromUnicode);
     55         TESTCASE(10,TestWinIML2_Latin1_ToUnicode);
     56         TESTCASE(11,TestWinIML2_Latin1_FromUnicode);
     57 
     58         TESTCASE(12,TestICU_Latin8_ToUnicode);
     59         TESTCASE(13,TestICU_Latin8_FromUnicode);
     60         TESTCASE(14,TestWinIML2_Latin8_ToUnicode);
     61         TESTCASE(15,TestWinIML2_Latin8_FromUnicode);
     62 
     63         TESTCASE(16,TestICU_EBCDIC_Arabic_ToUnicode);
     64         TESTCASE(17,TestICU_EBCDIC_Arabic_FromUnicode);
     65         TESTCASE(18,TestWinIML2_EBCDIC_Arabic_ToUnicode);
     66         TESTCASE(19,TestWinIML2_EBCDIC_Arabic_FromUnicode);
     67 
     68         TESTCASE(20,TestICU_SJIS_ToUnicode);
     69         TESTCASE(21,TestICU_SJIS_FromUnicode);
     70         TESTCASE(22,TestWinIML2_SJIS_ToUnicode);
     71         TESTCASE(23,TestWinIML2_SJIS_FromUnicode);
     72 
     73         TESTCASE(24,TestICU_EUCJP_ToUnicode);
     74         TESTCASE(25,TestICU_EUCJP_FromUnicode);
     75         TESTCASE(26,TestWinIML2_EUCJP_ToUnicode);
     76         TESTCASE(27,TestWinIML2_EUCJP_FromUnicode);
     77 
     78         TESTCASE(28,TestICU_GB2312_FromUnicode);
     79         TESTCASE(29,TestICU_GB2312_ToUnicode);
     80         TESTCASE(30,TestWinIML2_GB2312_ToUnicode);
     81         TESTCASE(31,TestWinIML2_GB2312_FromUnicode);
     82 
     83         TESTCASE(32,TestICU_ISO2022KR_ToUnicode);
     84         TESTCASE(33,TestICU_ISO2022KR_FromUnicode);
     85         TESTCASE(34,TestWinIML2_ISO2022KR_ToUnicode);
     86         TESTCASE(35,TestWinIML2_ISO2022KR_FromUnicode);
     87 
     88         TESTCASE(36,TestICU_ISO2022JP_ToUnicode);
     89         TESTCASE(37,TestICU_ISO2022JP_FromUnicode);
     90         TESTCASE(38,TestWinIML2_ISO2022JP_ToUnicode);
     91         TESTCASE(39,TestWinIML2_ISO2022JP_FromUnicode);
     92 
     93         TESTCASE(40,TestWinANSI_Latin1_ToUnicode);
     94         TESTCASE(41,TestWinANSI_Latin1_FromUnicode);
     95 
     96         TESTCASE(42,TestWinANSI_Latin8_ToUnicode);
     97         TESTCASE(43,TestWinANSI_Latin8_FromUnicode);
     98 
     99         TESTCASE(44,TestWinANSI_SJIS_ToUnicode);
    100         TESTCASE(45,TestWinANSI_SJIS_FromUnicode);
    101 
    102         TESTCASE(46,TestWinANSI_EUCJP_ToUnicode);
    103         TESTCASE(47,TestWinANSI_EUCJP_FromUnicode);
    104 
    105         TESTCASE(48,TestWinANSI_GB2312_ToUnicode);
    106         TESTCASE(49,TestWinANSI_GB2312_FromUnicode);
    107 
    108         TESTCASE(50,TestWinANSI_ISO2022KR_ToUnicode);
    109         TESTCASE(51,TestWinANSI_ISO2022KR_FromUnicode);
    110 
    111         TESTCASE(52,TestWinANSI_ISO2022JP_ToUnicode);
    112         TESTCASE(53,TestWinANSI_ISO2022JP_FromUnicode);
    113 
    114         default:
    115             name = "";
    116             return NULL;
    117     }
    118     return NULL;
    119 
    120 }
    121 
    122 UPerfFunction* ConverterPerformanceTest::TestICU_CleanOpenAllConverters() {
    123     UErrorCode status = U_ZERO_ERROR;
    124     UPerfFunction* pf = new ICUOpenAllConvertersFunction(TRUE, status);
    125     if(U_FAILURE(status)){
    126         return NULL;
    127     }
    128     return pf;
    129 }
    130 
    131 UPerfFunction* ConverterPerformanceTest::TestICU_OpenAllConverters() {
    132     UErrorCode status = U_ZERO_ERROR;
    133     UPerfFunction* pf = new ICUOpenAllConvertersFunction(FALSE, status);
    134     if(U_FAILURE(status)){
    135         return NULL;
    136     }
    137     return pf;
    138 }
    139 
    140 UPerfFunction* ConverterPerformanceTest::TestICU_UTF8_FromUnicode(){
    141     UErrorCode status = U_ZERO_ERROR;
    142     ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("utf-8",utf8_uniSource, LENGTHOF(utf8_uniSource), status);
    143     if(U_FAILURE(status)){
    144         return NULL;
    145     }
    146     return pf;
    147 }
    148 
    149 UPerfFunction*  ConverterPerformanceTest::TestICU_UTF8_ToUnicode(){
    150     UErrorCode status = U_ZERO_ERROR;
    151     UPerfFunction* pf = new ICUToUnicodePerfFunction("utf-8",(char*)utf8_encSource, LENGTHOF(utf8_encSource), status);
    152     if(U_FAILURE(status)){
    153         return NULL;
    154     }
    155     return pf;
    156 }
    157 
    158 
    159 UPerfFunction* ConverterPerformanceTest::TestWinIML2_UTF8_FromUnicode(){
    160     UErrorCode status = U_ZERO_ERROR;
    161     UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("utf-8",utf8_uniSource, LENGTHOF(utf8_uniSource), status);
    162     if(U_FAILURE(status)){
    163         return NULL;
    164     }
    165     return pf;
    166 }
    167 
    168 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_UTF8_ToUnicode(){
    169     UErrorCode status = U_ZERO_ERROR;
    170     UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("utf-8",(char*)utf8_encSource, LENGTHOF(utf8_encSource), status);
    171     if(U_FAILURE(status)){
    172         return NULL;
    173     }
    174     return pf;
    175 }
    176 
    177 UPerfFunction* ConverterPerformanceTest::TestWinANSI_UTF8_FromUnicode(){
    178     UErrorCode status = U_ZERO_ERROR;
    179     UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("utf-8",utf8_uniSource, LENGTHOF(utf8_uniSource), status);
    180     if(U_FAILURE(status)){
    181         return NULL;
    182     }
    183     return pf;
    184 }
    185 
    186 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_UTF8_ToUnicode(){
    187     UErrorCode status = U_ZERO_ERROR;
    188     UPerfFunction* pf = new WinANSIToUnicodePerfFunction("utf-8",(char*)utf8_encSource, LENGTHOF(utf8_encSource), status);
    189     if(U_FAILURE(status)){
    190         return NULL;
    191     }
    192     return pf;
    193 }
    194 
    195 //################
    196 
    197 UPerfFunction* ConverterPerformanceTest::TestICU_Latin1_FromUnicode(){
    198     UErrorCode status = U_ZERO_ERROR;
    199     ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-1",latin1_uniSource, LENGTHOF(latin1_uniSource), status);
    200     if(U_FAILURE(status)){
    201         return NULL;
    202     }
    203     return pf;
    204 }
    205 
    206 UPerfFunction*  ConverterPerformanceTest::TestICU_Latin1_ToUnicode(){
    207     UErrorCode status = U_ZERO_ERROR;
    208     UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, LENGTHOF(latin1_encSource), status);
    209     if(U_FAILURE(status)){
    210         return NULL;
    211     }
    212     return pf;
    213 }
    214 
    215 
    216 UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin1_FromUnicode(){
    217     UErrorCode status = U_ZERO_ERROR;
    218     UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-8859-1",latin1_uniSource, LENGTHOF(latin1_uniSource), status);
    219     if(U_FAILURE(status)){
    220         return NULL;
    221     }
    222     return pf;
    223 }
    224 
    225 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_Latin1_ToUnicode(){
    226     UErrorCode status = U_ZERO_ERROR;
    227     UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, LENGTHOF(latin1_encSource), status);
    228     if(U_FAILURE(status)){
    229         return NULL;
    230     }
    231     return pf;
    232 }
    233 
    234 UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin1_FromUnicode(){
    235     UErrorCode status = U_ZERO_ERROR;
    236     UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-8859-1",latin1_uniSource, LENGTHOF(latin1_uniSource), status);
    237     if(U_FAILURE(status)){
    238         return NULL;
    239     }
    240     return pf;
    241 }
    242 
    243 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_Latin1_ToUnicode(){
    244     UErrorCode status = U_ZERO_ERROR;
    245     UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, LENGTHOF(latin1_encSource), status);
    246     if(U_FAILURE(status)){
    247         return NULL;
    248     }
    249     return pf;
    250 }
    251 
    252 //##################
    253 
    254 UPerfFunction* ConverterPerformanceTest::TestICU_Latin8_FromUnicode(){
    255     UErrorCode status = U_ZERO_ERROR;
    256     ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-8",latin8_uniSource, LENGTHOF(latin8_uniSource), status);
    257     if(U_FAILURE(status)){
    258         return NULL;
    259     }
    260     return pf;
    261 }
    262 
    263 UPerfFunction*  ConverterPerformanceTest::TestICU_Latin8_ToUnicode(){
    264     UErrorCode status = U_ZERO_ERROR;
    265     UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, LENGTHOF(latin8_encSource), status);
    266     if(U_FAILURE(status)){
    267         return NULL;
    268     }
    269     return pf;
    270 }
    271 
    272 
    273 UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin8_FromUnicode(){
    274     UErrorCode status = U_ZERO_ERROR;
    275     UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-8859-8",latin8_uniSource, LENGTHOF(latin8_uniSource), status);
    276     if(U_FAILURE(status)){
    277         return NULL;
    278     }
    279     return pf;
    280 }
    281 
    282 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_Latin8_ToUnicode(){
    283     UErrorCode status = U_ZERO_ERROR;
    284     UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, LENGTHOF(latin8_encSource), status);
    285     if(U_FAILURE(status)){
    286         return NULL;
    287     }
    288     return pf;
    289 }
    290 UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin8_FromUnicode(){
    291     UErrorCode status = U_ZERO_ERROR;
    292     UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-8859-8",latin8_uniSource, LENGTHOF(latin8_uniSource), status);
    293     if(U_FAILURE(status)){
    294         return NULL;
    295     }
    296     return pf;
    297 }
    298 
    299 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_Latin8_ToUnicode(){
    300     UErrorCode status = U_ZERO_ERROR;
    301     UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, LENGTHOF(latin8_encSource), status);
    302     if(U_FAILURE(status)){
    303         return NULL;
    304     }
    305     return pf;
    306 }
    307 
    308 //#################
    309 
    310 
    311 UPerfFunction* ConverterPerformanceTest::TestICU_EBCDIC_Arabic_FromUnicode(){
    312     UErrorCode status = U_ZERO_ERROR;
    313     ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, LENGTHOF(ebcdic_arabic_uniSource), status);
    314     if(U_FAILURE(status)){
    315         return NULL;
    316     }
    317     return pf;
    318 }
    319 
    320 UPerfFunction*  ConverterPerformanceTest::TestICU_EBCDIC_Arabic_ToUnicode(){
    321     UErrorCode status = U_ZERO_ERROR;
    322     UPerfFunction* pf = new ICUToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, LENGTHOF(ebcdic_arabic_encSource), status);
    323     if(U_FAILURE(status)){
    324         return NULL;
    325     }
    326     return pf;
    327 }
    328 
    329 
    330 UPerfFunction* ConverterPerformanceTest::TestWinIML2_EBCDIC_Arabic_FromUnicode(){
    331     UErrorCode status = U_ZERO_ERROR;
    332     UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, LENGTHOF(ebcdic_arabic_uniSource), status);
    333     if(U_FAILURE(status)){
    334         return NULL;
    335     }
    336     return pf;
    337 }
    338 
    339 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_EBCDIC_Arabic_ToUnicode(){
    340     UErrorCode status = U_ZERO_ERROR;
    341     UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, LENGTHOF(ebcdic_arabic_encSource), status);
    342     if(U_FAILURE(status)){
    343         return NULL;
    344     }
    345     return pf;
    346 }
    347 
    348 UPerfFunction* ConverterPerformanceTest::TestWinANSI_EBCDIC_Arabic_FromUnicode(){
    349     UErrorCode status = U_ZERO_ERROR;
    350     UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, LENGTHOF(ebcdic_arabic_uniSource), status);
    351     if(U_FAILURE(status)){
    352         return NULL;
    353     }
    354     return pf;
    355 }
    356 
    357 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_EBCDIC_Arabic_ToUnicode(){
    358     UErrorCode status = U_ZERO_ERROR;
    359     UPerfFunction* pf = new WinANSIToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, LENGTHOF(ebcdic_arabic_encSource), status);
    360     if(U_FAILURE(status)){
    361         return NULL;
    362     }
    363     return pf;
    364 }
    365 //#################
    366 
    367 
    368 UPerfFunction* ConverterPerformanceTest::TestICU_SJIS_FromUnicode(){
    369     UErrorCode status = U_ZERO_ERROR;
    370     ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("sjis",sjis_uniSource, LENGTHOF(sjis_uniSource), status);
    371     if(U_FAILURE(status)){
    372         return NULL;
    373     }
    374     return pf;
    375 }
    376 
    377 UPerfFunction*  ConverterPerformanceTest::TestICU_SJIS_ToUnicode(){
    378     UErrorCode status = U_ZERO_ERROR;
    379     UPerfFunction* pf = new ICUToUnicodePerfFunction("sjis",(char*)sjis_encSource, LENGTHOF(sjis_encSource), status);
    380     if(U_FAILURE(status)){
    381         return NULL;
    382     }
    383     return pf;
    384 }
    385 
    386 
    387 UPerfFunction* ConverterPerformanceTest::TestWinIML2_SJIS_FromUnicode(){
    388     UErrorCode status = U_ZERO_ERROR;
    389     UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("sjis",sjis_uniSource, LENGTHOF(sjis_uniSource), status);
    390     if(U_FAILURE(status)){
    391         return NULL;
    392     }
    393     return pf;
    394 }
    395 
    396 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_SJIS_ToUnicode(){
    397     UErrorCode status = U_ZERO_ERROR;
    398     UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("sjis",(char*)sjis_encSource, LENGTHOF(sjis_encSource), status);
    399     if(U_FAILURE(status)){
    400         return NULL;
    401     }
    402     return pf;
    403 }
    404 
    405 UPerfFunction* ConverterPerformanceTest::TestWinANSI_SJIS_FromUnicode(){
    406     UErrorCode status = U_ZERO_ERROR;
    407     UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("sjis",sjis_uniSource, LENGTHOF(sjis_uniSource), status);
    408     if(U_FAILURE(status)){
    409         return NULL;
    410     }
    411     return pf;
    412 }
    413 
    414 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_SJIS_ToUnicode(){
    415     UErrorCode status = U_ZERO_ERROR;
    416     UPerfFunction* pf = new WinANSIToUnicodePerfFunction("sjis",(char*)sjis_encSource, LENGTHOF(sjis_encSource), status);
    417     if(U_FAILURE(status)){
    418         return NULL;
    419     }
    420     return pf;
    421 }
    422 
    423 
    424 //#################
    425 
    426 
    427 UPerfFunction* ConverterPerformanceTest::TestICU_EUCJP_FromUnicode(){
    428     UErrorCode status = U_ZERO_ERROR;
    429     ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("euc-jp",eucjp_uniSource, LENGTHOF(eucjp_uniSource), status);
    430     if(U_FAILURE(status)){
    431         return NULL;
    432     }
    433     return pf;
    434 }
    435 
    436 UPerfFunction*  ConverterPerformanceTest::TestICU_EUCJP_ToUnicode(){
    437     UErrorCode status = U_ZERO_ERROR;
    438     UPerfFunction* pf = new ICUToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, LENGTHOF(eucjp_encSource), status);
    439     if(U_FAILURE(status)){
    440         return NULL;
    441     }
    442     return pf;
    443 }
    444 
    445 
    446 UPerfFunction* ConverterPerformanceTest::TestWinIML2_EUCJP_FromUnicode(){
    447     UErrorCode status = U_ZERO_ERROR;
    448     UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("euc-jp",eucjp_uniSource, LENGTHOF(eucjp_uniSource), status);
    449     if(U_FAILURE(status)){
    450         return NULL;
    451     }
    452     return pf;
    453 }
    454 
    455 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_EUCJP_ToUnicode(){
    456     UErrorCode status = U_ZERO_ERROR;
    457     UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, LENGTHOF(eucjp_encSource), status);
    458     if(U_FAILURE(status)){
    459         return NULL;
    460     }
    461     return pf;
    462 }
    463 
    464 UPerfFunction* ConverterPerformanceTest::TestWinANSI_EUCJP_FromUnicode(){
    465     UErrorCode status = U_ZERO_ERROR;
    466     UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("euc-jp",eucjp_uniSource, LENGTHOF(eucjp_uniSource), status);
    467     if(U_FAILURE(status)){
    468         return NULL;
    469     }
    470     return pf;
    471 }
    472 
    473 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_EUCJP_ToUnicode(){
    474     UErrorCode status = U_ZERO_ERROR;
    475     UPerfFunction* pf = new WinANSIToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, LENGTHOF(eucjp_encSource), status);
    476     if(U_FAILURE(status)){
    477         return NULL;
    478     }
    479     return pf;
    480 }
    481 
    482 
    483 //#################
    484 
    485 
    486 UPerfFunction* ConverterPerformanceTest::TestICU_GB2312_FromUnicode(){
    487     UErrorCode status = U_ZERO_ERROR;
    488     ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("gb2312",gb2312_uniSource, LENGTHOF(gb2312_uniSource), status);
    489     if(U_FAILURE(status)){
    490         return NULL;
    491     }
    492     return pf;
    493 }
    494 
    495 UPerfFunction*  ConverterPerformanceTest::TestICU_GB2312_ToUnicode(){
    496     UErrorCode status = U_ZERO_ERROR;
    497     UPerfFunction* pf = new ICUToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, LENGTHOF(gb2312_encSource), status);
    498     if(U_FAILURE(status)){
    499         return NULL;
    500     }
    501     return pf;
    502 }
    503 
    504 
    505 UPerfFunction* ConverterPerformanceTest::TestWinIML2_GB2312_FromUnicode(){
    506     UErrorCode status = U_ZERO_ERROR;
    507     UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("gb2312",gb2312_uniSource, LENGTHOF(gb2312_uniSource), status);
    508     if(U_FAILURE(status)){
    509         return NULL;
    510     }
    511     return pf;
    512 }
    513 
    514 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_GB2312_ToUnicode(){
    515     UErrorCode status = U_ZERO_ERROR;
    516     UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, LENGTHOF(gb2312_encSource), status);
    517     if(U_FAILURE(status)){
    518         return NULL;
    519     }
    520     return pf;
    521 }
    522 
    523 UPerfFunction* ConverterPerformanceTest::TestWinANSI_GB2312_FromUnicode(){
    524     UErrorCode status = U_ZERO_ERROR;
    525     UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("gb2312",gb2312_uniSource, LENGTHOF(gb2312_uniSource), status);
    526     if(U_FAILURE(status)){
    527         return NULL;
    528     }
    529     return pf;
    530 }
    531 
    532 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_GB2312_ToUnicode(){
    533     UErrorCode status = U_ZERO_ERROR;
    534     UPerfFunction* pf = new WinANSIToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, LENGTHOF(gb2312_encSource), status);
    535     if(U_FAILURE(status)){
    536         return NULL;
    537     }
    538     return pf;
    539 }
    540 
    541 //#################
    542 
    543 
    544 UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022KR_FromUnicode(){
    545     UErrorCode status = U_ZERO_ERROR;
    546     ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, LENGTHOF(iso2022kr_uniSource), status);
    547     if(U_FAILURE(status)){
    548         return NULL;
    549     }
    550     return pf;
    551 }
    552 
    553 UPerfFunction*  ConverterPerformanceTest::TestICU_ISO2022KR_ToUnicode(){
    554     UErrorCode status = U_ZERO_ERROR;
    555     UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, LENGTHOF(iso2022kr_encSource), status);
    556     if(U_FAILURE(status)){
    557         return NULL;
    558     }
    559     return pf;
    560 }
    561 
    562 
    563 UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022KR_FromUnicode(){
    564     UErrorCode status = U_ZERO_ERROR;
    565     UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, LENGTHOF(iso2022kr_uniSource), status);
    566     if(U_FAILURE(status)){
    567         return NULL;
    568     }
    569     return pf;
    570 }
    571 
    572 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_ISO2022KR_ToUnicode(){
    573     UErrorCode status = U_ZERO_ERROR;
    574     UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, LENGTHOF(iso2022kr_encSource), status);
    575     if(U_FAILURE(status)){
    576         return NULL;
    577     }
    578     return pf;
    579 }
    580 
    581 UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022KR_FromUnicode(){
    582     UErrorCode status = U_ZERO_ERROR;
    583     UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, LENGTHOF(iso2022kr_uniSource), status);
    584     if(U_FAILURE(status)){
    585         return NULL;
    586     }
    587     return pf;
    588 }
    589 
    590 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_ISO2022KR_ToUnicode(){
    591     UErrorCode status = U_ZERO_ERROR;
    592     UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, LENGTHOF(iso2022kr_encSource), status);
    593     if(U_FAILURE(status)){
    594         return NULL;
    595     }
    596     return pf;
    597 }
    598 //#################
    599 
    600 
    601 UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022JP_FromUnicode(){
    602     UErrorCode status = U_ZERO_ERROR;
    603     ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, LENGTHOF(iso2022jp_uniSource), status);
    604     if(U_FAILURE(status)){
    605         return NULL;
    606     }
    607     return pf;
    608 }
    609 
    610 UPerfFunction*  ConverterPerformanceTest::TestICU_ISO2022JP_ToUnicode(){
    611     UErrorCode status = U_ZERO_ERROR;
    612     UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, LENGTHOF(iso2022jp_encSource), status);
    613     if(U_FAILURE(status)){
    614         return NULL;
    615     }
    616     return pf;
    617 }
    618 
    619 
    620 UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022JP_FromUnicode(){
    621     UErrorCode status = U_ZERO_ERROR;
    622     UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, LENGTHOF(iso2022jp_uniSource), status);
    623     if(U_FAILURE(status)){
    624         return NULL;
    625     }
    626     return pf;
    627 }
    628 
    629 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_ISO2022JP_ToUnicode(){
    630     UErrorCode status = U_ZERO_ERROR;
    631     UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, LENGTHOF(iso2022jp_encSource), status);
    632     if(U_FAILURE(status)){
    633         return NULL;
    634     }
    635     return pf;
    636 }
    637 
    638 UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022JP_FromUnicode(){
    639     UErrorCode status = U_ZERO_ERROR;
    640     UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, LENGTHOF(iso2022jp_uniSource), status);
    641     if(U_FAILURE(status)){
    642         return NULL;
    643     }
    644     return pf;
    645 }
    646 
    647 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_ISO2022JP_ToUnicode(){
    648     UErrorCode status = U_ZERO_ERROR;
    649     UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, LENGTHOF(iso2022jp_encSource), status);
    650     if(U_FAILURE(status)){
    651         return NULL;
    652     }
    653     return pf;
    654 }