Update contrib.
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
21 #include <ecom/ecom.h>
22 #include <ecom/implementationproxy.h>
23 #include <graphics/shapeimpl.h>
24 #include <graphics/openfontrasterizer.h>
25 #include <graphics/openfontconstants.h>
28 #include "t_shapeteststep.h"
32 TBool __bb = (cond); \
36 ERR_PRINTF1(_L("ERROR: Test Failed")); \
41 //add filenames for any test data here
42 const TText16* KTestFilenames[] =
44 //created from original iculayoutengine test data
45 (const TText16*) L"z:\\test\\data\\tnr_dev_otshaperdata1.dat",
46 //created from input data provided by licensee
47 (const TText16*) L"z:\\test\\data\\tnr_dev_otshaperdata2.dat",
48 //created from input data provided by licensee
49 (const TText16*) L"z:\\test\\data\\tnr_dev_otshaperdata3.dat",
50 //created from input data provided by licensee
51 (const TText16*) L"z:\\test\\data\\tnr_dev_otshaperdata4.dat",
52 // Data to test defect fix DEF078032
53 (const TText16*) L"z:\\test\\data\\tnr_dev_otshaperdata5.dat",
54 //created from input data provided by licensee
55 (const TText16*) L"z:\\test\\data\\shaperkannadadata1.dat",
56 // created from Kannada sample text
57 (const TText16*) L"z:\\test\\data\\shaperkannadadata2.dat",
58 // created from Kannada sample text
59 (const TText16*) L"z:\\test\\data\\shaperkannadadata3.dat",
60 // created from Gujarati sample text taken from the web
61 (const TText16*) L"z:\\test\\data\\shapergujaratidata1.dat",
62 // created from Gujarati sample text taken from the web
63 (const TText16*) L"z:\\test\\data\\shapergujaratidata2.dat",
64 // created from Gujarati sample text given by the licensee
65 (const TText16*) L"z:\\test\\data\\shapergujaratidata3.dat",
66 // created from Bengali sample text given by the licensee
67 (const TText16*) L"z:\\test\\data\\shaperbengalidata1.dat",
68 // created from Bengali sample text given by the licensee
69 (const TText16*) L"z:\\test\\data\\shaperbengalidata2.dat",
70 // created from Bengali sample text given by the licensee
71 (const TText16*) L"z:\\test\\data\\shaperbengalidata3.dat",
72 // created from Tamil sample text given by the licensee
73 (const TText16*) L"z:\\test\\data\\shapertamildata1.dat",
74 // created from Tamil sample text given by the licensee
75 (const TText16*) L"z:\\test\\data\\shapertamildata2.dat",
76 // created from Tamil sample text given by the licensee
77 (const TText16*) L"z:\\test\\data\\shapertamildata3.dat",
78 // created from Telugu sample text given by the licensee
79 (const TText16*) L"z:\\test\\data\\shapertelugudata1.dat",
80 // created from Telugu sample text given by the licensee
81 (const TText16*) L"z:\\test\\data\\shapertelugudata2.dat",
82 // created from Telugu sample text given by the licensee
83 (const TText16*) L"z:\\test\\data\\shapertelugudata3.dat",
84 // Test for Gurmukhi digit
85 (const TText16*) L"z:\\test\\data\\shapergurmukhi1.dat",
86 (const TText16*) L"z:\\test\\data\\shapergurmukhi2.dat",
87 (const TText16*) L"z:\\test\\data\\shapergurmukhi3.dat",
88 (const TText16*) L"z:\\test\\data\\shapergurmukhi4.dat",
89 (const TText16*) L"z:\\test\\data\\shapergurmukhi5.dat",
90 // Test for Malayalam digit
91 (const TText16*) L"z:\\test\\data\\shapermalayalam1.dat",
92 (const TText16*) L"z:\\test\\data\\shapermalayalam2.dat",
93 (const TText16*) L"z:\\test\\data\\shapermalayalam3.dat",
94 (const TText16*) L"z:\\test\\data\\shapermalayalam4.dat",
95 (const TText16*) L"z:\\test\\data\\shapermalayalam5.dat"
99 Number of test data files of each of the scripts/languages bein tests.
100 Must change these if KTestFilnames[] above is changed
102 const TInt KHindiTestDataIndex = 0;
103 const TInt KNumberOfHindiTestDataFiles = 5;
104 const TInt KKannadaTestDataIndex = 5;
105 const TInt KNumberOfKannadaTestDataFiles = 3;
106 const TInt KGujaratiTestDataIndex = 8;
107 const TInt KNumberOfGujaratiTestDataFiles = 3;
108 const TInt KBengaliTestDataIndex = 11;
109 const TInt KNumberOfBengaliTestDataFiles = 3;
110 const TInt KTamilTestDataIndex = 14;
111 const TInt KNumberOfTamilTestDataFiles = 3;
112 const TInt KTeluguTestDataIndex = 17;
113 const TInt KNumberOfTeluguTestDataFiles = 3;
114 const TInt KGurmukhiTestDataIndex = 20;
115 const TInt KNumberOfGurmukhiTestDataFiles = 5;
116 const TInt KMalayalamTestDataIndex = 25;
117 const TInt KNumberOfMalayalamTestDataFiles = 5;
119 const TUint32 KDevanagariScriptCode = 0x64657661;
120 const TUint32 KKannadaScriptCode = 0x6B6E6461;
121 const TUint32 KHindiLanguageCode = 0x48494E20;
122 const TUint32 KKannadaLanguageCode = 0x4B414E20;
123 const TUint32 KGujaratiScriptCode = 0x67756A72;
124 const TUint32 KGujaratiLanguageCode = 0x47554A20;
125 const TUint32 KBengaliScriptCode = 0x62656E67;
126 const TUint32 KBengaliLanguageCode = 0x42454E20;
127 const TUint32 KTamilScriptCode = 0x74616D6C;
128 const TUint32 KTamilLanguageCode = 0x54414D20;
129 const TUint32 KTeluguScriptCode = 0x74656C75;
130 const TUint32 KTeluguLanguageCode = 0x54454C20;
131 const TUint32 KGurmukhiScriptCode = 0x67757275;
132 const TUint32 KGurmukhiLanguageCode = 0;
133 const TUint32 KMalayalamScriptCode = 0x6d6c796d;
134 const TUint32 KMalayalamLanguageCode = 0x4d4c5220;
136 _LIT(KTestStep_Hindi, "Hindi");
137 _LIT(KTestStep_Kannada, "Kannada");
138 _LIT(KTestStep_Gujarati, "Gujarati");
139 _LIT(KTestStep_Bengali, "Bengali");
140 _LIT(KTestStep_Tamil, "Tamil");
141 _LIT(KTestStep_Telugu, "Telugu");
142 _LIT(KTestStep_Gurmukhi, "Gurmukhi");
143 _LIT(KTestStep_Malayalam, "Malayalam");
145 _LIT16(KHindi1,"\x0915\x094D\x0937\x0924\x094D\x0930\x093F\x092F\x0020\x0909\x0926\x094D\x0926\x0947\x0936\x094D\x0020\x0915\x094D\x0937\x093F\x092A\x094D\x0930");
146 _LIT16(KHindi2,"\x092d\x0942\x0930\x094d\x092d\x0941\x0935\x0903\x0020\x0938\x094d\x0935\x0903\x0020\x0924\x0924\x094d\x0938\x0935\x093f\x0924\x0941\x0930\x094d\x0935\x0930\x0947\x0923\x094d\x092f\x0902");
147 _LIT16(KHindi3,"\x092d\x0930\x094d\x0917\x094b\x0020\x0926\x0947\x0935\x0938\x094d\x092f\x0020\x0927\x0940\x092e\x0939\x093f\x0020\x0927\x093f\x092f\x094b\x0020\x092f\x094b\x0928\x0903\x0020\x092a\x094d\x0930\x091a\x094b\x0926\x092f\x093e\x0924\x094d\x0020");
149 _LIT16(KKannada1,"\x0CB6\x0CCD\x0CB0\x0CC0\x0020\x0CAD\x0C97\x0CB5\x0CBE\x0CA8\x0CC1\x0CB5\x0CBE\x0C9A\x0C95\x0CC1\x0CA4\x0CB8\x0CCD\x0CA4\x0CCD\x0CB5\x0CBE\x0020\x0C95\x0CB6\x0CCD\x0CAE\x0CB2\x0CAE\x0CBF\x0CA6\x0C82\x0020\x0CB5\x0CBF\x0CB7\x0CAE\x0020\x0CB8\x0CAE\x0CC1\x0CAA\x0CB8\x0CCD\x0CA5\x0CBF\x0CA4\x0CAE\x0CCD");
150 _LIT16(KKannada2,"\x0C85\x0CA8\x0CBE\x0CB0\x0CCD\x0CAF\x0C9C\x0CC1\x0CB7\x0CCD\x0CA0\x0CAE\x0CB8\x0CCD\x0CB5\x0CB0\x0CCD\x0C97\x0CCD\x0CAF\x0CAE\x0C95\x0CC0\x0CB0\x0CCD\x0CA4\x0CBF\x0C95\x0CB0\x0CAE\x0CB0\x0CCD\x0C9C\x0CC1\x0CA8");
151 _LIT16(KKannada3,"\x0C95\x0CCD\x0CB2\x0CC8\x0CAC\x0CCD\x0CAF\x0C82\x0020\x0CAE\x0CBE\x0020\x0CB8\x0CCD\x0CAE\x0020\x0C97\x0CAE\x0C83\x0020\x0CAA\x0CBE\x0CB0\x0CCD\x0CA5\x0020\x0CA8\x0CC8\x0CA4\x0CA4\x0CCD\x0CA4\x0CCD\x0CB5\x0CAF\x0CCD\x0CAF\x0CC1\x0CAA\x0CAA\x0CA7\x0CCD\x0CAF\x0CA4\x0CC7");
153 _LIT16(KGujarati1,"\x0AAD\x0ABE\x0AB5\x0ABE\x0AA4\x0ACD\x0AAE\x0A95\x0020\x0AAA\x0AA6\x0ACD\x0AAF\x0ABE\x0AA8\x0AC1\x0AB5\x0ABE\x0AA6\x0020\x0020\x002D\x0020\x0AB6\x0ACD\x0AB0\x0AC0\x0020\x0AAF\x0ACB\x0A97\x0AC7\x0AB6\x0ACD\x0AB5\x0AB0\x0A9C\x0AC0");
154 _LIT16(KGujarati2,"\x0AB5\x0ABF\x0AA8\x0ACD\x0AA1\x0ACB\x0A9D\x0020\x0AB5\x0ABF\x0AB8\x0ACD\x0A9F\x0ABE\x0020\x002D\x0020\x0A86\x0A82\x0AA4\x0AB0\x0AB0\x0ABE\x0AB7\x0ACD\x0A9F\x0ACD\x0AB0\x0ABF\x0AAF\x0A95\x0AB0\x0AA3\x0020\x0AB5\x0ABF\x0AB6\x0AC7\x0AA8\x0AC0\x0020\x0A9C\x0ABE\x0AA3\x0A95\x0ABE\x0AB0\x0AC0");
155 _LIT16(KGujarati3,"\x0AAE\x0ABE\x0A88\x0A95\x0ACD\x0AB0\x0ACB\x0AB8\x0ACB\x0AAB\x0ACD\x0A9F\x0AA8\x0ABE\x0020\x0A86\x0020\x0A86\x0A82\x0AA4\x0AB0\x0AB0\x0ABE\x0AB7\x0ACD\x0A9F\x0ACD\x0AB0\x0ABF\x0AAF\x0020\x0AAA\x0ACB\x0AB0\x0ACD\x0A9F\x0AB2\x0020\x0AB5\x0ABF\x0AB6\x0AC7\x0020\x0AB5\x0AA7\x0AC1\x0020\x0A9C\x0ABE\x0AA3\x0ACB\x002E\x0020\x0AB5\x0ABF\x0AB8\x0ACD\x0A9F\x0ABE\x0A8F\x0020\x0AA6\x0AC1\x0AA8\x0ABF\x0AAF\x0ABE\x0AAD\x0AB0\x0AA8\x0AC0\x0020\x0AAD\x0ABE\x0AB7\x0ABE\x0A93\x0020\x0AAE\x0ABE\x0A9F\x0AC7\x0020\x0AA6\x0ACD\x0AB5\x0ABE\x0AB0\x0020\x0A96\x0ACB\x0AB2\x0AC0\x0020\x0AA8\x0ABE\x0A96\x0ACD\x0AAF\x0ABE\x0020\x0A9B\x0AC7");
157 _LIT16(KBengali1,"\x099C\x09A8\x0997\x09A3\x09AE\x09A8\x0020\x0985\x09A7\x09BF\x09A8\x09BE\x09AF\x09BC\x0995\x0020\x099C\x09AF\x09BC\x0020\x09B9\x09C7\x0020\x09AD\x09BE\x09B0\x09A4\x0020\x09AD\x09BE\x0997\x09CD\x09AF\x0020\x09AC\x09BF\x09A7\x09BE\x09A4\x09BE\x0020\x09AA\x099E\x09CD\x099C\x09BE\x09AC\x0020\x09B8\x09BF\x09A8\x09CD\x09A7\x09C1\x0020");
158 _LIT16(KBengali2,"\x0997\x09C1\x099C\x09B0\x09BE\x099F\x0020\x09AE\x09B0\x09BE\x09A0\x09BE\x0020\x09A6\x09CD\x09B0\x09BE\x09AC\x09BF\x09A1\x09BC\x0020\x0989\x09A4\x09CD\x0995\x09B2\x0020\x09AC\x0999\x09CD\x0997\x0020\x09AC\x09BF\x09A8\x09CD\x09A7\x09CD\x09AF\x0020\x09B9\x09BF\x09AE\x09BE\x099A\x09B2\x0020\x09AF\x09AE\x09C1\x09A8\x09BE\x0020\x0997\x0999\x09CD\x0997\x09BE\x0020");
159 _LIT16(KBengali3,"\x0989\x099A\x09CD\x099B\x09B2\x0020\x099C\x09B2\x09A7\x09BF\x0020\x09A4\x09B0\x0999\x09CD\x0997\x0020\x09A4\x09AC\x0020\x09B6\x09C1\x09AD\x0020\x09A8\x09BE\x09AE\x09C7\x0020\x099C\x09BE\x0997\x09C7\x0020\x09A4\x09AC\x0020\x09B6\x09C1\x09AD\x0020\x0986\x09B6\x09BF\x09B8\x0020\x09AE\x09BE\x0997\x09C7\x0020\x0997\x09BE\x09B9\x09C7\x0020\x09A4\x09AC\x0020\x099C\x09AF\x09BC\x0020");
161 _LIT16(KTamil1,"\x0B89\x0BA3\x0BCD\x0BA3\x0020\x0BAE\x0BC1\x0B9F\x0BBF\x0BAF\x0BBE\x0BA4\x0020\x0BB5\x0BCB\x0BA4\x0BA8\x0BC0\x0BB0\x0BCD\x0020\x0BB5\x0BBE\x0BA9\x0BCD\x0BB5\x0BBE\x0BAF\x0BCD\x0BAA\x0BCD\x0BAA\x0B9F\x0BCD\x0020");
162 _LIT16(KTamil2,"\x0B86\x0BA9\x0BCD\x0BB1\x0BB5\x0BC1\x0BAF\x0BBF\x0BB0\x0BCD\x0020\x0B88\x0BB0\x0BBE\x0BB1\x0BC1\x0BAE\x0BCD\x0020\x0B90\x0B99\x0BCD\x0B95\x0BC1\x0BB1\x0BBF\x0BB2\x0BCD\x0020\x0B8F\x0BB4\x0BCD\x0BA8\x0BC6\x0B9F\x0BBF\x0BB2\x0BBE\x0BAE\x0BCD\x0020");
163 _LIT16(KTamil3,"\x0BAE\x0BC1\x0BAE\x0BCD\x0BAE\x0BC8\x0BAF\x0BBF\x0B9F\x0BA4\x0BCD\x0020\x0BA4\x0BC8\x0BAF\x0BCC\x0BB5\x0BC1\x0B99\x0BCD\x0020\x0B95\x0BC1\x0BA9\x0BCD\x0BB1\x0BC1\x0BAE\x0BC1\x0BA9\x0BCD\x0020\x0BA9\x0BCA\x0BB1\x0BCD\x0BB1\x0BC1\x0BA3\x0BCD\x0B9F\x0BC7\x0BB1\x0BCD");
165 _LIT16(KTelugu1,"\x0C05\x0C2A\x0C4D\x0C30\x0C15\x0C3E\x0C36\x0C4B\x093D\x0C2A\x0C4D\x0C30\x0C35\x0C43\x0C24\x0C4D\x0C24\x0C3F\x0C36\x0C4D\x0C1A\x0020\x0C2A\x0C4D\x0C30\x0C2E\x0C3E\x0C26\x0C4B\x0020\x0C0A\x0C30\x0C4D\x0C27\x0C4D\x0C35\x0C02");
166 _LIT16(KTelugu2,"\x0C15\x0C48\x0C30\x0C4D\x0C32\x0C3F\x0C19\x0C4D\x0C17\x0C48\x0C38\x0C4D\x0C24\x0C4D\x0C30\x0C40\x0C28\x0C4D\x0C17\x0C41\x0C23\x0C3E\x0C28\x0C47\x0C24\x0C3E\x0C28\x0C24\x0C40\x0C24\x0C4B\x0020\x0C17\x0C41\x0C23\x0C48\x0C30\x0C4D\x0C2F");
167 _LIT16(KTelugu3,"\x0020\x0C2C\x0C4D\x0C30\x0C39\x0C4D\x0C2E\x0C23\x0C4B\x0020\x0C39\x0C3F\x0020\x0C2A\x0C4D\x0C30\x0C24\x0C3F\x0C37\x0C4D\x0C20\x0C3E\x0C39\x0C2E\x0C2E\x0C43\x0C24\x0C38\x0C4D\x0C2F\x0C3E\x0C35\x0C4D\x0C2F\x0C2F\x0C38\x0C4D\x0C2F");
169 _LIT16(KGurmukhi1,"\x0a28\x0a2e\x0a38\x0a15\x0a3e\x0a30\x0a26\x0a\x3e\x0a28\x0a3f\x0a1a\x0a3f\x0a70\x0a26\x0a41\x0020\x0a28\x0a3f\x0a17\x0a4d\x0a30\x0a39\x0a3f\x0a2a\x0a70\x0a16\x0a40\x0a05\x0a32\x0a4b\x0a2a\x0a70\x0a16\x0a40\x0a05\x0a32\x0a4b\x0a2a\x0a30\x0a09\x0a2a\x0a15\x0a3e\x0a30\x0a3f\x0a06\x0a2a\x0a4d\x0a30\x0a24\x0a3e\x0a2a\x0a3f");
170 _LIT16(KGurmukhi2,"\x0a2a\x0a4d\x0a30\x0a24\x0a3f\x0a2a\x0a3e\x0a32\x0a47\x0020\x0a2a\x0a4d\x0a30\x0a2c\x0a32\x0a1a\x0a70\x0a21\x0a2b\x0a3f\x0a30\x0a70\x0a28\x0a4d\x0a39\x0a4d\x0a39\x0a3f\x0020\x0a2b\x0a41\x0a32\x0a35\x0a24\x0a2c\x0a4d\x0a30\x0a3f\x0a25\x0a3e\x0a2c\x0a4d\x0a30\x0a39\x0a2e\x0a3e\x0a26\x0a3f\x0020\x0a2c\x0a3e\x0a1b\x0a30\x0a2c\x0a3f\x0a38\x0a4d\x0a35\x0a70\x0a2d\x0a30\x0a2d\x0a4d\x0a30\x0a2e\x0a39\x0a41\x0a2d\x0a2f\x0a4b\x0a2d\x0a17\x0a35\x0a70\x0a24");
171 _LIT16(KGurmukhi3,"\x0a2e\x0a3e\x0a23\x0a40\x0a06\x0a2e\x0a4b\x0a24\x0a38\x0a30\x0a40\x0a06\x0a2f\x0a3e\x0a28\x0a5c\x0a40\x0a0f\x0a2f\x0a15\x0a40\x0a28\x0a3e\x0a30\x0a35\x0a3f\x0a70\x0a26\x0a41\x0020\x0a30\x0a2a\x0a38\x0a40\x0a32\x0a17\x0a3e\x0a35\x0a23\x0a3f\x0a06\x0a32\x0a4b\x0a5c\x0a40\x0a05\x0a39\x0a3f\x0a35\x0a30\x0a28\x0a41\x0a35\x0a40\x0a06\x0a39\x0a3f\x0a06\x0a5c\x0a5c\x0a15\x0a3f\x0a28\x0a2e\x0a38\x0a15\x0a3e\x0a30\x0a26\x0a3e\x0a28\x0a3f\x0a1a\x0a3f\x0a70\x0a26\x0a41\x0020");
173 _LIT16(KMalayalam1,"\xd09\xd28\xd4d\xd28\xd2f\xd3f\xd1a\xd4d\xd1a\xd4d\x200c\xd26\xd47\xd36\xd40\xd2f\xd07\xd1f\xd24\xd41\xd2a\xd15\xd4d\xd37\xd1f\xd4d\xd30\xd47\xd21\xd4d\x200c\xd2f\xd42\xd23\xd3f\xd2f\xd28\xd4d\x200d\xd05\xd2d\xd3f\xd28\xd28\xd4d");
174 _LIT16(KMalayalam2,"\xd2a\xd23\xd3f\xd2e\xd41\xd1f\xd15\xd4d\xd15\xd4d\x200c\xd2a\xd42\xd30\xd4d\x200d");
175 _LIT16(KMalayalam3,"\xd23\xd02\xd24\xd40\xd35\xd23\xd4d\xd1f\xd3f\xd15\xd33\xd4d\x200d\xd31\xd26\xd4d\xd26\xd3e\xd15\xd4d\xd15\xd3f\xd15\xd4b\xd34\xd3f\xd15\xd4d\xd15\xd4b\xd1f\xd4d\x200c\xd35\xd3f\xd35\xd3f\xd27\xd06\xd35\xd36\xd4d\xd2f\xd19\xd4d\xd19\xd33\xd4d\x200d");
177 CShapeTestStep::CShapeTestStep(TInt aTestDataIndex, TInt aNumberOfTestDataFiles,
178 TUint32 aScript, TUint32 aLang, const TDesC& aScriptName, const TDesC& aTestID)
179 : iTestDataIndex(aTestDataIndex), iNumberOfTestDataFiles(aNumberOfTestDataFiles),
180 iScript(aScript), iLang(aLang), iScriptName(aScriptName), iTestID(aTestID)
182 SetTestStepName(aScriptName);
185 // Convenience methods
186 //**************************************************************************************
189 Used for cleanup of RImplInfoArray implementationArray below
190 This method is stolen from FbsTop.cpp
192 LOCAL_C void ResetAndDestroyRImplInfoPtrArray(TAny* aPtr)
194 RImplInfoPtrArray* array = reinterpret_cast <RImplInfoPtrArray*> (aPtr);
195 array->ResetAndDestroy();
199 Load all ECOM implemented rasterizer DLLs.
200 This method is stolen from CFbTop::LoadOpenFontLibraries()
202 LOCAL_C void LoadOpenFontLibraries(CFontStore* aFontStore)
204 RImplInfoPtrArray implementationArray;
205 TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray);
206 CleanupStack::PushL(cleanup);
210 TUid uid = {KUidOpenFontRasterizerPlunginInterface};
212 // Making sure that no race situation arises
213 // If ECom is not ready, give it another chance and try again. if it still doesn't work
214 // after the third try, then it just carries on quietly and fails...
215 for (ecomnotready =0; ecomnotready <3; ecomnotready++)
217 TRAP(ecomerror,REComSession::ListImplementationsL(uid,implementationArray));
229 const TInt availCount = implementationArray.Count();
230 for (TInt count=0;count<availCount;++count)
232 const CImplementationInformation* info = implementationArray[count];
233 TUid rasterizerUid = info->ImplementationUid();
234 // Create a rasterizer
235 COpenFontRasterizer* rasterizer=0;
236 TRAP(error,rasterizer = COpenFontRasterizer::NewL(rasterizerUid));
239 // Install it in the font store.
240 TRAP(error,aFontStore->InstallRasterizerL(rasterizer));
245 CleanupStack::PopAndDestroy(&implementationArray);
248 void CShapeTestStep::SetupTestDataL()
250 //set up the testData variables
251 CDesC16ArrayFlat* testDataFilenames = new CDesC16ArrayFlat(2);
252 CleanupStack::PushL(testDataFilenames);
254 for (TInt i = 0; i != sizeof(KTestFilenames)/sizeof(KTestFilenames[0]); ++i)
256 TPtrC16 d(KTestFilenames[i]);
257 testDataFilenames->AppendL(d);
260 for (TInt i = 0; i<testDataFilenames->Count(); i++)
262 CTestData* temp = new(ELeave) CTestData;
263 temp->Internalize((*testDataFilenames)[i]);
264 iTestDataArr.AppendL(temp);
267 CleanupStack::PopAndDestroy(1); //testDataFilenames
272 //**************************************************************************************
276 @SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1479
277 @SYMTestCaseDesc Simple test of the shaper
278 @SYMTestPriority High
279 @SYMTestActions Simple test to shape some text using the shaper, and test that the output is as expected. Does not perform any OOM testing.
280 @SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
283 void CShapeTestStep::doShapeText(CBitmapFont* font, CTestData& aTestData, TBool aCheckOutput)
285 INFO_PRINTF1(_L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1479 "));
288 CShaper* theShaper = NULL;
289 CShaperFactory* shaperFactory = NULL;
291 RImplInfoPtrArray implementationArray;
292 TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray);
293 CleanupStack::PushL(cleanup);
296 TUid uid = {KUidShaperFactoryPlunginInterface};
298 // Making sure that no race situation arises between FBserv and Ecom
299 // If ECom is not ready, give it another chance and try again. if it still doesn't work
300 // after the third try, then it just carries on quietly and fails...
301 for (ecomnotready =0; ecomnotready <3; ecomnotready++)
304 TRAP(ecomerror,REComSession::ListImplementationsL(uid,implementationArray));
316 const TInt availCount = implementationArray.Count();
317 for (TInt count=0;count<availCount;++count)
319 const CImplementationInformation* info = implementationArray[count];
320 TUid shaperFactoryUid = info->ImplementationUid();
321 // Create a shaper factory
323 TRAP(error,shaperFactory = CShaperFactory::NewL(shaperFactoryUid));
324 test(error == KErrNone);
326 TRAP(error, theShaper = shaperFactory->NewShaperL(font, iScript, iLang, &User::Heap()));
327 if (error != KErrNone)
329 delete shaperFactory;
330 shaperFactory = NULL;
332 test(error == KErrNone);
333 break; // have got valid shaper here
335 CleanupStack::PopAndDestroy(&implementationArray);
337 CleanupStack::PushL(shaperFactory);
338 CleanupStack::PushL(theShaper);
340 // create the data to be shaped
341 // this uses hindiTestData, defined in testData.h
342 CShaper::TInput input;
343 input.iText = aTestData.iTextInput;
344 input.iStart = aTestData.iStart;
345 input.iEnd = aTestData.iEnd;
347 TInt textLength = input.iText->Length();
349 //create shape header, and shape the text
350 TShapeHeader* output = NULL;
351 TInt err = theShaper->ShapeText(output, input, &User::Heap());
352 test(err == KErrNone);
353 CleanupStack::PopAndDestroy(theShaper);
354 CleanupStack::PopAndDestroy(shaperFactory);
355 REComSession::FinalClose();
357 CleanupStack::PushL(output);
361 // check the contents of output
362 TEST(output->iGlyphCount == aTestData.iGlyphCount);
363 TEST(output->iCharacterCount == aTestData.iCharacterCount);
365 // First iGlyphCount * 4 bytes of the output buffer contain the glyph codes as 2byte values
366 // Compare against expected.
368 TUint32* shapePtr32 = (reinterpret_cast<TUint32*>(&output->iBuffer[0]));
369 for (i=0; i < output->iGlyphCount; i++)
371 TEST(*shapePtr32 == (*aTestData.iGlyphs)[i]);
375 // next iGlyphCount * 4 bytes contain the postions in which the glyphs should be drawn, x and y axes.
376 // Compare against expected
377 TUint16* shapePtr16 = (reinterpret_cast<TUint16*>(shapePtr32));
378 for (i=0; i < output->iGlyphCount*2; i++)
380 //check X or Y position
381 TEST(*shapePtr16 == (*aTestData.iPositions)[i]);
386 TEST(*shapePtr16 == aTestData.iAdvance.iX);
388 TEST(*shapePtr16 == aTestData.iAdvance.iY);
391 // next iGlyphCount * 2 bytes contain the coresponding indices of this character in the original string.
392 // Compare against expected
393 for (i=0; i < output->iGlyphCount; i++)
395 TEST(*shapePtr16 == (*aTestData.iIndices)[i]);
400 CleanupStack::PopAndDestroy(output);
403 void CShapeTestStep::shapeText(CBitmapFont* font, CTestData& aTestData, TBool aCheckOutput)
406 TInt heapSizeAtStart = 0;
407 User::Heap().AllocSize(heapSizeAtStart);
409 INFO_PRINTF2(_L("Heap memory utilized is now %d\n"), heapSizeAtStart);
411 doShapeText(font, aTestData, aCheckOutput);
412 // check the heap used by the shaper
413 RHeap* heap = &User::Heap();
415 TInt heapSizeAtEnd = 0;
416 TInt heapCellsUsed = heap->AllocSize(heapSizeAtEnd);
419 INFO_PRINTF2(_L("This test leaked %d\n"), heapSizeAtEnd - heapSizeAtStart);
426 @SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1480
427 @SYMTestCaseDesc Simple OOM test of shaper
428 @SYMTestPriority High
429 @SYMTestActions OOM testing for the shaper. Also ensures no leaks.
430 @SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
433 void CShapeTestStep::oomShapeText(CBitmapFont* font, CTestData& aTestData)
436 INFO_PRINTF1(_L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1480 "));
437 doOomShapeText(font,aTestData);
441 void CShapeTestStep::doOomShapeText(CBitmapFont* font, CTestData& aTestData)
445 TInt heapCellsUsed, heapSizeAtEnd, heapSizeAtStart;
446 CShaper* theShaper = NULL;
447 CShaperFactory* shaperFactory = NULL;
448 TShapeHeader* output = NULL;
450 User::Heap().AllocSize(heapSizeAtStart);
452 // create the data to be shaped
453 CShaper::TInput input;
454 input.iText = aTestData.iTextInput;
455 input.iStart = aTestData.iStart;
456 input.iEnd = aTestData.iEnd;
458 //set up shaper, shape, delete shaper in oom loop
459 RImplInfoPtrArray implementationArray;
460 TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray);
461 CleanupStack::PushL(cleanup);
465 TUid uid = {KUidShaperFactoryPlunginInterface};
467 // Making sure that no race situation arises between FBserv and Ecom
468 // If ECom is not ready, give it another chance and try again. if it still doesn't work
469 // after the third try, then it just carries on quietly and fails...
470 for (ecomnotready =0; ecomnotready <3; ecomnotready++)
473 TRAP(ecomerror,REComSession::ListImplementationsL(uid,implementationArray));
485 const TInt availCount = implementationArray.Count();
486 for (TInt count=0;count<availCount;++count)
488 const CImplementationInformation* info = implementationArray[count];
489 TUid shaperFactoryUid = info->ImplementationUid();
490 // Create a shaper factory
491 //CShaperFactory* shaperFactory = 0;
492 TRAP(error,shaperFactory = CShaperFactory::NewL(shaperFactoryUid));
493 test(error == KErrNone);
494 //CleanupStack::PushL(shaperFactory);
496 CleanupStack::PopAndDestroy(&implementationArray);
501 __UHEAP_FAILNEXT(count);
504 TRAPD(err, theShaper = shaperFactory->NewShaperL(font, iScript, iLang, &User::Heap()));
509 err = theShaper->ShapeText(output, input, &User::Heap());
510 TEST(err == KErrNone);
513 //free output; to be done by the caller of ShapeText
517 //does not check the output for now
519 delete shaperFactory;
520 REComSession::FinalClose();
522 }while ((err==KErrNoMemory)||(err==KErrGeneral));
525 // check the heap used by the shaper
526 RHeap* heap = &User::Heap();
528 heapCellsUsed = heap->AllocSize(heapSizeAtEnd);
531 INFO_PRINTF2(_L("This test leaked %d.\n"), heapSizeAtEnd - heapSizeAtStart);
537 @SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1481
538 @SYMTestCaseDesc Tests that the shaper can handle multiple calls to ShapeText
539 @SYMTestPriority High
540 @SYMTestActions Makes multiple calls to CShaper::ShapeText with small amounts of text to be shaped
541 @SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
544 void CShapeTestStep::repeatShapeText(CBitmapFont* aFont, CTestData& aTestData)
547 INFO_PRINTF1(_L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1481 "));
548 doRepeatShapeText(aFont, aTestData);
552 void CShapeTestStep::doRepeatShapeText(CBitmapFont* font, CTestData& aTestData)
555 CShaper* theShaper = NULL;
556 CShaperFactory* shaperFactory = NULL;
558 RImplInfoPtrArray implementationArray;
559 TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray);
560 CleanupStack::PushL(cleanup);
564 TUid uid = {KUidShaperFactoryPlunginInterface};
566 // Making sure that no race situation arises between FBserv and Ecom
567 // If ECom is not ready, give it another chance and try again. if it still doesn't work
568 // after the third try, then it just carries on quietly and fails...
569 for (ecomnotready =0; ecomnotready <3; ecomnotready++)
572 TRAP(ecomerror,REComSession::ListImplementationsL(uid,implementationArray));
584 const TInt availCount = implementationArray.Count();
585 for (TInt count=0;count<availCount;++count)
587 const CImplementationInformation* info = implementationArray[count];
588 TUid shaperFactoryUid = info->ImplementationUid();
589 // Create a shaper factory
591 TRAP(error,shaperFactory = CShaperFactory::NewL(shaperFactoryUid));
592 test(error == KErrNone);
595 TRAP(error, theShaper = shaperFactory->NewShaperL(font, iScript, iLang, &User::Heap()));
596 if (error != KErrNone)
598 delete shaperFactory;
599 shaperFactory = NULL;
601 test(error == KErrNone);
602 break; // have got valid shaper here
604 CleanupStack::PopAndDestroy(&implementationArray);
606 CleanupStack::PushL(shaperFactory);
607 CleanupStack::PushL(theShaper);
609 // create the data to be shaped
610 // this uses CTestData, defined in testData.h
611 CShaper::TInput input;
612 input.iText = aTestData.iTextInput;
614 //create shape header, and shape the text
615 TShapeHeader* output = NULL;
617 for(TInt i=aTestData.iStart; i<aTestData.iEnd -10; i++)
619 //indicate which 10 chars to be shaped
624 TInt err = theShaper->ShapeText(output, input, &User::Heap());
625 test(err == KErrNone);
627 //free output; to be done by the caller of ShapeText
631 //does not check the output for now
635 CleanupStack::PopAndDestroy(theShaper);
636 CleanupStack::PopAndDestroy(shaperFactory);
637 REComSession::FinalClose();
642 @SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3401
643 @SYMTestCaseDesc Tests that the shaper can handle calls to shapeText with multiple font sizes
644 @SYMTestPriority High
645 @SYMTestActions Makes multiple calls to CShaper::ShapeText with small amounts of text to be shaped and incremental font sizes
646 @SYMTestExpectedResults The test must not show a memory leak at any font size
647 @SYMPREQ DEF103042: TC_SHAP_shapeText test failing with alloc failure
649 void CShapeTestStep::doRepeatShapeUsingVariousFontSizesTest(CFontStore* aFontStore, const TDesC aTypefaceName, const TDesC &aText1,
650 const TDesC &aText2, const TDesC &aText3)
652 INFO_PRINTF1(_L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3401 "));
653 TInt heapCellsUsed, heapSizeAtEnd, heapSizeAtStart;
654 User::Heap().AllocSize(heapSizeAtStart);
656 // Set up shaper factory
658 CShaper* theShaper = NULL;
659 CShaperFactory* shaperFactory = NULL;
661 RImplInfoPtrArray implementationArray;
662 TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray);
663 CleanupStack::PushL(cleanup);
667 TUid uid = {KUidShaperFactoryPlunginInterface};
669 // Making sure that no race situation arises between FBserv and Ecom
670 // If ECom is not ready, give it another chance and try again. if it still doesn't work
671 // after the third try, then it just carries on quietly and fails...
672 for (ecomnotready =0; ecomnotready <3; ecomnotready++)
674 TRAP(ecomerror,REComSession::ListImplementationsL(uid,implementationArray));
686 const TInt availCount = implementationArray.Count();
687 for (TInt count=0;count<availCount;++count)
689 const CImplementationInformation* info = implementationArray[count];
690 TUid shaperFactoryUid = info->ImplementationUid();
691 // Create a shaper factory
692 TRAPD(error,shaperFactory = CShaperFactory::NewL(shaperFactoryUid));
693 test(error == KErrNone);
696 CleanupStack::PopAndDestroy(&implementationArray);
698 CleanupStack::PushL(shaperFactory);
700 // create the data to be shaped
701 // this explicitely uses hindiTestData, defined in testData.h
702 CShaper::TInput input;
705 //create shape header, and shape the text
706 TShapeHeader* output = NULL;
710 // Test shaping for the Hindi texts for various font sizes
711 INFO_PRINTF1(_L("Generating a random initial font size between 0 and 1 for this test\n"));
712 TInt random = (Math::Random()>>11)%2;
713 INFO_PRINTF2(_L("Random initial font size is %d. Testing upto size 300 with increments of 2\n"), random);
714 for (TInt i = random; i <= 300; i+=2)
716 INFO_PRINTF2(_L("Font Size: %d\n"), i);
717 if (i == 294 || i == 295)
719 INFO_PRINTF2(_L("Font Size: %d\n"), i);
721 TFontSpec fontSpec(aTypefaceName,i*20);
722 aFontStore->GetNearestFontInTwips((CFont*&)font, fontSpec);
723 CleanupStack::PushL(font);
725 TRAP(err, theShaper = shaperFactory->NewShaperL(font, iScript, iLang, &User::Heap()));
726 test(err == KErrNone);
727 CleanupStack::PushL(theShaper);
729 // Call the shaper twice because the first time the rasterizer uses memory to cache the tables
730 // We can then check the heap in the second call
731 input.iText = &aText1;
732 input.iEnd = aText1.Length();
733 err = theShaper->ShapeText(output, input, &User::Heap());
735 TEST(err == KErrNone);
737 err = theShaper->ShapeText(output, input, &User::Heap());
740 TEST(err == KErrNone);
742 input.iText = &aText2;
743 input.iEnd = aText2.Length();
744 err = theShaper->ShapeText(output, input, &User::Heap());
746 TEST(err == KErrNone);
748 err = theShaper->ShapeText(output, input, &User::Heap());
751 TEST(err == KErrNone);
753 input.iText = &aText3;
754 input.iEnd = aText3.Length();
755 err = theShaper->ShapeText(output, input, &User::Heap());
757 TEST(err == KErrNone);
759 err = theShaper->ShapeText(output, input, &User::Heap());
762 TEST(err == KErrNone);
764 CleanupStack::PopAndDestroy(theShaper);
765 CleanupStack::Pop(font);
766 aFontStore->ReleaseFont(font);
769 CleanupStack::PopAndDestroy(shaperFactory);
771 //close the ecom session opened by LoadOpenFontLibraries()
772 REComSession::FinalClose();
774 // check the heap used by the shaper
775 RHeap* heap = &User::Heap();
777 heapCellsUsed = heap->AllocSize(heapSizeAtEnd);
780 INFO_PRINTF2(_L("This test utilised %d bytes\n"), heapSizeAtEnd - heapSizeAtStart);
786 @SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3403
787 @SYMTestCaseDesc Tests the shaper using Devanagari Unicode. Test include OOM tests (oomShapeText), repeated
788 calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
789 calling the shaper with incremental font sizes.
790 @SYMTestPriority High
791 @SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
792 @SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
797 @SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3383-0001
798 @SYMTestCaseDesc Tests the shaper using Kannada Unicode. Test include OOM tests (oomShapeText), repeated
799 calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
800 calling the shaper with incremental font sizes.
801 @SYMTestPriority High
802 @SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
803 @SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
808 @SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3383-0002
809 @SYMTestCaseDesc Tests the shaper using Gujarati Unicode. Test include OOM tests (oomShapeText), repeated
810 calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
811 calling the shaper with incremental font sizes.
812 @SYMTestPriority High
813 @SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
814 @SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
819 @SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4001
820 @SYMTestCaseDesc Tests the shaper using Bengali Unicode. Test include OOM tests (oomShapeText), repeated
821 calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
822 calling the shaper with incremental font sizes.
823 @SYMTestPriority High
824 @SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
825 @SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
831 @SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4002
832 @SYMTestCaseDesc Tests the shaper using Tamil Unicode. Test include OOM tests (oomShapeText), repeated
833 calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
834 calling the shaper with incremental font sizes.
835 @SYMTestPriority High
836 @SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
837 @SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
843 @SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4003
844 @SYMTestCaseDesc Tests the shaper using Telugu Unicode. Test include OOM tests (oomShapeText), repeated
845 calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
846 calling the shaper with incremental font sizes.
847 @SYMTestPriority High
848 @SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
849 @SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
854 @SYMTestCaseID GRAPHICS-TI18N-ICULAYOUTENGINE-CT-4007
855 @SYMTestCaseDesc Case to do Gurmukhi component test
856 It covers all Iculayout components cases
857 @SYMTestPriority High
858 @SYMTestActions Iterate Gurmukhi test data, each test data corresponds with a case
859 @SYMTestExpectedResults No error returned
860 @SYMPREQ 1922: Gurmukhi support
863 @SYMTestCaseID GRAPHICS-TI18N-ICULAYOUTENGINE-CT-4008
864 @SYMTestCaseDesc Case to do Malayalam component test
865 It covers all Iculayout components cases
866 @SYMTestPriority High
867 @SYMTestActions Iterate Malayalam test data, each test data corresponds with a case
868 @SYMTestExpectedResults No error returned
869 @SYMPREQ 1922: Malayalam support
871 void CShapeTestStep::ShapeTestL()
873 INFO_PRINTF1(iTestID);
877 //the font store can use the normal user heap
878 CFontStore* fontStore = CFontStore::NewL(&User::Heap());
879 fontStore->iKPixelWidthInTwips = 11860;
880 fontStore->iKPixelHeightInTwips = 11860;
881 CleanupStack::PushL(fontStore);
883 //load all ecom implemented rasterizer dlls. installs the rasterizer.
884 LoadOpenFontLibraries(fontStore);
886 //add the required font file
887 TRAP(err,fontStore->AddFileL(iTestDataArr[iTestDataIndex]->iFilename));
888 test(err == KErrNone);
891 //run all tests for TNR_Dev_OT test, which is at position 0 in the aTestDataArr
892 TFontSpec fontSpec(iTestDataArr[iTestDataIndex]->iTypeFaceName,12);
893 fontStore->GetNearestFontToDesignHeightInPixels((CFont*&)font, fontSpec);
894 CleanupStack::PushL(font);
896 INFO_PRINTF2(_L("Repeat %S text shaping test\n"), &iScriptName);
897 doRepeatShapeText(font, *iTestDataArr[iTestDataIndex]);
898 repeatShapeText(font, *iTestDataArr[iTestDataIndex]);
900 INFO_PRINTF2(_L("OOM %S text shaping test\n"), &iScriptName);
902 doOomShapeText(font, *iTestDataArr[iTestDataIndex]);
903 oomShapeText(font, *iTestDataArr[iTestDataIndex]);
905 INFO_PRINTF1(_L("This test is ignored for release version\n"));
908 INFO_PRINTF2(_L("Run simple %S shape test\n"), &iScriptName);
909 doShapeText(font, *iTestDataArr[iTestDataIndex], ETrue);
910 shapeText(font, *iTestDataArr[iTestDataIndex], ETrue);
912 CleanupStack::Pop(font);
913 fontStore->ReleaseFont(font);
915 //for any other test data we have, run the simple shape text test only
916 for(TInt i=iTestDataIndex+1; i<iTestDataIndex+iNumberOfTestDataFiles; i++)
918 TFontSpec fontSpec(iTestDataArr[i]->iTypeFaceName,12);
919 fontStore->GetNearestFontToDesignHeightInPixels((CFont*&)font, fontSpec);
920 CleanupStack::PushL(font);
922 // First run does not check heap... this ensures that any memory
923 // stashed by the rasterizer does not show up as a leak.
924 doShapeText(font, *iTestDataArr[i], ETrue);
925 shapeText(font, *iTestDataArr[i], ETrue);
927 CleanupStack::Pop(font);
928 fontStore->ReleaseFont(font);
931 // Now do the last test, the shaping test using various font sizes
932 INFO_PRINTF2(_L("Repeat %S shaping test using font sizes 20 to 6000\n"), &iScriptName);
933 if(iScriptName == KTestStep_Hindi)
935 doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KHindi1, KHindi2, KHindi3);
937 else if(iScriptName == KTestStep_Kannada)
939 doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KKannada1, KKannada2, KKannada3);
941 else if(iScriptName == KTestStep_Gujarati)
943 doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KGujarati1, KGujarati2, KGujarati3);
945 else if(iScriptName == KTestStep_Bengali)
947 doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KBengali1, KBengali2, KBengali3);
949 else if(iScriptName == KTestStep_Tamil)
951 doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KTamil1, KTamil2, KTamil3);
953 else if(iScriptName == KTestStep_Telugu)
955 doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KTelugu1, KTelugu2, KTelugu3);
957 else if(iScriptName == KTestStep_Gurmukhi)
959 doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KGurmukhi1, KGurmukhi2, KGurmukhi3);
961 else if(iScriptName == KTestStep_Malayalam)
963 doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KMalayalam1, KMalayalam2, KMalayalam3);
966 CleanupStack::PopAndDestroy(fontStore);
967 REComSession::FinalClose(); //close the ecom session opened by LoadOpenFontLibraries()
970 TVerdict CShapeTestStep::doTestStepL()
972 SetTestStepResult(EFail);
976 TRAPD(error0, SetupTestDataL());
978 if(error0 == KErrNone)
980 TRAPD(error1, ShapeTestL());
982 if(error1 == KErrNone)
984 SetTestStepResult(EPass);
989 ERR_PRINTF1(_L("Failed to setup test data."));
992 iTestDataArr.ResetAndDestroy(); // close the iTestDataArr opened by SetupTestData()
996 return TestStepResult();
999 CTestStep * CShapeTestStep::CreateShapeTestStep(const TDesC& aStepName)
1001 if(aStepName == KTestStep_Hindi)
1003 return new CShapeTestStep(KHindiTestDataIndex, KNumberOfHindiTestDataFiles, KDevanagariScriptCode, KHindiLanguageCode,
1004 aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3403 "));
1006 else if(aStepName == KTestStep_Kannada)
1008 return new CShapeTestStep(KKannadaTestDataIndex, KNumberOfKannadaTestDataFiles, KKannadaScriptCode, KKannadaLanguageCode,
1009 aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3383-0001"));
1011 else if(aStepName == KTestStep_Gujarati)
1013 return new CShapeTestStep(KGujaratiTestDataIndex, KNumberOfGujaratiTestDataFiles, KGujaratiScriptCode, KGujaratiLanguageCode,
1014 aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3383-0002"));
1016 else if(aStepName == KTestStep_Bengali)
1018 return new CShapeTestStep(KBengaliTestDataIndex, KNumberOfBengaliTestDataFiles, KBengaliScriptCode, KBengaliLanguageCode,
1019 aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4001"));
1021 else if(aStepName == KTestStep_Tamil)
1023 return new CShapeTestStep(KTamilTestDataIndex, KNumberOfTamilTestDataFiles, KTamilScriptCode, KTamilLanguageCode,
1024 aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4002"));
1026 else if(aStepName == KTestStep_Telugu)
1028 return new CShapeTestStep(KTeluguTestDataIndex, KNumberOfTeluguTestDataFiles, KTeluguScriptCode, KTeluguLanguageCode,
1029 aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4003"));
1031 else if(aStepName == KTestStep_Gurmukhi)
1033 return new CShapeTestStep(KGurmukhiTestDataIndex, KNumberOfGurmukhiTestDataFiles, KGurmukhiScriptCode, KGurmukhiLanguageCode,
1034 aStepName, _L("GRAPHICS-TI18N-ICULAYOUTENGINE-CT-4007"));
1036 else if(aStepName == KTestStep_Malayalam)
1038 return new CShapeTestStep(KMalayalamTestDataIndex, KNumberOfMalayalamTestDataFiles, KMalayalamScriptCode, KMalayalamLanguageCode,
1039 aStepName, _L("GRAPHICS-TI18N-ICULAYOUTENGINE-CT-4007"));