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