mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-20 20:19:32 +00:00
ICU-3068 add perfomrance test to perf framework
X-SVN-Rev: 12672
This commit is contained in:
parent
716b9dec98
commit
1b0883d4b0
7 changed files with 4146 additions and 0 deletions
632
icu4c/source/test/perf/convperf/convperf.cpp
Normal file
632
icu4c/source/test/perf/convperf/convperf.cpp
Normal file
|
@ -0,0 +1,632 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2002-2003, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
*/
|
||||
/**
|
||||
* This Program tests the performance of ICU's Normalization engine against Windows
|
||||
* to run it use the command like
|
||||
*
|
||||
* c:\normperf.exe -s C:\work\ICUCupertinoRep\icu4c\collation-perf-data -i 10 -p 15 -f TestNames_Asian.txt -u -e UTF-8 -l
|
||||
*/
|
||||
#include "convperf.h"
|
||||
#include "data.h"
|
||||
|
||||
int main(int argc, const char* argv[]){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ConverterPerformanceTest test(argc, argv, status);
|
||||
if(U_FAILURE(status)){
|
||||
return status;
|
||||
}
|
||||
if(test.run()==FALSE){
|
||||
fprintf(stderr,"FAILED: Tests could not be run please check the arguments.\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ConverterPerformanceTest::ConverterPerformanceTest(int32_t argc, const char* argv[], UErrorCode& status)
|
||||
: UPerfTest(argc,argv,status){
|
||||
|
||||
}
|
||||
|
||||
ConverterPerformanceTest::~ConverterPerformanceTest(){
|
||||
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::runIndexedTest(int32_t index, UBool exec,const char* &name, char* par) {
|
||||
switch (index) {
|
||||
TESTCASE(0,TestICU_UTF8_ToUnicode);
|
||||
TESTCASE(1,TestICU_UTF8_FromUnicode);
|
||||
TESTCASE(2,TestWinANSI_UTF8_ToUnicode);
|
||||
TESTCASE(3,TestWinANSI_UTF8_FromUnicode);
|
||||
TESTCASE(4,TestWinIML2_UTF8_ToUnicode);
|
||||
TESTCASE(5,TestWinIML2_UTF8_FromUnicode);
|
||||
|
||||
TESTCASE(6,TestICU_Latin1_ToUnicode);
|
||||
TESTCASE(7,TestICU_Latin1_FromUnicode);
|
||||
TESTCASE(8,TestWinIML2_Latin1_ToUnicode);
|
||||
TESTCASE(9,TestWinIML2_Latin1_FromUnicode);
|
||||
|
||||
TESTCASE(10,TestICU_Latin8_ToUnicode);
|
||||
TESTCASE(11,TestICU_Latin8_FromUnicode);
|
||||
TESTCASE(12,TestWinIML2_Latin8_ToUnicode);
|
||||
TESTCASE(13,TestWinIML2_Latin8_FromUnicode);
|
||||
|
||||
TESTCASE(14,TestICU_EBCDIC_Arabic_ToUnicode);
|
||||
TESTCASE(15,TestICU_EBCDIC_Arabic_FromUnicode);
|
||||
TESTCASE(16,TestWinIML2_EBCDIC_Arabic_ToUnicode);
|
||||
TESTCASE(17,TestWinIML2_EBCDIC_Arabic_FromUnicode);
|
||||
|
||||
TESTCASE(18,TestICU_SJIS_ToUnicode);
|
||||
TESTCASE(19,TestICU_SJIS_FromUnicode);
|
||||
TESTCASE(20,TestWinIML2_SJIS_ToUnicode);
|
||||
TESTCASE(21,TestWinIML2_SJIS_FromUnicode);
|
||||
|
||||
TESTCASE(22,TestICU_EUCJP_ToUnicode);
|
||||
TESTCASE(23,TestICU_EUCJP_FromUnicode);
|
||||
TESTCASE(24,TestWinIML2_EUCJP_ToUnicode);
|
||||
TESTCASE(25,TestWinIML2_EUCJP_FromUnicode);
|
||||
|
||||
TESTCASE(26,TestICU_GB2312_FromUnicode);
|
||||
TESTCASE(27,TestICU_GB2312_ToUnicode);
|
||||
TESTCASE(28,TestWinIML2_GB2312_ToUnicode);
|
||||
TESTCASE(29,TestWinIML2_GB2312_FromUnicode);
|
||||
|
||||
TESTCASE(30,TestICU_ISO2022KR_ToUnicode);
|
||||
TESTCASE(31,TestICU_ISO2022KR_FromUnicode);
|
||||
TESTCASE(32,TestWinIML2_ISO2022KR_ToUnicode);
|
||||
TESTCASE(33,TestWinIML2_ISO2022KR_FromUnicode);
|
||||
|
||||
TESTCASE(34,TestICU_ISO2022JP_ToUnicode);
|
||||
TESTCASE(35,TestICU_ISO2022JP_FromUnicode);
|
||||
TESTCASE(36,TestWinIML2_ISO2022JP_ToUnicode);
|
||||
TESTCASE(37,TestWinIML2_ISO2022JP_FromUnicode);
|
||||
|
||||
TESTCASE(38,TestWinANSI_Latin1_ToUnicode);
|
||||
TESTCASE(39,TestWinANSI_Latin1_FromUnicode);
|
||||
|
||||
TESTCASE(40,TestWinANSI_Latin8_ToUnicode);
|
||||
TESTCASE(41,TestWinANSI_Latin8_FromUnicode);
|
||||
|
||||
TESTCASE(42,TestWinANSI_SJIS_ToUnicode);
|
||||
TESTCASE(43,TestWinANSI_SJIS_FromUnicode);
|
||||
|
||||
TESTCASE(44,TestWinANSI_EUCJP_ToUnicode);
|
||||
TESTCASE(45,TestWinANSI_EUCJP_FromUnicode);
|
||||
|
||||
TESTCASE(46,TestWinANSI_GB2312_ToUnicode);
|
||||
TESTCASE(47,TestWinANSI_GB2312_FromUnicode);
|
||||
|
||||
TESTCASE(48,TestWinANSI_ISO2022KR_ToUnicode);
|
||||
TESTCASE(49,TestWinANSI_ISO2022KR_FromUnicode);
|
||||
|
||||
TESTCASE(50,TestWinANSI_ISO2022JP_ToUnicode);
|
||||
TESTCASE(51,TestWinANSI_ISO2022JP_FromUnicode);
|
||||
|
||||
default:
|
||||
name = "";
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_UTF8_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("utf-8",utf8_uniSource, LENGTHOF(utf8_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_UTF8_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new ICUToUnicodePerfFunction("utf-8",(char*)utf8_encSource, LENGTHOF(utf8_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_UTF8_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("utf-8",utf8_uniSource, LENGTHOF(utf8_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_UTF8_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("utf-8",(char*)utf8_encSource, LENGTHOF(utf8_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_UTF8_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("utf-8",utf8_uniSource, LENGTHOF(utf8_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_UTF8_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIToUnicodePerfFunction("utf-8",(char*)utf8_encSource, LENGTHOF(utf8_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
//################
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_Latin1_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-1",latin1_uniSource, LENGTHOF(latin1_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_Latin1_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, LENGTHOF(latin1_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin1_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-8859-1",latin1_uniSource, LENGTHOF(latin1_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin1_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, LENGTHOF(latin1_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin1_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-8859-1",latin1_uniSource, LENGTHOF(latin1_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin1_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, LENGTHOF(latin1_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
//##################
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_Latin8_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-8",latin8_uniSource, LENGTHOF(latin8_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_Latin8_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, LENGTHOF(latin8_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin8_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-8859-8",latin8_uniSource, LENGTHOF(latin8_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin8_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, LENGTHOF(latin8_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin8_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-8859-8",latin8_uniSource, LENGTHOF(latin8_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin8_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, LENGTHOF(latin8_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
//#################
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_EBCDIC_Arabic_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, LENGTHOF(ebcdic_arabic_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_EBCDIC_Arabic_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new ICUToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, LENGTHOF(ebcdic_arabic_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_EBCDIC_Arabic_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, LENGTHOF(ebcdic_arabic_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_EBCDIC_Arabic_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, LENGTHOF(ebcdic_arabic_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_EBCDIC_Arabic_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, LENGTHOF(ebcdic_arabic_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_EBCDIC_Arabic_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, LENGTHOF(ebcdic_arabic_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
//#################
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_SJIS_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("sjis",sjis_uniSource, LENGTHOF(sjis_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_SJIS_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new ICUToUnicodePerfFunction("sjis",(char*)sjis_encSource, LENGTHOF(sjis_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_SJIS_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("sjis",sjis_uniSource, LENGTHOF(sjis_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_SJIS_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("sjis",(char*)sjis_encSource, LENGTHOF(sjis_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_SJIS_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("sjis",sjis_uniSource, LENGTHOF(sjis_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_SJIS_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIToUnicodePerfFunction("sjis",(char*)sjis_encSource, LENGTHOF(sjis_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
|
||||
//#################
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_EUCJP_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("euc-jp",eucjp_uniSource, LENGTHOF(eucjp_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_EUCJP_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new ICUToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, LENGTHOF(eucjp_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_EUCJP_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("euc-jp",eucjp_uniSource, LENGTHOF(eucjp_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_EUCJP_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, LENGTHOF(eucjp_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_EUCJP_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("euc-jp",eucjp_uniSource, LENGTHOF(eucjp_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_EUCJP_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, LENGTHOF(eucjp_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
|
||||
//#################
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_GB2312_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("gb2312",gb2312_uniSource, LENGTHOF(gb2312_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_GB2312_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new ICUToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, LENGTHOF(gb2312_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_GB2312_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("gb2312",gb2312_uniSource, LENGTHOF(gb2312_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_GB2312_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, LENGTHOF(gb2312_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_GB2312_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("gb2312",gb2312_uniSource, LENGTHOF(gb2312_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_GB2312_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, LENGTHOF(gb2312_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
//#################
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022KR_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, LENGTHOF(iso2022kr_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022KR_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, LENGTHOF(iso2022kr_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022KR_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, LENGTHOF(iso2022kr_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022KR_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, LENGTHOF(iso2022kr_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022KR_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, LENGTHOF(iso2022kr_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022KR_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, LENGTHOF(iso2022kr_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
//#################
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022JP_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, LENGTHOF(iso2022jp_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022JP_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, LENGTHOF(iso2022jp_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022JP_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, LENGTHOF(iso2022jp_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022JP_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, LENGTHOF(iso2022jp_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022JP_FromUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, LENGTHOF(iso2022jp_uniSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
||||
|
||||
UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022JP_ToUnicode(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, LENGTHOF(iso2022jp_encSource), status);
|
||||
if(U_FAILURE(status)){
|
||||
return NULL;
|
||||
}
|
||||
return pf;
|
||||
}
|
112
icu4c/source/test/perf/convperf/convperf.dsp
Normal file
112
icu4c/source/test/perf/convperf/convperf.dsp
Normal file
|
@ -0,0 +1,112 @@
|
|||
# Microsoft Developer Studio Project File - Name="convperf" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=convperf - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "convperf.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "convperf.mak" CFG="convperf - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "convperf - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "convperf - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "convperf - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
MTL=midl.exe
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\..\include" /I "..\..\..\common" /I "..\..\..\i18n" /I "..\..\..\tools\toolutil" /I "C:\Program Files\Microsoft SDK\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 icuuc.lib icuin.lib icutu.lib kernel32.lib user32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\lib\\"
|
||||
|
||||
!ELSEIF "$(CFG)" == "convperf - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
MTL=midl.exe
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\..\include" /I "..\..\..\tools\ctestfw" /I "..\..\..\common" /I "..\..\..\i18n" /I "..\..\..\tools\toolutil" /I "C:\Program Files\Microsoft SDK\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 icuucd.lib icuind.lib icutud.lib kernel32.lib user32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\lib\\"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "convperf - Win32 Release"
|
||||
# Name "convperf - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\convperf.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\convperf.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\data.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
531
icu4c/source/test/perf/convperf/convperf.h
Normal file
531
icu4c/source/test/perf/convperf/convperf.h
Normal file
|
@ -0,0 +1,531 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2002-2003, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
*/
|
||||
#ifndef _CONVPERF_H
|
||||
#define _CONVPERF_H
|
||||
|
||||
#include "uperf.h"
|
||||
#include "unicode/ucnv.h"
|
||||
#include "unicode/ustring.h"
|
||||
#include <mlang.h>
|
||||
#include <objbase.h>
|
||||
|
||||
#define CONVERSION_FLAGS (0) /*WC_DEFAULTCHAR WC_COMPOSITECHECK & WC_SEPCHARS*/
|
||||
#define MAX_BUF_SIZE 3048
|
||||
#define LENGTHOF(array) (sizeof(array)/sizeof((array)[0]))
|
||||
|
||||
class ICUToUnicodePerfFunction : public UPerfFunction{
|
||||
private:
|
||||
UConverter* conv;
|
||||
const char* src;
|
||||
int32_t srcLen;
|
||||
UChar* target;
|
||||
UChar* targetLimit;
|
||||
|
||||
public:
|
||||
ICUToUnicodePerfFunction(const char* name, const char* source, int32_t sourceLen, UErrorCode& status){
|
||||
conv = ucnv_open(name,&status);
|
||||
src = source;
|
||||
srcLen = sourceLen;
|
||||
if(U_FAILURE(status)){
|
||||
conv = NULL;
|
||||
return;
|
||||
}
|
||||
target = NULL;
|
||||
targetLimit = NULL;
|
||||
int32_t reqdLen = ucnv_toUChars(conv, target, 0,
|
||||
source, srcLen, &status);
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR) {
|
||||
status=U_ZERO_ERROR;
|
||||
target=(UChar*)uprv_malloc((reqdLen) * U_SIZEOF_UCHAR*2);
|
||||
targetLimit = target + reqdLen;
|
||||
if(target == NULL){
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void call(UErrorCode* status){
|
||||
const char* mySrc = src;
|
||||
const char* sourceLimit = src + srcLen;
|
||||
UChar* myTarget = target;
|
||||
ucnv_toUnicode(conv, &myTarget, targetLimit, &mySrc, sourceLimit, NULL, TRUE, status);
|
||||
}
|
||||
virtual long getOperationsPerIteration(void){
|
||||
return srcLen;
|
||||
}
|
||||
~ICUToUnicodePerfFunction(){
|
||||
uprv_free(target);
|
||||
ucnv_close(conv);
|
||||
}
|
||||
};
|
||||
class ICUFromUnicodePerfFunction : public UPerfFunction{
|
||||
private:
|
||||
UConverter* conv;
|
||||
const UChar* src;
|
||||
int32_t srcLen;
|
||||
char* target;
|
||||
char* targetLimit;
|
||||
const char* name;
|
||||
|
||||
public:
|
||||
ICUFromUnicodePerfFunction(const char* name, const UChar* source, int32_t sourceLen, UErrorCode& status){
|
||||
conv = ucnv_open(name,&status);
|
||||
src = source;
|
||||
srcLen = sourceLen;
|
||||
if(U_FAILURE(status)){
|
||||
conv = NULL;
|
||||
return;
|
||||
}
|
||||
target = NULL;
|
||||
targetLimit = NULL;
|
||||
int32_t reqdLen = ucnv_fromUChars(conv, target, 0,
|
||||
source, srcLen, &status);
|
||||
if(status==U_BUFFER_OVERFLOW_ERROR) {
|
||||
status=U_ZERO_ERROR;
|
||||
target=(char*)uprv_malloc((reqdLen*2));
|
||||
targetLimit = target + reqdLen;
|
||||
if(target == NULL){
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void call(UErrorCode* status){
|
||||
const UChar* mySrc = src;
|
||||
const UChar* sourceLimit = src + srcLen;
|
||||
char* myTarget = target;
|
||||
ucnv_fromUnicode(conv,&myTarget, targetLimit, &mySrc, sourceLimit, NULL, TRUE, status);
|
||||
}
|
||||
virtual long getOperationsPerIteration(void){
|
||||
return srcLen;
|
||||
}
|
||||
~ICUFromUnicodePerfFunction(){
|
||||
uprv_free(target);
|
||||
ucnv_close(conv);
|
||||
}
|
||||
};
|
||||
|
||||
class WinANSIToUnicodePerfFunction : public UPerfFunction{
|
||||
|
||||
private:
|
||||
DWORD uiCodePage;
|
||||
char* src;
|
||||
UINT srcLen;
|
||||
WCHAR dest[MAX_BUF_SIZE];
|
||||
UINT dstLen;
|
||||
const char* name;
|
||||
public:
|
||||
WinANSIToUnicodePerfFunction(const char* cpName, char* pszIn,UINT szLen, UErrorCode& status){
|
||||
name = cpName;
|
||||
src = pszIn;
|
||||
srcLen = szLen;
|
||||
dstLen = LENGTHOF(dest);
|
||||
unsigned short bEnc[30]={'\0'};
|
||||
const char* tenc=name;
|
||||
for(int i=0;*tenc!='\0';i++){
|
||||
bEnc[i]=*tenc;
|
||||
tenc++;
|
||||
}
|
||||
LPMULTILANGUAGE2 pMulti;
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
/* create instance of converter object*/
|
||||
CoCreateInstance(
|
||||
__uuidof(CMultiLanguage),
|
||||
NULL,
|
||||
CLSCTX_SERVER,
|
||||
__uuidof(IMultiLanguage2),
|
||||
(void**)&pMulti
|
||||
);
|
||||
|
||||
|
||||
|
||||
MIMECSETINFO mimeInfo;
|
||||
|
||||
mimeInfo.uiCodePage = 0;
|
||||
mimeInfo.uiInternetEncoding =0;
|
||||
/* get the charset info */
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
uiCodePage = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
|
||||
}
|
||||
virtual void call(UErrorCode* status){
|
||||
int winSize =MultiByteToWideChar(uiCodePage,CONVERSION_FLAGS,src,srcLen,dest,dstLen);
|
||||
}
|
||||
virtual long getOperationsPerIteration(void){
|
||||
return srcLen;
|
||||
}
|
||||
};
|
||||
|
||||
class WinANSIFromUnicodePerfFunction : public UPerfFunction{
|
||||
|
||||
private:
|
||||
DWORD uiCodePage;
|
||||
WCHAR* src;
|
||||
UINT srcLen;
|
||||
char dest[MAX_BUF_SIZE];
|
||||
UINT dstLen;
|
||||
const char* name;
|
||||
BOOL lpUsedDefaultChar;
|
||||
|
||||
public:
|
||||
WinANSIFromUnicodePerfFunction(const char* cpName, WCHAR* pszIn,UINT szLen, UErrorCode& status){
|
||||
name = cpName;
|
||||
src = pszIn;
|
||||
srcLen = szLen;
|
||||
dstLen = LENGTHOF(dest);
|
||||
lpUsedDefaultChar=FALSE;
|
||||
unsigned short bEnc[30]={'\0'};
|
||||
const char* tenc=name;
|
||||
for(int i=0;*tenc!='\0';i++){
|
||||
bEnc[i]=*tenc;
|
||||
tenc++;
|
||||
}
|
||||
LPMULTILANGUAGE2 pMulti;
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
/* create instance of converter object*/
|
||||
CoCreateInstance(
|
||||
__uuidof(CMultiLanguage),
|
||||
NULL,
|
||||
CLSCTX_SERVER,
|
||||
__uuidof(IMultiLanguage2),
|
||||
(void**)&pMulti
|
||||
);
|
||||
|
||||
|
||||
|
||||
MIMECSETINFO mimeInfo;
|
||||
mimeInfo.uiCodePage = 0;
|
||||
mimeInfo.uiInternetEncoding =0;
|
||||
/* get the charset info */
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
uiCodePage = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
|
||||
}
|
||||
virtual void call(UErrorCode* status){
|
||||
BOOL* pUsedDefaultChar =(uiCodePage==CP_UTF8)?NULL:&lpUsedDefaultChar;
|
||||
int winSize = WideCharToMultiByte(uiCodePage,CONVERSION_FLAGS,src,srcLen,dest,dstLen,NULL, pUsedDefaultChar);
|
||||
}
|
||||
virtual long getOperationsPerIteration(void){
|
||||
return srcLen;
|
||||
}
|
||||
};
|
||||
static inline void getErr(HRESULT err, UErrorCode& status){
|
||||
|
||||
switch (err){
|
||||
|
||||
case S_OK:
|
||||
//printf("Operation %s successful\n",operation);
|
||||
break;
|
||||
case S_FALSE:
|
||||
status = U_INTERNAL_PROGRAM_ERROR;
|
||||
break;
|
||||
case E_FAIL:
|
||||
status = U_ILLEGAL_CHAR_FOUND;
|
||||
}
|
||||
}
|
||||
class WinIMultiLanguageToUnicodePerfFunction : public UPerfFunction{
|
||||
|
||||
private:
|
||||
LPMULTILANGUAGE2 pMulti;
|
||||
LPMLANGCONVERTCHARSET pConvToUni;
|
||||
char* src;
|
||||
UINT srcLen;
|
||||
WCHAR dst[MAX_BUF_SIZE];
|
||||
UINT dstLen;
|
||||
const char* cpName;
|
||||
|
||||
public:
|
||||
WinIMultiLanguageToUnicodePerfFunction(const char* name,char* source, UINT sourceLen, UErrorCode& status){
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
/* create instance of converter object*/
|
||||
CoCreateInstance(
|
||||
__uuidof(CMultiLanguage),
|
||||
NULL,
|
||||
CLSCTX_SERVER,
|
||||
__uuidof(IMultiLanguage2),
|
||||
(void**)&pMulti
|
||||
);
|
||||
|
||||
|
||||
|
||||
MIMECSETINFO mimeInfo;
|
||||
mimeInfo.uiCodePage = 0;
|
||||
mimeInfo.uiInternetEncoding =0;
|
||||
HRESULT err=S_OK;
|
||||
unsigned short bEnc[30]={'\0'};
|
||||
const char* tenc=name;
|
||||
for(int i=0;*tenc!='\0';i++){
|
||||
bEnc[i]=*tenc;
|
||||
tenc++;
|
||||
}
|
||||
/* get the charset info */
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
pMulti->CreateConvertCharset(mimeInfo.uiCodePage, 1200 /*unicode*/, (DWORD)0,&pConvToUni);
|
||||
getErr(err,status);
|
||||
src = source;
|
||||
srcLen = sourceLen;
|
||||
dstLen = LENGTHOF(dst);
|
||||
cpName = name;
|
||||
}
|
||||
|
||||
virtual void call(UErrorCode* status){
|
||||
HRESULT err= pConvToUni->DoConversionToUnicode(src,&srcLen,dst, &dstLen);
|
||||
getErr(err,*status);
|
||||
}
|
||||
virtual long getOperationsPerIteration(void){
|
||||
return srcLen;
|
||||
}
|
||||
};
|
||||
|
||||
class WinIMultiLanguageFromUnicodePerfFunction : public UPerfFunction{
|
||||
|
||||
private:
|
||||
LPMULTILANGUAGE2 pMulti;
|
||||
LPMLANGCONVERTCHARSET pConvFromUni;
|
||||
WCHAR* src;
|
||||
UINT srcLen;
|
||||
char dst[MAX_BUF_SIZE];
|
||||
UINT dstLen;
|
||||
const char* cpName;
|
||||
|
||||
public:
|
||||
WinIMultiLanguageFromUnicodePerfFunction(const char* name,WCHAR* source, UINT sourceLen, UErrorCode& status){
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
/* create instance of converter object*/
|
||||
CoCreateInstance(
|
||||
__uuidof(CMultiLanguage),
|
||||
NULL,
|
||||
CLSCTX_SERVER,
|
||||
__uuidof(IMultiLanguage2),
|
||||
(void**)&pMulti
|
||||
);
|
||||
|
||||
|
||||
|
||||
MIMECSETINFO mimeInfo;
|
||||
mimeInfo.uiCodePage = 0;
|
||||
mimeInfo.uiInternetEncoding =0;
|
||||
HRESULT err=S_OK;
|
||||
unsigned short bEnc[30]={'\0'};
|
||||
const char* tenc=name;
|
||||
for(int i=0;*tenc!='\0';i++){
|
||||
bEnc[i]=*tenc;
|
||||
tenc++;
|
||||
}
|
||||
/* get the charset info */
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
pMulti->CreateConvertCharset(1200 /*unicode*/, mimeInfo.uiCodePage, (DWORD)0,&pConvFromUni);
|
||||
getErr(err,status);
|
||||
src = source;
|
||||
srcLen = sourceLen;
|
||||
dstLen = LENGTHOF(dst);
|
||||
cpName = name;
|
||||
|
||||
}
|
||||
|
||||
virtual void call(UErrorCode* status){
|
||||
HRESULT err= pConvFromUni->DoConversionFromUnicode(src,&srcLen,dst, &dstLen);
|
||||
getErr(err,*status);
|
||||
}
|
||||
virtual long getOperationsPerIteration(void){
|
||||
return srcLen;
|
||||
}
|
||||
};
|
||||
|
||||
class WinIMultiLanguage2ToUnicodePerfFunction : public UPerfFunction{
|
||||
|
||||
private:
|
||||
LPMULTILANGUAGE2 pMulti;
|
||||
char* src;
|
||||
UINT srcLen;
|
||||
WCHAR dst[MAX_BUF_SIZE];
|
||||
UINT dstLen;
|
||||
const char* cpName;
|
||||
DWORD dwEnc;
|
||||
public:
|
||||
WinIMultiLanguage2ToUnicodePerfFunction(const char* name,char* source, UINT sourceLen, UErrorCode& status){
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
/* create instance of converter object*/
|
||||
CoCreateInstance(
|
||||
__uuidof(CMultiLanguage),
|
||||
NULL,
|
||||
CLSCTX_SERVER,
|
||||
__uuidof(IMultiLanguage2),
|
||||
(void**)&pMulti
|
||||
);
|
||||
|
||||
src = source;
|
||||
srcLen = sourceLen;
|
||||
dstLen = LENGTHOF(dst);
|
||||
cpName = name;
|
||||
unsigned short bEnc[30]={'\0'};
|
||||
const char* tenc=name;
|
||||
for(int i=0;*tenc!='\0';i++){
|
||||
bEnc[i]=*tenc;
|
||||
tenc++;
|
||||
}
|
||||
/* get the charset info */
|
||||
MIMECSETINFO mimeInfo;
|
||||
mimeInfo.uiCodePage = 0;
|
||||
mimeInfo.uiInternetEncoding =0;
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
dwEnc = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
|
||||
}
|
||||
|
||||
virtual void call(UErrorCode* status){
|
||||
DWORD dwMode=0;
|
||||
HRESULT err= pMulti->ConvertStringToUnicode(&dwMode,dwEnc,(char*)src,&srcLen,dst, &dstLen);
|
||||
getErr(err,*status);
|
||||
}
|
||||
virtual long getOperationsPerIteration(void){
|
||||
return srcLen;
|
||||
}
|
||||
};
|
||||
|
||||
class WinIMultiLanguage2FromUnicodePerfFunction : public UPerfFunction{
|
||||
|
||||
private:
|
||||
LPMULTILANGUAGE2 pMulti;
|
||||
LPMLANGCONVERTCHARSET pConvFromUni;
|
||||
WCHAR* src;
|
||||
UINT srcLen;
|
||||
char dst[MAX_BUF_SIZE];
|
||||
UINT dstLen;
|
||||
const char* cpName;
|
||||
DWORD dwEnc;
|
||||
|
||||
public:
|
||||
WinIMultiLanguage2FromUnicodePerfFunction(const char* name,WCHAR* source, UINT sourceLen, UErrorCode& status){
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
/* create instance of converter object*/
|
||||
CoCreateInstance(
|
||||
__uuidof(CMultiLanguage),
|
||||
NULL,
|
||||
CLSCTX_SERVER,
|
||||
__uuidof(IMultiLanguage2),
|
||||
(void**)&pMulti
|
||||
);
|
||||
|
||||
|
||||
unsigned short bEnc[30]={'\0'};
|
||||
const char* tenc=name;
|
||||
for(int i=0;*tenc!='\0';i++){
|
||||
bEnc[i]=*tenc;
|
||||
tenc++;
|
||||
}
|
||||
src = source;
|
||||
srcLen = sourceLen;
|
||||
dstLen = LENGTHOF(dst);
|
||||
cpName = name;
|
||||
/* get the charset info */
|
||||
MIMECSETINFO mimeInfo;
|
||||
mimeInfo.uiCodePage = 0;
|
||||
mimeInfo.uiInternetEncoding =0;
|
||||
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
dwEnc = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
|
||||
}
|
||||
|
||||
virtual void call(UErrorCode* status){
|
||||
DWORD dwMode=0;
|
||||
HRESULT err= pMulti->ConvertStringFromUnicode(&dwMode,dwEnc,src,&srcLen,dst, &dstLen);
|
||||
getErr(err,*status);
|
||||
}
|
||||
virtual long getOperationsPerIteration(void){
|
||||
return srcLen;
|
||||
}
|
||||
};
|
||||
|
||||
class ConverterPerformanceTest : public UPerfTest{
|
||||
|
||||
public:
|
||||
|
||||
ConverterPerformanceTest(int32_t argc, const char* argv[], UErrorCode& status);
|
||||
~ConverterPerformanceTest();
|
||||
virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec,const char* &name, char* par = NULL);
|
||||
|
||||
UPerfFunction* TestICU_UTF8_ToUnicode();
|
||||
UPerfFunction* TestICU_UTF8_FromUnicode();
|
||||
UPerfFunction* TestWinANSI_UTF8_ToUnicode();
|
||||
UPerfFunction* TestWinANSI_UTF8_FromUnicode();
|
||||
UPerfFunction* TestWinIML2_UTF8_ToUnicode();
|
||||
UPerfFunction* TestWinIML2_UTF8_FromUnicode();
|
||||
|
||||
|
||||
UPerfFunction* TestICU_Latin1_ToUnicode();
|
||||
UPerfFunction* TestICU_Latin1_FromUnicode();
|
||||
UPerfFunction* TestWinANSI_Latin1_ToUnicode();
|
||||
UPerfFunction* TestWinANSI_Latin1_FromUnicode();
|
||||
UPerfFunction* TestWinIML2_Latin1_ToUnicode();
|
||||
UPerfFunction* TestWinIML2_Latin1_FromUnicode();
|
||||
|
||||
UPerfFunction* TestICU_EBCDIC_Arabic_ToUnicode();
|
||||
UPerfFunction* TestICU_EBCDIC_Arabic_FromUnicode();
|
||||
UPerfFunction* TestWinANSI_EBCDIC_Arabic_ToUnicode();
|
||||
UPerfFunction* TestWinANSI_EBCDIC_Arabic_FromUnicode();
|
||||
UPerfFunction* TestWinIML2_EBCDIC_Arabic_ToUnicode();
|
||||
UPerfFunction* TestWinIML2_EBCDIC_Arabic_FromUnicode();
|
||||
|
||||
UPerfFunction* TestICU_Latin8_ToUnicode();
|
||||
UPerfFunction* TestICU_Latin8_FromUnicode();
|
||||
UPerfFunction* TestWinANSI_Latin8_ToUnicode();
|
||||
UPerfFunction* TestWinANSI_Latin8_FromUnicode();
|
||||
UPerfFunction* TestWinIML2_Latin8_ToUnicode();
|
||||
UPerfFunction* TestWinIML2_Latin8_FromUnicode();
|
||||
|
||||
|
||||
UPerfFunction* TestICU_SJIS_ToUnicode();
|
||||
UPerfFunction* TestICU_SJIS_FromUnicode();
|
||||
UPerfFunction* TestWinANSI_SJIS_ToUnicode();
|
||||
UPerfFunction* TestWinANSI_SJIS_FromUnicode();
|
||||
UPerfFunction* TestWinIML2_SJIS_ToUnicode();
|
||||
UPerfFunction* TestWinIML2_SJIS_FromUnicode();
|
||||
|
||||
UPerfFunction* TestICU_EUCJP_ToUnicode();
|
||||
UPerfFunction* TestICU_EUCJP_FromUnicode();
|
||||
UPerfFunction* TestWinANSI_EUCJP_ToUnicode();
|
||||
UPerfFunction* TestWinANSI_EUCJP_FromUnicode();
|
||||
UPerfFunction* TestWinIML2_EUCJP_ToUnicode();
|
||||
UPerfFunction* TestWinIML2_EUCJP_FromUnicode();
|
||||
|
||||
UPerfFunction* TestICU_GB2312_ToUnicode();
|
||||
UPerfFunction* TestICU_GB2312_FromUnicode();
|
||||
UPerfFunction* TestWinANSI_GB2312_ToUnicode();
|
||||
UPerfFunction* TestWinANSI_GB2312_FromUnicode();
|
||||
UPerfFunction* TestWinIML2_GB2312_ToUnicode();
|
||||
UPerfFunction* TestWinIML2_GB2312_FromUnicode();
|
||||
|
||||
|
||||
UPerfFunction* TestICU_ISO2022KR_ToUnicode();
|
||||
UPerfFunction* TestICU_ISO2022KR_FromUnicode();
|
||||
UPerfFunction* TestWinANSI_ISO2022KR_ToUnicode();
|
||||
UPerfFunction* TestWinANSI_ISO2022KR_FromUnicode();
|
||||
UPerfFunction* TestWinIML2_ISO2022KR_ToUnicode();
|
||||
UPerfFunction* TestWinIML2_ISO2022KR_FromUnicode();
|
||||
|
||||
UPerfFunction* TestICU_ISO2022JP_ToUnicode();
|
||||
UPerfFunction* TestICU_ISO2022JP_FromUnicode();
|
||||
UPerfFunction* TestWinANSI_ISO2022JP_ToUnicode();
|
||||
UPerfFunction* TestWinANSI_ISO2022JP_FromUnicode();
|
||||
UPerfFunction* TestWinIML2_ISO2022JP_ToUnicode();
|
||||
UPerfFunction* TestWinIML2_ISO2022JP_FromUnicode();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
33
icu4c/source/test/perf/convperf/convperf.plg
Normal file
33
icu4c/source/test/perf/convperf/convperf.plg
Normal file
|
@ -0,0 +1,33 @@
|
|||
<html>
|
||||
<body>
|
||||
<pre>
|
||||
<h1>Build Log</h1>
|
||||
<h3>
|
||||
--------------------Configuration: convperf - Win32 Release--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "C:\DOCUME~1\ram.ICU\LOCALS~1\Temp\RSP3230.tmp" with contents
|
||||
[
|
||||
/nologo /MD /W3 /GX /O2 /I "..\..\..\..\include" /I "..\..\..\common" /I "..\..\..\i18n" /I "..\..\..\tools\toolutil" /I "C:\Program Files\Microsoft SDK\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Release/convperf.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
|
||||
"C:\work\DevICU\icu\source\test\perf\convperf\convperf.cpp"
|
||||
]
|
||||
Creating command line "cl.exe @C:\DOCUME~1\ram.ICU\LOCALS~1\Temp\RSP3230.tmp"
|
||||
Creating temporary file "C:\DOCUME~1\ram.ICU\LOCALS~1\Temp\RSP3231.tmp" with contents
|
||||
[
|
||||
icuuc.lib icuin.lib icutu.lib kernel32.lib user32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /incremental:no /pdb:"Release/convperf.pdb" /machine:I386 /out:"Release/convperf.exe" /libpath:"..\..\..\..\lib\\"
|
||||
.\Release\convperf.obj
|
||||
]
|
||||
Creating command line "link.exe @C:\DOCUME~1\ram.ICU\LOCALS~1\Temp\RSP3231.tmp"
|
||||
<h3>Output Window</h3>
|
||||
Compiling...
|
||||
convperf.cpp
|
||||
Linking...
|
||||
Creating library Release/convperf.lib and object Release/convperf.exp
|
||||
|
||||
|
||||
|
||||
<h3>Results</h3>
|
||||
convperf.exe - 0 error(s), 0 warning(s)
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
49
icu4c/source/test/perf/convperf/convperf_ansi.pl
Executable file
49
icu4c/source/test/perf/convperf/convperf_ansi.pl
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/perl -w
|
||||
# ********************************************************************
|
||||
# * COPYRIGHT:
|
||||
# * Copyright (c) 2002, International Business Machines Corporation and
|
||||
# * others. All Rights Reserved.
|
||||
# ********************************************************************
|
||||
|
||||
use strict;
|
||||
|
||||
use lib '../perldriver';
|
||||
|
||||
use PerfFramework;
|
||||
|
||||
|
||||
my $options = {
|
||||
"title"=>"Conversion Performance: ICU 2.6 vs. Windows2000 ANSI Interface",
|
||||
"headers"=>"Windows2000(IMultiLanguage2) ICU",
|
||||
"operationIs"=>"code point",
|
||||
"passes"=>"10",
|
||||
"time"=>"5",
|
||||
#"outputType"=>"HTML",
|
||||
"dataDir"=>"c:/src/perf/data",
|
||||
"outputDir"=>"../results"
|
||||
};
|
||||
|
||||
# programs
|
||||
# tests will be done for all the programs. Results will be stored and connected
|
||||
my $p = "release/convperf.exe";
|
||||
|
||||
my $tests = {
|
||||
"UTF-8 From Unicode", ["$p TestWinANSI_UTF8_FromUnicode" , "$p TestICU_UTF8_FromUnicode" ],
|
||||
"UTF-8 To Unicode", ["$p TestWinANSI_UTF8_ToUnicode" , "$p TestICU_UTF8_ToUnicode" ],
|
||||
####
|
||||
"ISO-8859-1 From Unicode", ["$p TestWinANSI_Latin1_FromUnicode" , "$p TestICU_Latin1_FromUnicode" ],
|
||||
"ISO-8859-1 To Unicode", ["$p TestWinANSI_Latin1_ToUnicode" , "$p TestICU_Latin1_ToUnicode" ],
|
||||
####
|
||||
"Shift-JIS From Unicode", ["$p TestWinANSI_SJIS_FromUnicode" , "$p TestICU_SJIS_FromUnicode" ],
|
||||
"Shift-JIS To Unicode", ["$p TestWinANSI_SJIS_ToUnicode" , "$p TestICU_SJIS_ToUnicode" ],
|
||||
####
|
||||
"EUC-JP From Unicode", ["$p TestWinANSI_EUCJP_FromUnicode" , "$p TestICU_EUCJP_FromUnicode" ],
|
||||
"EUC-JP To Unicode", ["$p TestWinANSI_EUCJP_ToUnicode" , "$p TestICU_EUCJP_ToUnicode" ],
|
||||
####
|
||||
"GB2312 From Unicode", ["$p TestWinANSI_GB2312_FromUnicode" , "$p TestICU_GB2312_FromUnicode" ],
|
||||
"GB2312 To Unicode", ["$p TestWinANSI_GB2312_ToUnicode" , "$p TestICU_GB2312_ToUnicode" ],
|
||||
};
|
||||
|
||||
my $dataFiles = "";
|
||||
|
||||
runTests($options, $tests, $dataFiles);
|
55
icu4c/source/test/perf/convperf/convperf_iml.pl
Executable file
55
icu4c/source/test/perf/convperf/convperf_iml.pl
Executable file
|
@ -0,0 +1,55 @@
|
|||
#!/usr/bin/perl -w
|
||||
# ********************************************************************
|
||||
# * COPYRIGHT:
|
||||
# * Copyright (c) 2002, International Business Machines Corporation and
|
||||
# * others. All Rights Reserved.
|
||||
# ********************************************************************
|
||||
|
||||
use strict;
|
||||
|
||||
use lib '../perldriver';
|
||||
|
||||
use PerfFramework;
|
||||
|
||||
|
||||
my $options = {
|
||||
"title"=>"Conversion Performance: ICU 2.6 vs. Windows2000 IMultiLanguage Interface",
|
||||
"headers"=>"Windows2000(IMultiLanguage2) ICU",
|
||||
"operationIs"=>"code point",
|
||||
"passes"=>"10",
|
||||
"time"=>"5",
|
||||
#"outputType"=>"HTML",
|
||||
"dataDir"=>"c:/src/perf/data",
|
||||
"outputDir"=>"../results"
|
||||
};
|
||||
|
||||
# programs
|
||||
# tests will be done for all the programs. Results will be stored and connected
|
||||
my $p = "release/convperf.exe";
|
||||
|
||||
my $tests = {
|
||||
"UTF-8 From Unicode", ["$p TestWinIML2_UTF8_FromUnicode" , "$p TestICU_UTF8_FromUnicode" ],
|
||||
"UTF-8 To Unicode", ["$p TestWinIML2_UTF8_ToUnicode" , "$p TestICU_UTF8_ToUnicode" ],
|
||||
####
|
||||
"ISO-8859-1 From Unicode", ["$p TestWinIML2_Latin1_FromUnicode" , "$p TestICU_Latin1_FromUnicode" ],
|
||||
"ISO-8859-1 To Unicode", ["$p TestWinIML2_Latin1_ToUnicode" , "$p TestICU_Latin1_ToUnicode" ],
|
||||
####
|
||||
"Shift-JIS From Unicode", ["$p TestWinIML2_SJIS_FromUnicode" , "$p TestICU_SJIS_FromUnicode" ],
|
||||
"Shift-JIS To Unicode", ["$p TestWinIML2_SJIS_ToUnicode" , "$p TestICU_SJIS_ToUnicode" ],
|
||||
####
|
||||
"EUC-JP From Unicode", ["$p TestWinIML2_EUCJP_FromUnicode" , "$p TestICU_EUCJP_FromUnicode" ],
|
||||
"EUC-JP To Unicode", ["$p TestWinIML2_EUCJP_ToUnicode" , "$p TestICU_EUCJP_ToUnicode" ],
|
||||
####
|
||||
"GB2312 From Unicode", ["$p TestWinIML2_GB2312_FromUnicode" , "$p TestICU_GB2312_FromUnicode" ],
|
||||
"GB2312 To Unicode", ["$p TestWinIML2_GB2312_ToUnicode" , "$p TestICU_GB2312_ToUnicode" ],
|
||||
####
|
||||
"ISO2022KR From Unicode", ["$p TestWinIML2_ISO2022KR_FromUnicode", "$p TestICU_ISO2022KR_FromUnicode" ],
|
||||
"ISO2022KR To Unicode", ["$p TestWinIML2_ISO2022KR_ToUnicode" , "$p TestICU_ISO2022KR_ToUnicode" ],
|
||||
####
|
||||
"ISO2022JP From Unicode", ["$p TestWinIML2_ISO2022JP_FromUnicode", "$p TestICU_ISO2022JP_FromUnicode" ],
|
||||
"ISO2022JP To Unicode", ["$p TestWinIML2_ISO2022JP_ToUnicode" , "$p TestICU_ISO2022JP_ToUnicode" ],
|
||||
};
|
||||
|
||||
my $dataFiles = "";
|
||||
|
||||
runTests($options, $tests, $dataFiles);
|
2734
icu4c/source/test/perf/convperf/data.h
Normal file
2734
icu4c/source/test/perf/convperf/data.h
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue