1ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/* 2ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru********************************************************************** 3ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Copyright (c) 2002-2005, International Business Machines 4ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Corporation and others. All Rights Reserved. 5ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru********************************************************************** 6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru********************************************************************** 7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*/ 8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/** 9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * This Program tests the performance of ICU's Normalization engine against Windows 10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * to run it use the command like 11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * 12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * c:\normperf.exe -s C:\work\ICUCupertinoRep\icu4c\collation-perf-data -i 10 -p 15 -f TestNames_Asian.txt -u -e UTF-8 -l 13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */ 14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "normperf.h" 15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "uoptions.h" 16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include <stdio.h> 17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define LENGTHOF(array) (sizeof(array)/sizeof((array)[0])) 19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::runIndexedTest(int32_t index, UBool exec,const char* &name, char* par) { 21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru switch (index) { 22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(0,TestICU_NFC_NFD_Text); 23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(1,TestICU_NFC_NFC_Text); 24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(2,TestICU_NFC_Orig_Text); 25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(3,TestICU_NFD_NFD_Text); 27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(4,TestICU_NFD_NFC_Text); 28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(5,TestICU_NFD_Orig_Text); 29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(6,TestICU_FCD_NFD_Text); 31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(7,TestICU_FCD_NFC_Text); 32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(8,TestICU_FCD_Orig_Text); 33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 34ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(9,TestWin_NFC_NFD_Text); 35ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(10,TestWin_NFC_NFC_Text); 36ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(11,TestWin_NFC_Orig_Text); 37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(12,TestWin_NFD_NFD_Text); 39ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(13,TestWin_NFD_NFC_Text); 40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(14,TestWin_NFD_Orig_Text); 41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(15,TestQC_NFC_NFD_Text); 43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(16,TestQC_NFC_NFC_Text); 44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(17,TestQC_NFC_Orig_Text); 45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 46ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(18,TestQC_NFD_NFD_Text); 47ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(19,TestQC_NFD_NFC_Text); 48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(20,TestQC_NFD_Orig_Text); 49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(21,TestQC_FCD_NFD_Text); 51ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(22,TestQC_FCD_NFC_Text); 52ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(23,TestQC_FCD_Orig_Text); 53ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 54ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(24,TestIsNormalized_NFC_NFD_Text); 55ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(25,TestIsNormalized_NFC_NFC_Text); 56ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(26,TestIsNormalized_NFC_Orig_Text); 57ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 58ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(27,TestIsNormalized_NFD_NFD_Text); 59ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(28,TestIsNormalized_NFD_NFC_Text); 60ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(29,TestIsNormalized_NFD_Orig_Text); 61ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 62ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(30,TestIsNormalized_FCD_NFD_Text); 63ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(31,TestIsNormalized_FCD_NFC_Text); 64ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru TESTCASE(32,TestIsNormalized_FCD_Orig_Text); 65ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 66ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru default: 67ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru name = ""; 68ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return NULL; 69ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 70ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return NULL; 71ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 72ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 73ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 74ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid NormalizerPerformanceTest::normalizeInput(ULine* dest,const UChar* src ,int32_t srcLen,UNormalizationMode mode, int32_t options){ 75ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru int32_t reqLen = 0; 76ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru UErrorCode status = U_ZERO_ERROR; 77ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru for(;;){ 78ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru /* pure pre-flight */ 79ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru reqLen=unorm_normalize(src,srcLen,mode, options,NULL,0,&status); 80ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(status==U_BUFFER_OVERFLOW_ERROR){ 81ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru status=U_ZERO_ERROR; 82ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru dest->name = new UChar[reqLen+1]; 83ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru reqLen= unorm_normalize(src,srcLen,mode, options,dest->name,reqLen+1,&status); 84ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru dest->len=reqLen; 85ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru break; 86ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else if(U_FAILURE(status)){ 87ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru printf("Could not normalize input. Error: %s", u_errorName(status)); 88ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 89ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 90ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 91ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUChar* NormalizerPerformanceTest::normalizeInput(int32_t& len, const UChar* src ,int32_t srcLen,UNormalizationMode mode, int32_t options){ 92ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru int32_t reqLen = 0; 93ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru UErrorCode status = U_ZERO_ERROR; 94ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru UChar* dest = NULL; 95ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru for(;;){ 96ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru /* pure pre-flight */ 97ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru reqLen=unorm_normalize(src,srcLen,mode, options,NULL,0,&status); 98ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(status==U_BUFFER_OVERFLOW_ERROR){ 99ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru status=U_ZERO_ERROR; 100ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru dest = new UChar[reqLen+1]; 101ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru reqLen= unorm_normalize(src,srcLen,mode, options,dest,reqLen+1,&status); 102ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru len=reqLen; 103ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru break; 104ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else if(U_FAILURE(status)){ 105ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru printf("Could not normalize input. Error: %s", u_errorName(status)); 106ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return NULL; 107ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 108ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 109ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return dest; 110ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 111ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 112ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querustatic UOption cmdLineOptions[]={ 113ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru UOPTION_DEF("options", 'o', UOPT_OPTIONAL_ARG) 114ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}; 115ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 116ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruNormalizerPerformanceTest::NormalizerPerformanceTest(int32_t argc, const char* argv[], UErrorCode& status) 117ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru: UPerfTest(argc,argv,status), options(0) { 118ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFDBuffer = NULL; 119ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFCBuffer = NULL; 120ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFDBufferLen = 0; 121ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFCBufferLen = 0; 122ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFDFileLines = NULL; 123ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFCFileLines = NULL; 124ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 125ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(status== U_ILLEGAL_ARGUMENT_ERROR){ 126ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru fprintf(stderr,gUsageString, "normperf"); 127ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return; 128ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 129ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 130ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(U_FAILURE(status)){ 131ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru fprintf(stderr, "FAILED to create UPerfTest object. Error: %s\n", u_errorName(status)); 132ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return; 133ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 134ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 135ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru _remainingArgc = u_parseArgs(_remainingArgc, (char **)argv, (int32_t)(LENGTHOF(cmdLineOptions)), cmdLineOptions); 136ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(cmdLineOptions[0].doesOccur && cmdLineOptions[0].value!=NULL) { 137ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru options=(int32_t)strtol(cmdLineOptions[0].value, NULL, 16); 138ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 139ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 140ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 141ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru ULine* filelines = getLines(status); 142ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(U_FAILURE(status)){ 143ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru fprintf(stderr, "FAILED to read lines from file and create UPerfTest object. Error: %s\n", u_errorName(status)); 144ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return; 145ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 146ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFDFileLines = new ULine[numLines]; 147ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFCFileLines = new ULine[numLines]; 148ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 149ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru for(int32_t i=0;i<numLines;i++){ 150ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru normalizeInput(&NFDFileLines[i],filelines[i].name,filelines[i].len,UNORM_NFD, options); 151ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru normalizeInput(&NFCFileLines[i],filelines[i].name,filelines[i].len,UNORM_NFC, options); 152ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 153ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 154ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else if(bulk_mode){ 155ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru int32_t srcLen = 0; 156ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru const UChar* src = getBuffer(srcLen,status); 157ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFDBufferLen = 0; 158ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFCBufferLen = 0; 159ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 160ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(U_FAILURE(status)){ 161ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru fprintf(stderr, "FAILED to read buffer from file and create UPerfTest object. Error: %s\n", u_errorName(status)); 162ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return; 163ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 164ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 165ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFDBuffer = normalizeInput(NFDBufferLen,src,srcLen,UNORM_NFD, options); 166ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NFCBuffer = normalizeInput(NFCBufferLen,src,srcLen,UNORM_NFC, options); 167ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 168ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 169ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 170ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 171ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruNormalizerPerformanceTest::~NormalizerPerformanceTest(){ 172ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru delete[] NFDFileLines; 173ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru delete[] NFCFileLines; 174ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru delete[] NFDBuffer; 175ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru delete[] NFCBuffer; 176ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 177ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 178ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Test NFC Performance 179ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestICU_NFC_NFD_Text(){ 180ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 181ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func= new NormPerfFunction(ICUNormNFC, options,NFDFileLines,numLines, uselen); 182ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 183ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 184ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func= new NormPerfFunction(ICUNormNFC, options,NFDBuffer, NFDBufferLen, uselen); 185ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 186ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 187ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 188ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestICU_NFC_NFC_Text(){ 189ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 190ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormNFC, options,NFCFileLines,numLines, uselen); 191ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 192ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 193ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func= new NormPerfFunction(ICUNormNFC, options,NFCBuffer, NFCBufferLen, uselen); 194ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 195ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 196ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 197ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestICU_NFC_Orig_Text(){ 198ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 199ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormNFC, options,lines,numLines, uselen); 200ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 201ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 202ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormNFC, options,buffer, bufferLen, uselen); 203ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 204ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 205ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 206ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 207ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Test NFD Performance 208ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestICU_NFD_NFD_Text(){ 209ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 210ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormNFD, options,NFDFileLines,numLines, uselen); 211ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 212ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 213ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormNFD, options,NFDBuffer,NFDBufferLen, uselen); 214ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 215ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 216ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 217ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestICU_NFD_NFC_Text(){ 218ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 219ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormNFD, options,NFCFileLines,numLines, uselen); 220ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 221ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 222ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormNFD, options,NFCBuffer,NFCBufferLen, uselen); 223ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 224ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 225ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 226ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestICU_NFD_Orig_Text(){ 227ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 228ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormNFD, options,lines,numLines, uselen); 229ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 230ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 231ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormNFD, options,buffer,bufferLen, uselen); 232ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 233ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 234ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 235ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 236ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Test FCD Performance 237ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestICU_FCD_NFD_Text(){ 238ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 239ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormFCD, options,NFDFileLines,numLines, uselen); 240ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 241ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 242ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormFCD, options,NFDBuffer,NFDBufferLen, uselen); 243ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 244ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 245ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 246ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 247ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestICU_FCD_NFC_Text(){ 248ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 249ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormFCD, options,NFCFileLines,numLines, uselen); 250ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 251ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 252ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormFCD, options,NFCBuffer,NFCBufferLen, uselen); 253ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 254ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 255ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 256ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestICU_FCD_Orig_Text(){ 257ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 258ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormFCD, options,lines,numLines, uselen); 259ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 260ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 261ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(ICUNormFCD, options,buffer,bufferLen, uselen); 262ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 263ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 264ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 265ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 266ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Test Win NFC Performance 267ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestWin_NFC_NFD_Text(){ 268ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 269ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFC, options,NFDFileLines,numLines, uselen); 270ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 271ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 272ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFC, options,NFDBuffer,NFDBufferLen, uselen); 273ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 274ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 275ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 276ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestWin_NFC_NFC_Text(){ 277ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 278ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFC, options,NFCFileLines,numLines, uselen); 279ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 280ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 281ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFC, options,NFCBuffer,NFCBufferLen, uselen); 282ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 283ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 284ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 285ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestWin_NFC_Orig_Text(){ 286ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 287ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFC, options,lines,numLines, uselen); 288ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 289ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 290ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFC, options,buffer,bufferLen, uselen); 291ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 292ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 293ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 294ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 295ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Test Win NFD Performance 296ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestWin_NFD_NFD_Text(){ 297ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 298ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFD, options,NFDFileLines,numLines, uselen); 299ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 300ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 301ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFD, options,NFDBuffer,NFDBufferLen, uselen); 302ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 303ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 304ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 305ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestWin_NFD_NFC_Text(){ 306ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 307ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFD, options,NFCFileLines,numLines, uselen); 308ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 309ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 310ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFD, options,NFCBuffer,NFCBufferLen, uselen); 311ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 312ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 313ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 314ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestWin_NFD_Orig_Text(){ 315ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 316ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFD, options,lines,numLines, uselen); 317ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 318ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 319ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormPerfFunction* func = new NormPerfFunction(WinNormNFD, options,buffer,bufferLen, uselen); 320ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 321ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 322ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 323ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 324ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Test Quick Check Performance 325ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestQC_NFC_NFD_Text(){ 326ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 327ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFDFileLines, numLines, UNORM_NFC, options,uselen); 328ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 329ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 330ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFDBuffer, NFDBufferLen, UNORM_NFC, options,uselen); 331ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 332ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 333ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 334ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestQC_NFC_NFC_Text(){ 335ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 336ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFCFileLines, numLines, UNORM_NFC, options,uselen); 337ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 338ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 339ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFCBuffer, NFCBufferLen, UNORM_NFC, options,uselen); 340ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 341ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 342ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 343ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestQC_NFC_Orig_Text(){ 344ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 345ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,lines, numLines, UNORM_NFC, options,uselen); 346ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 347ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 348ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,buffer, bufferLen, UNORM_NFC, options,uselen); 349ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 350ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 351ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 352ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 353ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestQC_NFD_NFD_Text(){ 354ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 355ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFDFileLines, numLines, UNORM_NFD, options,uselen); 356ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 357ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 358ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFDBuffer, NFDBufferLen, UNORM_NFD, options,uselen); 359ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 360ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 361ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 362ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestQC_NFD_NFC_Text(){ 363ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 364ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFCFileLines, numLines, UNORM_NFD, options,uselen); 365ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 366ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 367ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFCBuffer, NFCBufferLen, UNORM_NFD, options,uselen); 368ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 369ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 370ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 371ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestQC_NFD_Orig_Text(){ 372ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 373ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,lines, numLines, UNORM_NFD, options,uselen); 374ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 375ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 376ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,buffer, bufferLen, UNORM_NFD, options,uselen); 377ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 378ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 379ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 380ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 381ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestQC_FCD_NFD_Text(){ 382ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 383ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFDFileLines, numLines, UNORM_FCD, options,uselen); 384ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 385ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 386ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFDBuffer, NFDBufferLen, UNORM_FCD, options,uselen); 387ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 388ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 389ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 390ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestQC_FCD_NFC_Text(){ 391ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 392ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFCFileLines, numLines, UNORM_FCD, options,uselen); 393ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 394ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 395ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,NFCBuffer, NFCBufferLen, UNORM_FCD, options,uselen); 396ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 397ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 398ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 399ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestQC_FCD_Orig_Text(){ 400ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 401ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,lines, numLines, UNORM_FCD, options,uselen); 402ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 403ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 404ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUQuickCheck,buffer, bufferLen, UNORM_FCD, options,uselen); 405ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 406ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 407ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 408ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 409ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Test isNormalized Performance 410ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestIsNormalized_NFC_NFD_Text(){ 411ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 412ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFDFileLines, numLines, UNORM_NFC, options,uselen); 413ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 414ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 415ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFDBuffer, NFDBufferLen, UNORM_NFC, options,uselen); 416ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 417ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 418ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 419ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestIsNormalized_NFC_NFC_Text(){ 420ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 421ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFCFileLines, numLines, UNORM_NFC, options,uselen); 422ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 423ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 424ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFCBuffer, NFCBufferLen, UNORM_NFC, options,uselen); 425ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 426ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 427ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 428ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestIsNormalized_NFC_Orig_Text(){ 429ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 430ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,lines, numLines, UNORM_NFC, options,uselen); 431ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 432ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 433ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,buffer, bufferLen, UNORM_NFC, options,uselen); 434ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 435ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 436ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 437ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 438ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestIsNormalized_NFD_NFD_Text(){ 439ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 440ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFDFileLines, numLines, UNORM_NFD, options,uselen); 441ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 442ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 443ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFDBuffer, NFDBufferLen, UNORM_NFD, options,uselen); 444ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 445ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 446ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 447ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestIsNormalized_NFD_NFC_Text(){ 448ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 449ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFCFileLines, numLines, UNORM_NFD, options,uselen); 450ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 451ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 452ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFCBuffer, NFCBufferLen, UNORM_NFD, options,uselen); 453ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 454ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 455ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 456ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestIsNormalized_NFD_Orig_Text(){ 457ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 458ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,lines, numLines, UNORM_NFD, options,uselen); 459ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 460ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 461ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,buffer, bufferLen, UNORM_NFD, options,uselen); 462ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 463ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 464ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 465ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 466ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestIsNormalized_FCD_NFD_Text(){ 467ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 468ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFDFileLines, numLines, UNORM_FCD, options,uselen); 469ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 470ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 471ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFDBuffer, NFDBufferLen, UNORM_FCD, options,uselen); 472ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 473ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 474ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 475ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestIsNormalized_FCD_NFC_Text(){ 476ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 477ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFCFileLines, numLines, UNORM_FCD, options,uselen); 478ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 479ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 480ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,NFCBuffer, NFCBufferLen, UNORM_FCD, options,uselen); 481ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 482ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 483ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 484ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruUPerfFunction* NormalizerPerformanceTest::TestIsNormalized_FCD_Orig_Text(){ 485ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(line_mode){ 486ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,lines, numLines, UNORM_FCD, options,uselen); 487ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 488ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru }else{ 489ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru QuickCheckPerfFunction* func = new QuickCheckPerfFunction(ICUIsNormalized,buffer, bufferLen, UNORM_FCD, options,uselen); 490ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return func; 491ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 492ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 493ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 494ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruint main(int argc, const char* argv[]){ 495ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru UErrorCode status = U_ZERO_ERROR; 496ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru NormalizerPerformanceTest test(argc, argv, status); 497ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(U_FAILURE(status)){ 498ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return status; 499ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 500ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru if(test.run()==FALSE){ 501ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru fprintf(stderr,"FAILED: Tests could not be run please check the arguments.\n"); 502ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return -1; 503ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru } 504ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru return 0; 505ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} 506