sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: sl@0: static RTest TheTest(_L("T_FoldPerf")); sl@0: sl@0: #define ARRAY_SIZE(ar) (sizeof(ar) / (sizeof(ar[0]))) sl@0: sl@0: const TText16 KText16[] = {'1', 'f', 'A', 0x01D5, 'k', '5', 'g', 'U', 'W', 'q', 'a', sl@0: 0x095E, 0x01D5, 'a', 'B', 'c', 'd', 'E', 'F', 0}; sl@0: //0x095E - DEVANAGARI LETTER FA sl@0: //decomposed to: 0x092B 0x093C sl@0: //0x01D5 - LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON sl@0: //decomposed to: 0x0075 0x0308 0x0304 sl@0: sl@0: _LIT16(KPlainText, "abcdefghijklmnopqrst"); sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-UNICODE-CT-0108 sl@0: @SYMTestCaseDesc FindF - performance test sl@0: @SYMTestPriority High sl@0: @SYMTestActions FindF - performance test sl@0: @SYMTestExpectedResults The test must not fail. sl@0: @SYMPREQ814 Optimise folded string comparisons. sl@0: */ sl@0: static void FindF_PerformanceTest() sl@0: { sl@0: TheTest.Next(_L("FindF test")); sl@0: sl@0: TBufC16 text(KText16); sl@0: sl@0: TBufC16<3> searchStr1(_L16("gUw")); sl@0: sl@0: const TText16 searchText2[] = {0x01D5, 'A', 'b', 0}; sl@0: TBufC16 searchStr2(searchText2); sl@0: sl@0: const TText16 searchText3[] = {0x0075, 0x0308, 0x0304, 'A', 'b', 0}; sl@0: TBufC16 searchStr3(searchText3); sl@0: sl@0: const TText16 searchText4[] = {0x095E, 'd', 'A', 'b', 0}; sl@0: TBufC16 searchStr4(searchText4); sl@0: sl@0: const TText16 searchText5[] = {0x095E, 0x0055, 0x0308, 0x0304, 'A', 'b', 'C', 0}; sl@0: TBufC16 searchStr5(searchText5); sl@0: sl@0: TBufC16<4> searchStr6(_L16("CDEF")); sl@0: sl@0: TUint timeStart = User::TickCount(); sl@0: for(TInt i=0;i<10000;++i) sl@0: { sl@0: TInt res = text.FindF(searchStr1); sl@0: TheTest(res == 6);//searchStr1 starts at position 6 sl@0: sl@0: res = text.FindF(searchStr2); sl@0: TheTest(res == 12); sl@0: sl@0: res = text.FindF(searchStr3); sl@0: TheTest(res == 12); sl@0: sl@0: res = text.FindF(searchStr4); sl@0: TheTest(res == KErrNotFound); sl@0: sl@0: res = text.FindF(searchStr5); sl@0: TheTest(res == 11); sl@0: sl@0: res = text.FindF(searchStr6); sl@0: TheTest(res == 15); sl@0: } sl@0: TUint timeEnd = User::TickCount(); sl@0: TheTest.Printf(_L("Time = %d ticks\n"), timeEnd - timeStart); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-UNICODE-CT-0109 sl@0: @SYMTestCaseDesc MatchF - performance test sl@0: @SYMTestPriority High sl@0: @SYMTestActions MatchF - performance test sl@0: @SYMTestExpectedResults The test must not fail. sl@0: @SYMPREQ814 Optimise folded string comparisons. sl@0: */ sl@0: static void MatchF_PerformanceTest() sl@0: { sl@0: TheTest.Next(_L("MatchF test")); sl@0: sl@0: TBufC16 text(KText16); sl@0: sl@0: TBufC16<11> searchStr1(_L16("*fa??5*W*a*")); sl@0: sl@0: const TText16 searchText2[] = {'*', 0x01D5, 'A', '?', 'C', '*', 0}; sl@0: TBufC16 searchStr2(searchText2); sl@0: sl@0: const TText16 searchText3[] = {'*', 0x0075, 0x0308, 0x0304, '*', 'e', 'F', 0}; sl@0: TBufC16 searchStr3(searchText3); sl@0: sl@0: const TText16 searchText4[] = {'1', '*', 'A', 'b', '*', 0}; sl@0: TBufC16 searchStr4(searchText4); sl@0: sl@0: TBufC16<11> searchStr5(_L16("*fa?z5*W*a*")); sl@0: sl@0: TBufC16<5> searchStr6(_L16("a?v?T")); sl@0: sl@0: TUint timeStart = User::TickCount(); sl@0: for(TInt i=0;i<10000;++i) sl@0: { sl@0: TInt res = text.MatchF(searchStr1); sl@0: TheTest(res == 1); sl@0: sl@0: res = text.MatchF(searchStr2); sl@0: TheTest(res == 12); sl@0: sl@0: res = text.MatchF(searchStr3); sl@0: TheTest(res == 3); sl@0: sl@0: res = text.MatchF(searchStr4); sl@0: TheTest(res == 0); sl@0: sl@0: res = text.MatchF(searchStr5); sl@0: TheTest(res == KErrNotFound); sl@0: sl@0: res = text.MatchF(searchStr6); sl@0: TheTest(res == KErrNotFound); sl@0: } sl@0: TUint timeEnd = User::TickCount(); sl@0: TheTest.Printf(_L("Time = %d ticks\n"), timeEnd - timeStart); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-UNICODE-CT-0110 sl@0: @SYMTestCaseDesc CompareF - performance test sl@0: @SYMTestPriority High sl@0: @SYMTestActions CompareF - performance test sl@0: @SYMTestExpectedResults The test must not fail. sl@0: @SYMPREQ814 Optimise folded string comparisons. sl@0: */ sl@0: static void CompareF_PerformanceTest() sl@0: { sl@0: TheTest.Next(_L("CompareF test")); sl@0: sl@0: TBufC16 text(KText16); sl@0: sl@0: const TText16 text1[] = {'1', 'F', 'A', 0x01D5, 'k', '5', 'G', 'U', 'W', 'Q', 'A', sl@0: 0x095E, 0x01D5, 'a', 'B', 'C', 'd', 'E', 'F', 0}; sl@0: TBufC16 str1(text1); sl@0: sl@0: TBufC16<19> str2(_L16("1234567890123456789")); sl@0: sl@0: TBufC16<19> str3(_L16("1fA4G6789r1d34z6789")); sl@0: sl@0: TUint timeStart = User::TickCount(); sl@0: TInt i; sl@0: for(i=0;i<10000;++i) sl@0: { sl@0: TInt res = text.CompareF(str1); sl@0: TheTest(res == 0); sl@0: sl@0: res = text.CompareF(str2); sl@0: TheTest(res != 0); sl@0: sl@0: res = text.CompareF(str3); sl@0: TheTest(res != 0); sl@0: } sl@0: TUint timeEnd = User::TickCount(); sl@0: TheTest.Printf(_L("1. Time = %d ticks\n"), timeEnd - timeStart); sl@0: sl@0: TBufC16<20> str4(_L16("abc3456hijklmnopqrst")); sl@0: timeStart = User::TickCount(); sl@0: for(i=0;i<10000;++i) sl@0: { sl@0: TInt res = str4.CompareF(KPlainText); sl@0: TheTest(res != 0); sl@0: } sl@0: timeEnd = User::TickCount(); sl@0: TheTest.Printf(_L("2. Time = %d ticks\n"), timeEnd - timeStart); sl@0: sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID SYSLIB-UNICODE-CT-0114 sl@0: @SYMTestCaseDesc FindF(), CompareF(), MatchF() on plain (no combining characters) text sl@0: @SYMTestPriority High sl@0: @SYMTestActions Performance test sl@0: @SYMTestExpectedResults The test must not fail. sl@0: @SYMPREQ814 Optimise folded string comparisons. sl@0: */ sl@0: static void PlainTextPerformanceTest() sl@0: { sl@0: TheTest.Next(_L("Plain text - performance test")); sl@0: sl@0: TInt res; sl@0: TInt i; sl@0: sl@0: TBufC16<20> str1(_L16("abcdefghijklmnopqrst")); sl@0: TBufC16<20> str2(_L16("abcDefghIjklmNOpqrsT")); sl@0: TBufC16<20> str3(_L16("abcDefghIjKlmNOp2rsT")); sl@0: sl@0: TUint timeStart = User::TickCount(); sl@0: for(i=0;i<10000;++i) sl@0: { sl@0: res = KPlainText().CompareF(str1); sl@0: TheTest(res == 0); sl@0: res = KPlainText().CompareF(str2); sl@0: TheTest(res == 0); sl@0: res = KPlainText().CompareF(str3); sl@0: TheTest(res != 0); sl@0: } sl@0: TUint timeEnd = User::TickCount(); sl@0: TheTest.Printf(_L("CompareF() Time = %d ticks\n"), timeEnd - timeStart); sl@0: sl@0: TBufC16<20> str4(_L16("gHiJk")); sl@0: TBufC16<20> str5(_L16("Opqr")); sl@0: TBufC16<20> str6(_L16("2rsT")); sl@0: sl@0: timeStart = User::TickCount(); sl@0: for(i=0;i<10000;++i) sl@0: { sl@0: res = KPlainText().FindF(str4); sl@0: TheTest(res == 6); sl@0: res = KPlainText().FindF(str5); sl@0: TheTest(res == 14); sl@0: res = KPlainText().FindF(str6); sl@0: TheTest(res == KErrNotFound); sl@0: } sl@0: timeEnd = User::TickCount(); sl@0: TheTest.Printf(_L("FindF() Time = %d ticks\n"), timeEnd - timeStart); sl@0: sl@0: TBufC16<20> str7(_L16("*gHiJk*op??sT")); sl@0: TBufC16<20> str8(_L16("aBC*rst")); sl@0: TBufC16<20> str9(_L16("ab?D*2rsT")); sl@0: sl@0: timeStart = User::TickCount(); sl@0: for(i=0;i<10000;++i) sl@0: { sl@0: res = KPlainText().MatchF(str7); sl@0: TheTest(res == 6); sl@0: res = KPlainText().MatchF(str8); sl@0: TheTest(res == 0); sl@0: res = KPlainText().MatchF(str9); sl@0: TheTest(res == KErrNotFound); sl@0: } sl@0: timeEnd = User::TickCount(); sl@0: TheTest.Printf(_L("MatchF() Time = %d ticks\n"), timeEnd - timeStart); sl@0: sl@0: TBufC16<21> str10(_L16("abcdefghijklmnopqrst")); sl@0: TBufC16<20> str11(_L16("*xyz*")); sl@0: TBufC16<20> str12(_L16("xyz")); sl@0: sl@0: timeStart = User::TickCount(); sl@0: for(i=0;i<10000;++i) sl@0: { sl@0: res = str10.FindF(str12); sl@0: TheTest(res == KErrNotFound); sl@0: } sl@0: timeEnd = User::TickCount(); sl@0: TheTest.Printf(_L("Nonmatching string. FindF() Time = %d ticks\n"), timeEnd - timeStart); sl@0: sl@0: timeStart = User::TickCount(); sl@0: for(i=0;i<10000;++i) sl@0: { sl@0: res = str10.MatchF(str11); sl@0: TheTest(res == KErrNotFound); sl@0: res = str10.MatchF(str12); sl@0: TheTest(res == KErrNotFound); sl@0: } sl@0: timeEnd = User::TickCount(); sl@0: TheTest.Printf(_L("Nonmatching string. MatchF() Time = %d ticks\n"), timeEnd - timeStart); sl@0: } sl@0: sl@0: static void RunComparison_PerformanceTest(TInt aNumberOfTimes, TDesC& aOriginalText, TDesC& aToCompareText, TBool aCase, TInt aValue = 0) sl@0: { sl@0: TUint timeStart; sl@0: TUint timeEnd; sl@0: TInt res = 0; sl@0: TInt i; sl@0: sl@0: // CompareF() case... sl@0: timeStart = User::TickCount(); sl@0: sl@0: for(i=0; i oriAsciiLargeText(_L("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno")); sl@0: TBufC16<5> oriAsciiSmallText(_L("ABCDE")); sl@0: sl@0: TBufC16<50> matchAsciiLargeText(_L("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno")); sl@0: TBufC16<5> matchAsciiSmallText(_L("ABCDE")); sl@0: sl@0: TBufC16<50> nonMatchAsciiLargeTextLast(_L("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnX")); sl@0: TBufC16<50> nonMatchAsciiLargeTextFirst(_L("XBCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno")); sl@0: sl@0: TBufC16<5> nonMatchAsciiSmallTextLast(_L("ABCDX")); sl@0: TBufC16<5> nonMatchAsciiSmallTextFirst(_L("XBCDE")); sl@0: sl@0: // (8-bit) Ascii Set of variables sl@0: sl@0: TBufC8<50> oriAsciiLargeText8(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno")); sl@0: TBufC8<5> oriAsciiSmallText8(_L8("ABCDE")); sl@0: sl@0: TBufC8<50> matchAsciiLargeText8(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno")); sl@0: TBufC8<5> matchAsciiSmallText8(_L8("ABCDE")); sl@0: sl@0: TBufC8<50> nonMatchAsciiLargeTextLast8(_L8("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnX")); sl@0: TBufC8<50> nonMatchAsciiLargeTextFirst8(_L8("XBCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmno")); sl@0: sl@0: TBufC8<5> nonMatchAsciiSmallTextLast8(_L8("ABCDX")); sl@0: TBufC8<5> nonMatchAsciiSmallTextFirst8(_L8("XBCDE")); sl@0: sl@0: // (16-bit) Unicode Set of variables sl@0: sl@0: TBufC16 oriUnicodeLargeText(largeUnicodeText16); sl@0: TBufC16 oriUnicodeSmallText(smallUnicodeText16); sl@0: sl@0: TBufC16 matchUnicodeLargeText(largeUnicodeText16); sl@0: TBufC16 matchUnicodeSmallText(smallUnicodeText16); sl@0: sl@0: TBufC16 nonMatchUnicodeLargeTextLast(largeErrUnicodeTextLast16); sl@0: TBufC16 nonMatchUnicodeLargeTextFirst(largeErrUnicodeTextFirst16); sl@0: sl@0: TBufC16 nonMatchUnicodeSmallTextLast(smallErrUnicodeTextLast16); sl@0: TBufC16 nonMatchUnicodeSmallTextFirst(smallErrUnicodeTextFirst16); sl@0: sl@0: // (16-bit) Unicode/Ascii Set of variables sl@0: sl@0: TBufC16 oriMixedLargeText(largeMixedText16); sl@0: TBufC16 oriMixedSmallText(smallMixedText16); sl@0: sl@0: TBufC16 matchMixedLargeText(largeMixedText16); sl@0: TBufC16 matchMixedSmallText(smallMixedText16); sl@0: sl@0: TBufC16 nonMatchMixedLargeTextLast(largeErrMixedTextLast16); sl@0: TBufC16 nonMatchMixedLargeTextFirst(largeErrMixedTextFirst16); sl@0: sl@0: TBufC16 nonMatchMixedSmallTextLast(smallErrMixedTextLast16); sl@0: TBufC16 nonMatchMixedSmallTextFirst(smallErrMixedTextFirst16); sl@0: sl@0: // Run performance tests... sl@0: sl@0: TheTest.Printf(_L("\n====== (8-bit) Ascii Performance tests ======")); sl@0: sl@0: // Matching (8-bit) Ascii sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Large Ascii Text\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, matchAsciiLargeText8, ETrue); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Small Ascii Text\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, matchAsciiSmallText8, ETrue); sl@0: sl@0: // Non Matching (8-bit) Ascii sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Last Char Diff / Large Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, nonMatchAsciiLargeTextLast8, EFalse, -9); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / First Char Diff / Large Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, nonMatchAsciiLargeTextFirst8, EFalse, -23); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Last Char Diff / Small Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, nonMatchAsciiSmallTextLast8, EFalse, -19); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / First Char Diff / Small Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, nonMatchAsciiSmallTextFirst8, EFalse, -23); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Last Char Diff / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, nonMatchAsciiSmallTextLast8, EFalse, -19); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / First Char Diff / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, nonMatchAsciiSmallTextFirst8, EFalse, -23); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Last Char Diff / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, nonMatchAsciiLargeTextLast8, EFalse, -45); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / First Char Diff / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, nonMatchAsciiLargeTextFirst8, EFalse, -23); sl@0: sl@0: // Mismatching length (8-bit) Ascii sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Length Mismatch / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText8, oriAsciiLargeText8, EFalse, -45); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Length Mismatch / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText8, oriAsciiSmallText8, EFalse, 45); sl@0: sl@0: TheTest.Printf(_L("\n====== (16-bit) Ascii Performance tests ======")); sl@0: sl@0: // Matching (16-bit) Ascii sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Large Ascii Text\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, matchAsciiLargeText, ETrue); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Small Ascii Text\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, matchAsciiSmallText, ETrue); sl@0: sl@0: // Non Matching (16-bit) Ascii sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Last Char Diff / Large Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, nonMatchAsciiLargeTextLast, EFalse, -9); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / First Char Diff / Large Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, nonMatchAsciiLargeTextFirst, EFalse, -23); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Last Char Diff / Small Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, nonMatchAsciiSmallTextLast, EFalse, -19); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / First Char Diff / Small Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, nonMatchAsciiSmallTextFirst, EFalse, -23); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Last Char Diff / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, nonMatchAsciiSmallTextLast, EFalse, -19); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / First Char Diff / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, nonMatchAsciiSmallTextFirst, EFalse, -23); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Last Char Diff / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, nonMatchAsciiLargeTextLast, EFalse, -1); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / First Char Diff / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, nonMatchAsciiLargeTextFirst, EFalse, -23); sl@0: sl@0: // Mismatching length (16-bit) Ascii sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Ascii Text / Length Mismatch / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiSmallText, oriAsciiLargeText, EFalse, -1); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Ascii Text / Length Mismatch / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriAsciiLargeText, oriAsciiSmallText, EFalse, 1); sl@0: sl@0: TheTest.Printf(_L("\n====== (16-bit) Unicode Performance tests ======")); sl@0: sl@0: // Matching (16-bit) Unicode sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Large Unicode Text\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, matchUnicodeLargeText, ETrue); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Small Unicode Text\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, matchUnicodeSmallText, ETrue); sl@0: sl@0: // Non Matching (16-bit) Unicode sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Unicode Text / Last Char Diff / Large Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, nonMatchUnicodeLargeTextLast, EFalse, -3); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Unicode Text / First Char Diff / Large Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, nonMatchUnicodeLargeTextFirst, EFalse, -3); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Unicode Text / Last Char Diff / Small Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, nonMatchUnicodeSmallTextLast, EFalse, -3); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Unicode Text / First Char Diff / Small Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, nonMatchUnicodeSmallTextFirst, EFalse, -3); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Unicode Text / Last Char Diff / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, nonMatchUnicodeSmallTextLast, EFalse, -3); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Unicode Text / First Char Diff / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, nonMatchUnicodeSmallTextFirst, EFalse, -3); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Unicode Text / Last Char Diff / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, nonMatchUnicodeLargeTextLast, EFalse, -1); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Unicode Text / First Char Diff / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, nonMatchUnicodeLargeTextFirst, EFalse, -3); sl@0: sl@0: // Mismatching length (16-bit) Unicode sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Unicode Text / Length Mismatch / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeSmallText, oriUnicodeLargeText, EFalse, -1); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Unicode Text / Length Mismatch / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriUnicodeLargeText, oriUnicodeSmallText, EFalse, 1); sl@0: sl@0: TheTest.Printf(_L("\n====== (16-bit) Mixed Performance tests ======")); sl@0: sl@0: // Matching (16-bit) Mixed sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Large Mixed Text\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, matchMixedLargeText, ETrue); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nMatching Small Mixed Text\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, matchMixedSmallText, ETrue); sl@0: sl@0: // Non Matching (16-bit) Mixed sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Mixed Text / Last Char Diff / Large Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, nonMatchMixedLargeTextLast, EFalse, -655); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Mixed Text / First Char Diff / Large Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, nonMatchMixedLargeTextFirst, EFalse, -675); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Mixed Text / Last Char Diff / Small Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, nonMatchMixedSmallTextLast, EFalse, -655); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Mixed Text / First Char Diff / Small Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, nonMatchMixedSmallTextFirst, EFalse, -675); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Mixed Text / Last Char Diff / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, nonMatchMixedSmallTextLast, EFalse, -655); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Mixed Text / First Char Diff / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, nonMatchMixedSmallTextFirst, EFalse, -675); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Mixed Text / Last Char Diff / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, nonMatchMixedLargeTextLast, EFalse, -1); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Mixed Text / First Char Diff / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, nonMatchMixedLargeTextFirst, EFalse, -675); sl@0: sl@0: // Mismatching length (16-bit) Mixed sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Small Mixed Text / Length Mismatch / Small Vs Large\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedSmallText, oriMixedLargeText, EFalse, -1); sl@0: sl@0: TheTest.Printf(_L("\nComparing Performance Times For: \nNON Matching Large Mixed Text / Length Mismatch / Large Vs Small\n")); sl@0: RunComparison_PerformanceTest(numberOfTimes, oriMixedLargeText, oriMixedSmallText, EFalse, 1); sl@0: } sl@0: sl@0: sl@0: sl@0: TInt E32Main() sl@0: { sl@0: TheTest.Title(); sl@0: sl@0: TheTest.Start(_L("Folding - performance tests")); sl@0: sl@0: ::FindF_PerformanceTest(); sl@0: ::MatchF_PerformanceTest(); sl@0: ::CompareF_PerformanceTest(); sl@0: ::PlainTextPerformanceTest(); sl@0: ::CompareVsCompareF_PerformanceTest(); sl@0: sl@0: TheTest.End(); sl@0: TheTest.Close(); sl@0: sl@0: return KErrNone; sl@0: }