sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
#include <e32math.h>
|
sl@0
|
19 |
#include <fbs.h>
|
sl@0
|
20 |
#include <badesca.h>
|
sl@0
|
21 |
#include <ecom/ecom.h>
|
sl@0
|
22 |
#include <ecom/implementationproxy.h>
|
sl@0
|
23 |
#include <graphics/shapeimpl.h>
|
sl@0
|
24 |
#include <graphics/openfontrasterizer.h>
|
sl@0
|
25 |
#include <graphics/openfontconstants.h>
|
sl@0
|
26 |
|
sl@0
|
27 |
#include "testData.h"
|
sl@0
|
28 |
#include "t_shapeteststep.h"
|
sl@0
|
29 |
|
sl@0
|
30 |
#define test(cond) \
|
sl@0
|
31 |
{ \
|
sl@0
|
32 |
TBool __bb = (cond); \
|
sl@0
|
33 |
TEST(__bb); \
|
sl@0
|
34 |
if (!__bb) \
|
sl@0
|
35 |
{ \
|
sl@0
|
36 |
ERR_PRINTF1(_L("ERROR: Test Failed")); \
|
sl@0
|
37 |
User::Leave(1); \
|
sl@0
|
38 |
} \
|
sl@0
|
39 |
}
|
sl@0
|
40 |
|
sl@0
|
41 |
//add filenames for any test data here
|
sl@0
|
42 |
const TText16* KTestFilenames[] =
|
sl@0
|
43 |
{
|
sl@0
|
44 |
//created from original iculayoutengine test data
|
sl@0
|
45 |
(const TText16*) L"z:\\test\\data\\tnr_dev_otshaperdata1.dat",
|
sl@0
|
46 |
//created from input data provided by licensee
|
sl@0
|
47 |
(const TText16*) L"z:\\test\\data\\tnr_dev_otshaperdata2.dat",
|
sl@0
|
48 |
//created from input data provided by licensee
|
sl@0
|
49 |
(const TText16*) L"z:\\test\\data\\tnr_dev_otshaperdata3.dat",
|
sl@0
|
50 |
//created from input data provided by licensee
|
sl@0
|
51 |
(const TText16*) L"z:\\test\\data\\tnr_dev_otshaperdata4.dat",
|
sl@0
|
52 |
// Data to test defect fix DEF078032
|
sl@0
|
53 |
(const TText16*) L"z:\\test\\data\\tnr_dev_otshaperdata5.dat",
|
sl@0
|
54 |
//created from input data provided by licensee
|
sl@0
|
55 |
(const TText16*) L"z:\\test\\data\\shaperkannadadata1.dat",
|
sl@0
|
56 |
// created from Kannada sample text
|
sl@0
|
57 |
(const TText16*) L"z:\\test\\data\\shaperkannadadata2.dat",
|
sl@0
|
58 |
// created from Kannada sample text
|
sl@0
|
59 |
(const TText16*) L"z:\\test\\data\\shaperkannadadata3.dat",
|
sl@0
|
60 |
// created from Gujarati sample text taken from the web
|
sl@0
|
61 |
(const TText16*) L"z:\\test\\data\\shapergujaratidata1.dat",
|
sl@0
|
62 |
// created from Gujarati sample text taken from the web
|
sl@0
|
63 |
(const TText16*) L"z:\\test\\data\\shapergujaratidata2.dat",
|
sl@0
|
64 |
// created from Gujarati sample text given by the licensee
|
sl@0
|
65 |
(const TText16*) L"z:\\test\\data\\shapergujaratidata3.dat",
|
sl@0
|
66 |
// created from Bengali sample text given by the licensee
|
sl@0
|
67 |
(const TText16*) L"z:\\test\\data\\shaperbengalidata1.dat",
|
sl@0
|
68 |
// created from Bengali sample text given by the licensee
|
sl@0
|
69 |
(const TText16*) L"z:\\test\\data\\shaperbengalidata2.dat",
|
sl@0
|
70 |
// created from Bengali sample text given by the licensee
|
sl@0
|
71 |
(const TText16*) L"z:\\test\\data\\shaperbengalidata3.dat",
|
sl@0
|
72 |
// created from Tamil sample text given by the licensee
|
sl@0
|
73 |
(const TText16*) L"z:\\test\\data\\shapertamildata1.dat",
|
sl@0
|
74 |
// created from Tamil sample text given by the licensee
|
sl@0
|
75 |
(const TText16*) L"z:\\test\\data\\shapertamildata2.dat",
|
sl@0
|
76 |
// created from Tamil sample text given by the licensee
|
sl@0
|
77 |
(const TText16*) L"z:\\test\\data\\shapertamildata3.dat",
|
sl@0
|
78 |
// created from Telugu sample text given by the licensee
|
sl@0
|
79 |
(const TText16*) L"z:\\test\\data\\shapertelugudata1.dat",
|
sl@0
|
80 |
// created from Telugu sample text given by the licensee
|
sl@0
|
81 |
(const TText16*) L"z:\\test\\data\\shapertelugudata2.dat",
|
sl@0
|
82 |
// created from Telugu sample text given by the licensee
|
sl@0
|
83 |
(const TText16*) L"z:\\test\\data\\shapertelugudata3.dat",
|
sl@0
|
84 |
// Test for Gurmukhi digit
|
sl@0
|
85 |
(const TText16*) L"z:\\test\\data\\shapergurmukhi1.dat",
|
sl@0
|
86 |
(const TText16*) L"z:\\test\\data\\shapergurmukhi2.dat",
|
sl@0
|
87 |
(const TText16*) L"z:\\test\\data\\shapergurmukhi3.dat",
|
sl@0
|
88 |
(const TText16*) L"z:\\test\\data\\shapergurmukhi4.dat",
|
sl@0
|
89 |
(const TText16*) L"z:\\test\\data\\shapergurmukhi5.dat",
|
sl@0
|
90 |
// Test for Malayalam digit
|
sl@0
|
91 |
(const TText16*) L"z:\\test\\data\\shapermalayalam1.dat",
|
sl@0
|
92 |
(const TText16*) L"z:\\test\\data\\shapermalayalam2.dat",
|
sl@0
|
93 |
(const TText16*) L"z:\\test\\data\\shapermalayalam3.dat",
|
sl@0
|
94 |
(const TText16*) L"z:\\test\\data\\shapermalayalam4.dat",
|
sl@0
|
95 |
(const TText16*) L"z:\\test\\data\\shapermalayalam5.dat"
|
sl@0
|
96 |
};
|
sl@0
|
97 |
|
sl@0
|
98 |
/**
|
sl@0
|
99 |
Number of test data files of each of the scripts/languages bein tests.
|
sl@0
|
100 |
Must change these if KTestFilnames[] above is changed
|
sl@0
|
101 |
*/
|
sl@0
|
102 |
const TInt KHindiTestDataIndex = 0;
|
sl@0
|
103 |
const TInt KNumberOfHindiTestDataFiles = 5;
|
sl@0
|
104 |
const TInt KKannadaTestDataIndex = 5;
|
sl@0
|
105 |
const TInt KNumberOfKannadaTestDataFiles = 3;
|
sl@0
|
106 |
const TInt KGujaratiTestDataIndex = 8;
|
sl@0
|
107 |
const TInt KNumberOfGujaratiTestDataFiles = 3;
|
sl@0
|
108 |
const TInt KBengaliTestDataIndex = 11;
|
sl@0
|
109 |
const TInt KNumberOfBengaliTestDataFiles = 3;
|
sl@0
|
110 |
const TInt KTamilTestDataIndex = 14;
|
sl@0
|
111 |
const TInt KNumberOfTamilTestDataFiles = 3;
|
sl@0
|
112 |
const TInt KTeluguTestDataIndex = 17;
|
sl@0
|
113 |
const TInt KNumberOfTeluguTestDataFiles = 3;
|
sl@0
|
114 |
const TInt KGurmukhiTestDataIndex = 20;
|
sl@0
|
115 |
const TInt KNumberOfGurmukhiTestDataFiles = 5;
|
sl@0
|
116 |
const TInt KMalayalamTestDataIndex = 25;
|
sl@0
|
117 |
const TInt KNumberOfMalayalamTestDataFiles = 5;
|
sl@0
|
118 |
|
sl@0
|
119 |
const TUint32 KDevanagariScriptCode = 0x64657661;
|
sl@0
|
120 |
const TUint32 KKannadaScriptCode = 0x6B6E6461;
|
sl@0
|
121 |
const TUint32 KHindiLanguageCode = 0x48494E20;
|
sl@0
|
122 |
const TUint32 KKannadaLanguageCode = 0x4B414E20;
|
sl@0
|
123 |
const TUint32 KGujaratiScriptCode = 0x67756A72;
|
sl@0
|
124 |
const TUint32 KGujaratiLanguageCode = 0x47554A20;
|
sl@0
|
125 |
const TUint32 KBengaliScriptCode = 0x62656E67;
|
sl@0
|
126 |
const TUint32 KBengaliLanguageCode = 0x42454E20;
|
sl@0
|
127 |
const TUint32 KTamilScriptCode = 0x74616D6C;
|
sl@0
|
128 |
const TUint32 KTamilLanguageCode = 0x54414D20;
|
sl@0
|
129 |
const TUint32 KTeluguScriptCode = 0x74656C75;
|
sl@0
|
130 |
const TUint32 KTeluguLanguageCode = 0x54454C20;
|
sl@0
|
131 |
const TUint32 KGurmukhiScriptCode = 0x67757275;
|
sl@0
|
132 |
const TUint32 KGurmukhiLanguageCode = 0;
|
sl@0
|
133 |
const TUint32 KMalayalamScriptCode = 0x6d6c796d;
|
sl@0
|
134 |
const TUint32 KMalayalamLanguageCode = 0x4d4c5220;
|
sl@0
|
135 |
|
sl@0
|
136 |
_LIT(KTestStep_Hindi, "Hindi");
|
sl@0
|
137 |
_LIT(KTestStep_Kannada, "Kannada");
|
sl@0
|
138 |
_LIT(KTestStep_Gujarati, "Gujarati");
|
sl@0
|
139 |
_LIT(KTestStep_Bengali, "Bengali");
|
sl@0
|
140 |
_LIT(KTestStep_Tamil, "Tamil");
|
sl@0
|
141 |
_LIT(KTestStep_Telugu, "Telugu");
|
sl@0
|
142 |
_LIT(KTestStep_Gurmukhi, "Gurmukhi");
|
sl@0
|
143 |
_LIT(KTestStep_Malayalam, "Malayalam");
|
sl@0
|
144 |
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
148 |
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
152 |
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
156 |
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
160 |
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
164 |
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
168 |
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
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");
|
sl@0
|
172 |
|
sl@0
|
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");
|
sl@0
|
174 |
_LIT16(KMalayalam2,"\xd2a\xd23\xd3f\xd2e\xd41\xd1f\xd15\xd4d\xd15\xd4d\x200c\xd2a\xd42\xd30\xd4d\x200d");
|
sl@0
|
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");
|
sl@0
|
176 |
|
sl@0
|
177 |
CShapeTestStep::CShapeTestStep(TInt aTestDataIndex, TInt aNumberOfTestDataFiles,
|
sl@0
|
178 |
TUint32 aScript, TUint32 aLang, const TDesC& aScriptName, const TDesC& aTestID)
|
sl@0
|
179 |
: iTestDataIndex(aTestDataIndex), iNumberOfTestDataFiles(aNumberOfTestDataFiles),
|
sl@0
|
180 |
iScript(aScript), iLang(aLang), iScriptName(aScriptName), iTestID(aTestID)
|
sl@0
|
181 |
{
|
sl@0
|
182 |
SetTestStepName(aScriptName);
|
sl@0
|
183 |
}
|
sl@0
|
184 |
|
sl@0
|
185 |
// Convenience methods
|
sl@0
|
186 |
//**************************************************************************************
|
sl@0
|
187 |
|
sl@0
|
188 |
/*
|
sl@0
|
189 |
Used for cleanup of RImplInfoArray implementationArray below
|
sl@0
|
190 |
This method is stolen from FbsTop.cpp
|
sl@0
|
191 |
*/
|
sl@0
|
192 |
LOCAL_C void ResetAndDestroyRImplInfoPtrArray(TAny* aPtr)
|
sl@0
|
193 |
{
|
sl@0
|
194 |
RImplInfoPtrArray* array = reinterpret_cast <RImplInfoPtrArray*> (aPtr);
|
sl@0
|
195 |
array->ResetAndDestroy();
|
sl@0
|
196 |
}
|
sl@0
|
197 |
|
sl@0
|
198 |
/*
|
sl@0
|
199 |
Load all ECOM implemented rasterizer DLLs.
|
sl@0
|
200 |
This method is stolen from CFbTop::LoadOpenFontLibraries()
|
sl@0
|
201 |
*/
|
sl@0
|
202 |
LOCAL_C void LoadOpenFontLibraries(CFontStore* aFontStore)
|
sl@0
|
203 |
{
|
sl@0
|
204 |
RImplInfoPtrArray implementationArray;
|
sl@0
|
205 |
TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray);
|
sl@0
|
206 |
CleanupStack::PushL(cleanup);
|
sl@0
|
207 |
TInt error;
|
sl@0
|
208 |
TInt ecomerror;
|
sl@0
|
209 |
TInt ecomnotready;
|
sl@0
|
210 |
TUid uid = {KUidOpenFontRasterizerPlunginInterface};
|
sl@0
|
211 |
|
sl@0
|
212 |
// Making sure that no race situation arises
|
sl@0
|
213 |
// If ECom is not ready, give it another chance and try again. if it still doesn't work
|
sl@0
|
214 |
// after the third try, then it just carries on quietly and fails...
|
sl@0
|
215 |
for (ecomnotready =0; ecomnotready <3; ecomnotready++)
|
sl@0
|
216 |
{
|
sl@0
|
217 |
TRAP(ecomerror,REComSession::ListImplementationsL(uid,implementationArray));
|
sl@0
|
218 |
if (!ecomerror)
|
sl@0
|
219 |
{
|
sl@0
|
220 |
break;
|
sl@0
|
221 |
}
|
sl@0
|
222 |
else
|
sl@0
|
223 |
{
|
sl@0
|
224 |
ecomerror = 0;
|
sl@0
|
225 |
User::After(0);
|
sl@0
|
226 |
}
|
sl@0
|
227 |
}
|
sl@0
|
228 |
|
sl@0
|
229 |
const TInt availCount = implementationArray.Count();
|
sl@0
|
230 |
for (TInt count=0;count<availCount;++count)
|
sl@0
|
231 |
{
|
sl@0
|
232 |
const CImplementationInformation* info = implementationArray[count];
|
sl@0
|
233 |
TUid rasterizerUid = info->ImplementationUid();
|
sl@0
|
234 |
// Create a rasterizer
|
sl@0
|
235 |
COpenFontRasterizer* rasterizer=0;
|
sl@0
|
236 |
TRAP(error,rasterizer = COpenFontRasterizer::NewL(rasterizerUid));
|
sl@0
|
237 |
if (!error)
|
sl@0
|
238 |
{
|
sl@0
|
239 |
// Install it in the font store.
|
sl@0
|
240 |
TRAP(error,aFontStore->InstallRasterizerL(rasterizer));
|
sl@0
|
241 |
if (error)
|
sl@0
|
242 |
delete rasterizer;
|
sl@0
|
243 |
}
|
sl@0
|
244 |
}
|
sl@0
|
245 |
CleanupStack::PopAndDestroy(&implementationArray);
|
sl@0
|
246 |
}
|
sl@0
|
247 |
|
sl@0
|
248 |
void CShapeTestStep::SetupTestDataL()
|
sl@0
|
249 |
{
|
sl@0
|
250 |
//set up the testData variables
|
sl@0
|
251 |
CDesC16ArrayFlat* testDataFilenames = new CDesC16ArrayFlat(2);
|
sl@0
|
252 |
CleanupStack::PushL(testDataFilenames);
|
sl@0
|
253 |
|
sl@0
|
254 |
for (TInt i = 0; i != sizeof(KTestFilenames)/sizeof(KTestFilenames[0]); ++i)
|
sl@0
|
255 |
{
|
sl@0
|
256 |
TPtrC16 d(KTestFilenames[i]);
|
sl@0
|
257 |
testDataFilenames->AppendL(d);
|
sl@0
|
258 |
}
|
sl@0
|
259 |
|
sl@0
|
260 |
for (TInt i = 0; i<testDataFilenames->Count(); i++)
|
sl@0
|
261 |
{
|
sl@0
|
262 |
CTestData* temp = new(ELeave) CTestData;
|
sl@0
|
263 |
temp->Internalize((*testDataFilenames)[i]);
|
sl@0
|
264 |
iTestDataArr.AppendL(temp);
|
sl@0
|
265 |
}
|
sl@0
|
266 |
|
sl@0
|
267 |
CleanupStack::PopAndDestroy(1); //testDataFilenames
|
sl@0
|
268 |
}
|
sl@0
|
269 |
|
sl@0
|
270 |
|
sl@0
|
271 |
// test methods
|
sl@0
|
272 |
//**************************************************************************************
|
sl@0
|
273 |
|
sl@0
|
274 |
/**
|
sl@0
|
275 |
@file
|
sl@0
|
276 |
@SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1479
|
sl@0
|
277 |
@SYMTestCaseDesc Simple test of the shaper
|
sl@0
|
278 |
@SYMTestPriority High
|
sl@0
|
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.
|
sl@0
|
280 |
@SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
|
sl@0
|
281 |
@SYMPREQ PREQ18
|
sl@0
|
282 |
*/
|
sl@0
|
283 |
void CShapeTestStep::doShapeText(CBitmapFont* font, CTestData& aTestData, TBool aCheckOutput)
|
sl@0
|
284 |
{
|
sl@0
|
285 |
INFO_PRINTF1(_L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1479 "));
|
sl@0
|
286 |
|
sl@0
|
287 |
//set up the shaper
|
sl@0
|
288 |
CShaper* theShaper = NULL;
|
sl@0
|
289 |
CShaperFactory* shaperFactory = NULL;
|
sl@0
|
290 |
|
sl@0
|
291 |
RImplInfoPtrArray implementationArray;
|
sl@0
|
292 |
TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray);
|
sl@0
|
293 |
CleanupStack::PushL(cleanup);
|
sl@0
|
294 |
TInt ecomerror;
|
sl@0
|
295 |
TInt ecomnotready;
|
sl@0
|
296 |
TUid uid = {KUidShaperFactoryPlunginInterface};
|
sl@0
|
297 |
|
sl@0
|
298 |
// Making sure that no race situation arises between FBserv and Ecom
|
sl@0
|
299 |
// If ECom is not ready, give it another chance and try again. if it still doesn't work
|
sl@0
|
300 |
// after the third try, then it just carries on quietly and fails...
|
sl@0
|
301 |
for (ecomnotready =0; ecomnotready <3; ecomnotready++)
|
sl@0
|
302 |
{
|
sl@0
|
303 |
|
sl@0
|
304 |
TRAP(ecomerror,REComSession::ListImplementationsL(uid,implementationArray));
|
sl@0
|
305 |
if (!ecomerror)
|
sl@0
|
306 |
{
|
sl@0
|
307 |
break;
|
sl@0
|
308 |
}
|
sl@0
|
309 |
else
|
sl@0
|
310 |
{
|
sl@0
|
311 |
ecomerror = 0;
|
sl@0
|
312 |
User::After(0);
|
sl@0
|
313 |
}
|
sl@0
|
314 |
}
|
sl@0
|
315 |
|
sl@0
|
316 |
const TInt availCount = implementationArray.Count();
|
sl@0
|
317 |
for (TInt count=0;count<availCount;++count)
|
sl@0
|
318 |
{
|
sl@0
|
319 |
const CImplementationInformation* info = implementationArray[count];
|
sl@0
|
320 |
TUid shaperFactoryUid = info->ImplementationUid();
|
sl@0
|
321 |
// Create a shaper factory
|
sl@0
|
322 |
TInt error;
|
sl@0
|
323 |
TRAP(error,shaperFactory = CShaperFactory::NewL(shaperFactoryUid));
|
sl@0
|
324 |
test(error == KErrNone);
|
sl@0
|
325 |
// Create a shaper
|
sl@0
|
326 |
TRAP(error, theShaper = shaperFactory->NewShaperL(font, iScript, iLang, &User::Heap()));
|
sl@0
|
327 |
if (error != KErrNone)
|
sl@0
|
328 |
{
|
sl@0
|
329 |
delete shaperFactory;
|
sl@0
|
330 |
shaperFactory = NULL;
|
sl@0
|
331 |
}
|
sl@0
|
332 |
test(error == KErrNone);
|
sl@0
|
333 |
break; // have got valid shaper here
|
sl@0
|
334 |
}
|
sl@0
|
335 |
CleanupStack::PopAndDestroy(&implementationArray);
|
sl@0
|
336 |
|
sl@0
|
337 |
CleanupStack::PushL(shaperFactory);
|
sl@0
|
338 |
CleanupStack::PushL(theShaper);
|
sl@0
|
339 |
|
sl@0
|
340 |
// create the data to be shaped
|
sl@0
|
341 |
// this uses hindiTestData, defined in testData.h
|
sl@0
|
342 |
CShaper::TInput input;
|
sl@0
|
343 |
input.iText = aTestData.iTextInput;
|
sl@0
|
344 |
input.iStart = aTestData.iStart;
|
sl@0
|
345 |
input.iEnd = aTestData.iEnd;
|
sl@0
|
346 |
|
sl@0
|
347 |
TInt textLength = input.iText->Length();
|
sl@0
|
348 |
|
sl@0
|
349 |
//create shape header, and shape the text
|
sl@0
|
350 |
TShapeHeader* output = NULL;
|
sl@0
|
351 |
TInt err = theShaper->ShapeText(output, input, &User::Heap());
|
sl@0
|
352 |
test(err == KErrNone);
|
sl@0
|
353 |
CleanupStack::PopAndDestroy(theShaper);
|
sl@0
|
354 |
CleanupStack::PopAndDestroy(shaperFactory);
|
sl@0
|
355 |
REComSession::FinalClose();
|
sl@0
|
356 |
|
sl@0
|
357 |
CleanupStack::PushL(output);
|
sl@0
|
358 |
|
sl@0
|
359 |
if (aCheckOutput)
|
sl@0
|
360 |
{
|
sl@0
|
361 |
// check the contents of output
|
sl@0
|
362 |
TEST(output->iGlyphCount == aTestData.iGlyphCount);
|
sl@0
|
363 |
TEST(output->iCharacterCount == aTestData.iCharacterCount);
|
sl@0
|
364 |
|
sl@0
|
365 |
// First iGlyphCount * 4 bytes of the output buffer contain the glyph codes as 2byte values
|
sl@0
|
366 |
// Compare against expected.
|
sl@0
|
367 |
TInt i=0;
|
sl@0
|
368 |
TUint32* shapePtr32 = (reinterpret_cast<TUint32*>(&output->iBuffer[0]));
|
sl@0
|
369 |
for (i=0; i < output->iGlyphCount; i++)
|
sl@0
|
370 |
{
|
sl@0
|
371 |
TEST(*shapePtr32 == (*aTestData.iGlyphs)[i]);
|
sl@0
|
372 |
shapePtr32++;
|
sl@0
|
373 |
}
|
sl@0
|
374 |
|
sl@0
|
375 |
// next iGlyphCount * 4 bytes contain the postions in which the glyphs should be drawn, x and y axes.
|
sl@0
|
376 |
// Compare against expected
|
sl@0
|
377 |
TUint16* shapePtr16 = (reinterpret_cast<TUint16*>(shapePtr32));
|
sl@0
|
378 |
for (i=0; i < output->iGlyphCount*2; i++)
|
sl@0
|
379 |
{
|
sl@0
|
380 |
//check X or Y position
|
sl@0
|
381 |
TEST(*shapePtr16 == (*aTestData.iPositions)[i]);
|
sl@0
|
382 |
shapePtr16++;
|
sl@0
|
383 |
}
|
sl@0
|
384 |
|
sl@0
|
385 |
// check advance
|
sl@0
|
386 |
TEST(*shapePtr16 == aTestData.iAdvance.iX);
|
sl@0
|
387 |
shapePtr16++;
|
sl@0
|
388 |
TEST(*shapePtr16 == aTestData.iAdvance.iY);
|
sl@0
|
389 |
shapePtr16++;
|
sl@0
|
390 |
|
sl@0
|
391 |
// next iGlyphCount * 2 bytes contain the coresponding indices of this character in the original string.
|
sl@0
|
392 |
// Compare against expected
|
sl@0
|
393 |
for (i=0; i < output->iGlyphCount; i++)
|
sl@0
|
394 |
{
|
sl@0
|
395 |
TEST(*shapePtr16 == (*aTestData.iIndices)[i]);
|
sl@0
|
396 |
shapePtr16++;
|
sl@0
|
397 |
}
|
sl@0
|
398 |
}
|
sl@0
|
399 |
|
sl@0
|
400 |
CleanupStack::PopAndDestroy(output);
|
sl@0
|
401 |
}
|
sl@0
|
402 |
|
sl@0
|
403 |
void CShapeTestStep::shapeText(CBitmapFont* font, CTestData& aTestData, TBool aCheckOutput)
|
sl@0
|
404 |
{
|
sl@0
|
405 |
__UHEAP_MARK;
|
sl@0
|
406 |
TInt heapSizeAtStart = 0;
|
sl@0
|
407 |
User::Heap().AllocSize(heapSizeAtStart);
|
sl@0
|
408 |
|
sl@0
|
409 |
INFO_PRINTF2(_L("Heap memory utilized is now %d\n"), heapSizeAtStart);
|
sl@0
|
410 |
|
sl@0
|
411 |
doShapeText(font, aTestData, aCheckOutput);
|
sl@0
|
412 |
// check the heap used by the shaper
|
sl@0
|
413 |
RHeap* heap = &User::Heap();
|
sl@0
|
414 |
heap->Check();
|
sl@0
|
415 |
TInt heapSizeAtEnd = 0;
|
sl@0
|
416 |
TInt heapCellsUsed = heap->AllocSize(heapSizeAtEnd);
|
sl@0
|
417 |
if (heapCellsUsed)
|
sl@0
|
418 |
{
|
sl@0
|
419 |
INFO_PRINTF2(_L("This test leaked %d\n"), heapSizeAtEnd - heapSizeAtStart);
|
sl@0
|
420 |
}
|
sl@0
|
421 |
__UHEAP_MARKEND;
|
sl@0
|
422 |
}
|
sl@0
|
423 |
|
sl@0
|
424 |
/**
|
sl@0
|
425 |
@file
|
sl@0
|
426 |
@SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1480
|
sl@0
|
427 |
@SYMTestCaseDesc Simple OOM test of shaper
|
sl@0
|
428 |
@SYMTestPriority High
|
sl@0
|
429 |
@SYMTestActions OOM testing for the shaper. Also ensures no leaks.
|
sl@0
|
430 |
@SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
|
sl@0
|
431 |
@SYMPREQ PREQ18
|
sl@0
|
432 |
*/
|
sl@0
|
433 |
void CShapeTestStep::oomShapeText(CBitmapFont* font, CTestData& aTestData)
|
sl@0
|
434 |
{
|
sl@0
|
435 |
__UHEAP_MARK;
|
sl@0
|
436 |
INFO_PRINTF1(_L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1480 "));
|
sl@0
|
437 |
doOomShapeText(font,aTestData);
|
sl@0
|
438 |
__UHEAP_MARKEND;
|
sl@0
|
439 |
}
|
sl@0
|
440 |
|
sl@0
|
441 |
void CShapeTestStep::doOomShapeText(CBitmapFont* font, CTestData& aTestData)
|
sl@0
|
442 |
{
|
sl@0
|
443 |
TInt count = 0;
|
sl@0
|
444 |
TInt err = KErrNone;
|
sl@0
|
445 |
TInt heapCellsUsed, heapSizeAtEnd, heapSizeAtStart;
|
sl@0
|
446 |
CShaper* theShaper = NULL;
|
sl@0
|
447 |
CShaperFactory* shaperFactory = NULL;
|
sl@0
|
448 |
TShapeHeader* output = NULL;
|
sl@0
|
449 |
|
sl@0
|
450 |
User::Heap().AllocSize(heapSizeAtStart);
|
sl@0
|
451 |
|
sl@0
|
452 |
// create the data to be shaped
|
sl@0
|
453 |
CShaper::TInput input;
|
sl@0
|
454 |
input.iText = aTestData.iTextInput;
|
sl@0
|
455 |
input.iStart = aTestData.iStart;
|
sl@0
|
456 |
input.iEnd = aTestData.iEnd;
|
sl@0
|
457 |
|
sl@0
|
458 |
//set up shaper, shape, delete shaper in oom loop
|
sl@0
|
459 |
RImplInfoPtrArray implementationArray;
|
sl@0
|
460 |
TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray);
|
sl@0
|
461 |
CleanupStack::PushL(cleanup);
|
sl@0
|
462 |
TInt error;
|
sl@0
|
463 |
TInt ecomerror;
|
sl@0
|
464 |
TInt ecomnotready;
|
sl@0
|
465 |
TUid uid = {KUidShaperFactoryPlunginInterface};
|
sl@0
|
466 |
|
sl@0
|
467 |
// Making sure that no race situation arises between FBserv and Ecom
|
sl@0
|
468 |
// If ECom is not ready, give it another chance and try again. if it still doesn't work
|
sl@0
|
469 |
// after the third try, then it just carries on quietly and fails...
|
sl@0
|
470 |
for (ecomnotready =0; ecomnotready <3; ecomnotready++)
|
sl@0
|
471 |
{
|
sl@0
|
472 |
|
sl@0
|
473 |
TRAP(ecomerror,REComSession::ListImplementationsL(uid,implementationArray));
|
sl@0
|
474 |
if (!ecomerror)
|
sl@0
|
475 |
{
|
sl@0
|
476 |
break;
|
sl@0
|
477 |
}
|
sl@0
|
478 |
else
|
sl@0
|
479 |
{
|
sl@0
|
480 |
ecomerror = 0;
|
sl@0
|
481 |
User::After(0);
|
sl@0
|
482 |
}
|
sl@0
|
483 |
}
|
sl@0
|
484 |
|
sl@0
|
485 |
const TInt availCount = implementationArray.Count();
|
sl@0
|
486 |
for (TInt count=0;count<availCount;++count)
|
sl@0
|
487 |
{
|
sl@0
|
488 |
const CImplementationInformation* info = implementationArray[count];
|
sl@0
|
489 |
TUid shaperFactoryUid = info->ImplementationUid();
|
sl@0
|
490 |
// Create a shaper factory
|
sl@0
|
491 |
//CShaperFactory* shaperFactory = 0;
|
sl@0
|
492 |
TRAP(error,shaperFactory = CShaperFactory::NewL(shaperFactoryUid));
|
sl@0
|
493 |
test(error == KErrNone);
|
sl@0
|
494 |
//CleanupStack::PushL(shaperFactory);
|
sl@0
|
495 |
}
|
sl@0
|
496 |
CleanupStack::PopAndDestroy(&implementationArray);
|
sl@0
|
497 |
|
sl@0
|
498 |
do
|
sl@0
|
499 |
{
|
sl@0
|
500 |
count += 1;
|
sl@0
|
501 |
__UHEAP_FAILNEXT(count);
|
sl@0
|
502 |
|
sl@0
|
503 |
// Create a shaper
|
sl@0
|
504 |
TRAPD(err, theShaper = shaperFactory->NewShaperL(font, iScript, iLang, &User::Heap()));
|
sl@0
|
505 |
|
sl@0
|
506 |
//shape text
|
sl@0
|
507 |
if (theShaper)
|
sl@0
|
508 |
{
|
sl@0
|
509 |
err = theShaper->ShapeText(output, input, &User::Heap());
|
sl@0
|
510 |
TEST(err == KErrNone);
|
sl@0
|
511 |
}
|
sl@0
|
512 |
|
sl@0
|
513 |
//free output; to be done by the caller of ShapeText
|
sl@0
|
514 |
delete output;
|
sl@0
|
515 |
output = NULL;
|
sl@0
|
516 |
|
sl@0
|
517 |
//does not check the output for now
|
sl@0
|
518 |
delete theShaper;
|
sl@0
|
519 |
delete shaperFactory;
|
sl@0
|
520 |
REComSession::FinalClose();
|
sl@0
|
521 |
|
sl@0
|
522 |
}while ((err==KErrNoMemory)||(err==KErrGeneral));
|
sl@0
|
523 |
__UHEAP_RESET;
|
sl@0
|
524 |
|
sl@0
|
525 |
// check the heap used by the shaper
|
sl@0
|
526 |
RHeap* heap = &User::Heap();
|
sl@0
|
527 |
heap->Check();
|
sl@0
|
528 |
heapCellsUsed = heap->AllocSize(heapSizeAtEnd);
|
sl@0
|
529 |
if (heapCellsUsed)
|
sl@0
|
530 |
{
|
sl@0
|
531 |
INFO_PRINTF2(_L("This test leaked %d.\n"), heapSizeAtEnd - heapSizeAtStart);
|
sl@0
|
532 |
}
|
sl@0
|
533 |
}
|
sl@0
|
534 |
|
sl@0
|
535 |
/**
|
sl@0
|
536 |
@file
|
sl@0
|
537 |
@SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1481
|
sl@0
|
538 |
@SYMTestCaseDesc Tests that the shaper can handle multiple calls to ShapeText
|
sl@0
|
539 |
@SYMTestPriority High
|
sl@0
|
540 |
@SYMTestActions Makes multiple calls to CShaper::ShapeText with small amounts of text to be shaped
|
sl@0
|
541 |
@SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
|
sl@0
|
542 |
@SYMPREQ PREQ18
|
sl@0
|
543 |
*/
|
sl@0
|
544 |
void CShapeTestStep::repeatShapeText(CBitmapFont* aFont, CTestData& aTestData)
|
sl@0
|
545 |
{
|
sl@0
|
546 |
__UHEAP_MARK;
|
sl@0
|
547 |
INFO_PRINTF1(_L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-1481 "));
|
sl@0
|
548 |
doRepeatShapeText(aFont, aTestData);
|
sl@0
|
549 |
__UHEAP_MARKEND;
|
sl@0
|
550 |
}
|
sl@0
|
551 |
|
sl@0
|
552 |
void CShapeTestStep::doRepeatShapeText(CBitmapFont* font, CTestData& aTestData)
|
sl@0
|
553 |
{
|
sl@0
|
554 |
//set up the shaper
|
sl@0
|
555 |
CShaper* theShaper = NULL;
|
sl@0
|
556 |
CShaperFactory* shaperFactory = NULL;
|
sl@0
|
557 |
|
sl@0
|
558 |
RImplInfoPtrArray implementationArray;
|
sl@0
|
559 |
TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray);
|
sl@0
|
560 |
CleanupStack::PushL(cleanup);
|
sl@0
|
561 |
|
sl@0
|
562 |
TInt ecomerror;
|
sl@0
|
563 |
TInt ecomnotready;
|
sl@0
|
564 |
TUid uid = {KUidShaperFactoryPlunginInterface};
|
sl@0
|
565 |
|
sl@0
|
566 |
// Making sure that no race situation arises between FBserv and Ecom
|
sl@0
|
567 |
// If ECom is not ready, give it another chance and try again. if it still doesn't work
|
sl@0
|
568 |
// after the third try, then it just carries on quietly and fails...
|
sl@0
|
569 |
for (ecomnotready =0; ecomnotready <3; ecomnotready++)
|
sl@0
|
570 |
{
|
sl@0
|
571 |
|
sl@0
|
572 |
TRAP(ecomerror,REComSession::ListImplementationsL(uid,implementationArray));
|
sl@0
|
573 |
if (!ecomerror)
|
sl@0
|
574 |
{
|
sl@0
|
575 |
break;
|
sl@0
|
576 |
}
|
sl@0
|
577 |
else
|
sl@0
|
578 |
{
|
sl@0
|
579 |
ecomerror = 0;
|
sl@0
|
580 |
User::After(0);
|
sl@0
|
581 |
}
|
sl@0
|
582 |
}
|
sl@0
|
583 |
|
sl@0
|
584 |
const TInt availCount = implementationArray.Count();
|
sl@0
|
585 |
for (TInt count=0;count<availCount;++count)
|
sl@0
|
586 |
{
|
sl@0
|
587 |
const CImplementationInformation* info = implementationArray[count];
|
sl@0
|
588 |
TUid shaperFactoryUid = info->ImplementationUid();
|
sl@0
|
589 |
// Create a shaper factory
|
sl@0
|
590 |
TInt error;
|
sl@0
|
591 |
TRAP(error,shaperFactory = CShaperFactory::NewL(shaperFactoryUid));
|
sl@0
|
592 |
test(error == KErrNone);
|
sl@0
|
593 |
|
sl@0
|
594 |
// Create a shaper
|
sl@0
|
595 |
TRAP(error, theShaper = shaperFactory->NewShaperL(font, iScript, iLang, &User::Heap()));
|
sl@0
|
596 |
if (error != KErrNone)
|
sl@0
|
597 |
{
|
sl@0
|
598 |
delete shaperFactory;
|
sl@0
|
599 |
shaperFactory = NULL;
|
sl@0
|
600 |
}
|
sl@0
|
601 |
test(error == KErrNone);
|
sl@0
|
602 |
break; // have got valid shaper here
|
sl@0
|
603 |
}
|
sl@0
|
604 |
CleanupStack::PopAndDestroy(&implementationArray);
|
sl@0
|
605 |
|
sl@0
|
606 |
CleanupStack::PushL(shaperFactory);
|
sl@0
|
607 |
CleanupStack::PushL(theShaper);
|
sl@0
|
608 |
|
sl@0
|
609 |
// create the data to be shaped
|
sl@0
|
610 |
// this uses CTestData, defined in testData.h
|
sl@0
|
611 |
CShaper::TInput input;
|
sl@0
|
612 |
input.iText = aTestData.iTextInput;
|
sl@0
|
613 |
|
sl@0
|
614 |
//create shape header, and shape the text
|
sl@0
|
615 |
TShapeHeader* output = NULL;
|
sl@0
|
616 |
|
sl@0
|
617 |
for(TInt i=aTestData.iStart; i<aTestData.iEnd -10; i++)
|
sl@0
|
618 |
{
|
sl@0
|
619 |
//indicate which 10 chars to be shaped
|
sl@0
|
620 |
input.iStart = i;
|
sl@0
|
621 |
input.iEnd = i + 10;
|
sl@0
|
622 |
|
sl@0
|
623 |
//shape text
|
sl@0
|
624 |
TInt err = theShaper->ShapeText(output, input, &User::Heap());
|
sl@0
|
625 |
test(err == KErrNone);
|
sl@0
|
626 |
|
sl@0
|
627 |
//free output; to be done by the caller of ShapeText
|
sl@0
|
628 |
delete(output);
|
sl@0
|
629 |
output = NULL;
|
sl@0
|
630 |
|
sl@0
|
631 |
//does not check the output for now
|
sl@0
|
632 |
}
|
sl@0
|
633 |
|
sl@0
|
634 |
//cleanup the shaper
|
sl@0
|
635 |
CleanupStack::PopAndDestroy(theShaper);
|
sl@0
|
636 |
CleanupStack::PopAndDestroy(shaperFactory);
|
sl@0
|
637 |
REComSession::FinalClose();
|
sl@0
|
638 |
}
|
sl@0
|
639 |
|
sl@0
|
640 |
/*
|
sl@0
|
641 |
@file
|
sl@0
|
642 |
@SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3401
|
sl@0
|
643 |
@SYMTestCaseDesc Tests that the shaper can handle calls to shapeText with multiple font sizes
|
sl@0
|
644 |
@SYMTestPriority High
|
sl@0
|
645 |
@SYMTestActions Makes multiple calls to CShaper::ShapeText with small amounts of text to be shaped and incremental font sizes
|
sl@0
|
646 |
@SYMTestExpectedResults The test must not show a memory leak at any font size
|
sl@0
|
647 |
@SYMPREQ DEF103042: TC_SHAP_shapeText test failing with alloc failure
|
sl@0
|
648 |
**/
|
sl@0
|
649 |
void CShapeTestStep::doRepeatShapeUsingVariousFontSizesTest(CFontStore* aFontStore, const TDesC aTypefaceName, const TDesC &aText1,
|
sl@0
|
650 |
const TDesC &aText2, const TDesC &aText3)
|
sl@0
|
651 |
{
|
sl@0
|
652 |
INFO_PRINTF1(_L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3401 "));
|
sl@0
|
653 |
TInt heapCellsUsed, heapSizeAtEnd, heapSizeAtStart;
|
sl@0
|
654 |
User::Heap().AllocSize(heapSizeAtStart);
|
sl@0
|
655 |
|
sl@0
|
656 |
// Set up shaper factory
|
sl@0
|
657 |
// Set up the shaper
|
sl@0
|
658 |
CShaper* theShaper = NULL;
|
sl@0
|
659 |
CShaperFactory* shaperFactory = NULL;
|
sl@0
|
660 |
|
sl@0
|
661 |
RImplInfoPtrArray implementationArray;
|
sl@0
|
662 |
TCleanupItem cleanup(ResetAndDestroyRImplInfoPtrArray, &implementationArray);
|
sl@0
|
663 |
CleanupStack::PushL(cleanup);
|
sl@0
|
664 |
TInt err;
|
sl@0
|
665 |
TInt ecomerror;
|
sl@0
|
666 |
TInt ecomnotready;
|
sl@0
|
667 |
TUid uid = {KUidShaperFactoryPlunginInterface};
|
sl@0
|
668 |
|
sl@0
|
669 |
// Making sure that no race situation arises between FBserv and Ecom
|
sl@0
|
670 |
// If ECom is not ready, give it another chance and try again. if it still doesn't work
|
sl@0
|
671 |
// after the third try, then it just carries on quietly and fails...
|
sl@0
|
672 |
for (ecomnotready =0; ecomnotready <3; ecomnotready++)
|
sl@0
|
673 |
{
|
sl@0
|
674 |
TRAP(ecomerror,REComSession::ListImplementationsL(uid,implementationArray));
|
sl@0
|
675 |
if (!ecomerror)
|
sl@0
|
676 |
{
|
sl@0
|
677 |
break;
|
sl@0
|
678 |
}
|
sl@0
|
679 |
else
|
sl@0
|
680 |
{
|
sl@0
|
681 |
ecomerror = 0;
|
sl@0
|
682 |
User::After(0);
|
sl@0
|
683 |
}
|
sl@0
|
684 |
}
|
sl@0
|
685 |
|
sl@0
|
686 |
const TInt availCount = implementationArray.Count();
|
sl@0
|
687 |
for (TInt count=0;count<availCount;++count)
|
sl@0
|
688 |
{
|
sl@0
|
689 |
const CImplementationInformation* info = implementationArray[count];
|
sl@0
|
690 |
TUid shaperFactoryUid = info->ImplementationUid();
|
sl@0
|
691 |
// Create a shaper factory
|
sl@0
|
692 |
TRAPD(error,shaperFactory = CShaperFactory::NewL(shaperFactoryUid));
|
sl@0
|
693 |
test(error == KErrNone);
|
sl@0
|
694 |
}
|
sl@0
|
695 |
|
sl@0
|
696 |
CleanupStack::PopAndDestroy(&implementationArray);
|
sl@0
|
697 |
|
sl@0
|
698 |
CleanupStack::PushL(shaperFactory);
|
sl@0
|
699 |
|
sl@0
|
700 |
// create the data to be shaped
|
sl@0
|
701 |
// this explicitely uses hindiTestData, defined in testData.h
|
sl@0
|
702 |
CShaper::TInput input;
|
sl@0
|
703 |
input.iStart = 0;
|
sl@0
|
704 |
|
sl@0
|
705 |
//create shape header, and shape the text
|
sl@0
|
706 |
TShapeHeader* output = NULL;
|
sl@0
|
707 |
|
sl@0
|
708 |
CBitmapFont* font;
|
sl@0
|
709 |
|
sl@0
|
710 |
// Test shaping for the Hindi texts for various font sizes
|
sl@0
|
711 |
INFO_PRINTF1(_L("Generating a random initial font size between 0 and 1 for this test\n"));
|
sl@0
|
712 |
TInt random = (Math::Random()>>11)%2;
|
sl@0
|
713 |
INFO_PRINTF2(_L("Random initial font size is %d. Testing upto size 300 with increments of 2\n"), random);
|
sl@0
|
714 |
for (TInt i = random; i <= 300; i+=2)
|
sl@0
|
715 |
{
|
sl@0
|
716 |
INFO_PRINTF2(_L("Font Size: %d\n"), i);
|
sl@0
|
717 |
if (i == 294 || i == 295)
|
sl@0
|
718 |
{
|
sl@0
|
719 |
INFO_PRINTF2(_L("Font Size: %d\n"), i);
|
sl@0
|
720 |
}
|
sl@0
|
721 |
TFontSpec fontSpec(aTypefaceName,i*20);
|
sl@0
|
722 |
aFontStore->GetNearestFontInTwips((CFont*&)font, fontSpec);
|
sl@0
|
723 |
CleanupStack::PushL(font);
|
sl@0
|
724 |
|
sl@0
|
725 |
TRAP(err, theShaper = shaperFactory->NewShaperL(font, iScript, iLang, &User::Heap()));
|
sl@0
|
726 |
test(err == KErrNone);
|
sl@0
|
727 |
CleanupStack::PushL(theShaper);
|
sl@0
|
728 |
|
sl@0
|
729 |
// Call the shaper twice because the first time the rasterizer uses memory to cache the tables
|
sl@0
|
730 |
// We can then check the heap in the second call
|
sl@0
|
731 |
input.iText = &aText1;
|
sl@0
|
732 |
input.iEnd = aText1.Length();
|
sl@0
|
733 |
err = theShaper->ShapeText(output, input, &User::Heap());
|
sl@0
|
734 |
delete output;
|
sl@0
|
735 |
TEST(err == KErrNone);
|
sl@0
|
736 |
__UHEAP_MARK;
|
sl@0
|
737 |
err = theShaper->ShapeText(output, input, &User::Heap());
|
sl@0
|
738 |
delete output;
|
sl@0
|
739 |
__UHEAP_MARKEND;
|
sl@0
|
740 |
TEST(err == KErrNone);
|
sl@0
|
741 |
|
sl@0
|
742 |
input.iText = &aText2;
|
sl@0
|
743 |
input.iEnd = aText2.Length();
|
sl@0
|
744 |
err = theShaper->ShapeText(output, input, &User::Heap());
|
sl@0
|
745 |
delete output;
|
sl@0
|
746 |
TEST(err == KErrNone);
|
sl@0
|
747 |
__UHEAP_MARK;
|
sl@0
|
748 |
err = theShaper->ShapeText(output, input, &User::Heap());
|
sl@0
|
749 |
delete output;
|
sl@0
|
750 |
__UHEAP_MARKEND;
|
sl@0
|
751 |
TEST(err == KErrNone);
|
sl@0
|
752 |
|
sl@0
|
753 |
input.iText = &aText3;
|
sl@0
|
754 |
input.iEnd = aText3.Length();
|
sl@0
|
755 |
err = theShaper->ShapeText(output, input, &User::Heap());
|
sl@0
|
756 |
delete output;
|
sl@0
|
757 |
TEST(err == KErrNone);
|
sl@0
|
758 |
// __UHEAP_MARK;
|
sl@0
|
759 |
err = theShaper->ShapeText(output, input, &User::Heap());
|
sl@0
|
760 |
delete output;
|
sl@0
|
761 |
// __UHEAP_MARKEND;
|
sl@0
|
762 |
TEST(err == KErrNone);
|
sl@0
|
763 |
|
sl@0
|
764 |
CleanupStack::PopAndDestroy(theShaper);
|
sl@0
|
765 |
CleanupStack::Pop(font);
|
sl@0
|
766 |
aFontStore->ReleaseFont(font);
|
sl@0
|
767 |
}
|
sl@0
|
768 |
|
sl@0
|
769 |
CleanupStack::PopAndDestroy(shaperFactory);
|
sl@0
|
770 |
|
sl@0
|
771 |
//close the ecom session opened by LoadOpenFontLibraries()
|
sl@0
|
772 |
REComSession::FinalClose();
|
sl@0
|
773 |
|
sl@0
|
774 |
// check the heap used by the shaper
|
sl@0
|
775 |
RHeap* heap = &User::Heap();
|
sl@0
|
776 |
heap->Check();
|
sl@0
|
777 |
heapCellsUsed = heap->AllocSize(heapSizeAtEnd);
|
sl@0
|
778 |
if (heapCellsUsed)
|
sl@0
|
779 |
{
|
sl@0
|
780 |
INFO_PRINTF2(_L("This test utilised %d bytes\n"), heapSizeAtEnd - heapSizeAtStart);
|
sl@0
|
781 |
}
|
sl@0
|
782 |
}
|
sl@0
|
783 |
|
sl@0
|
784 |
/**
|
sl@0
|
785 |
@file
|
sl@0
|
786 |
@SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3403
|
sl@0
|
787 |
@SYMTestCaseDesc Tests the shaper using Devanagari Unicode. Test include OOM tests (oomShapeText), repeated
|
sl@0
|
788 |
calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
|
sl@0
|
789 |
calling the shaper with incremental font sizes.
|
sl@0
|
790 |
@SYMTestPriority High
|
sl@0
|
791 |
@SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
|
sl@0
|
792 |
@SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
|
sl@0
|
793 |
@SYMPREQ PREQ19
|
sl@0
|
794 |
*/
|
sl@0
|
795 |
/**
|
sl@0
|
796 |
@file
|
sl@0
|
797 |
@SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3383-0001
|
sl@0
|
798 |
@SYMTestCaseDesc Tests the shaper using Kannada Unicode. Test include OOM tests (oomShapeText), repeated
|
sl@0
|
799 |
calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
|
sl@0
|
800 |
calling the shaper with incremental font sizes.
|
sl@0
|
801 |
@SYMTestPriority High
|
sl@0
|
802 |
@SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
|
sl@0
|
803 |
@SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
|
sl@0
|
804 |
@SYMPREQ PREQ19
|
sl@0
|
805 |
*/
|
sl@0
|
806 |
/**
|
sl@0
|
807 |
@file
|
sl@0
|
808 |
@SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3383-0002
|
sl@0
|
809 |
@SYMTestCaseDesc Tests the shaper using Gujarati Unicode. Test include OOM tests (oomShapeText), repeated
|
sl@0
|
810 |
calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
|
sl@0
|
811 |
calling the shaper with incremental font sizes.
|
sl@0
|
812 |
@SYMTestPriority High
|
sl@0
|
813 |
@SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
|
sl@0
|
814 |
@SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
|
sl@0
|
815 |
@SYMPREQ PREQ19
|
sl@0
|
816 |
*/
|
sl@0
|
817 |
/**
|
sl@0
|
818 |
@file
|
sl@0
|
819 |
@SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4001
|
sl@0
|
820 |
@SYMTestCaseDesc Tests the shaper using Bengali Unicode. Test include OOM tests (oomShapeText), repeated
|
sl@0
|
821 |
calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
|
sl@0
|
822 |
calling the shaper with incremental font sizes.
|
sl@0
|
823 |
@SYMTestPriority High
|
sl@0
|
824 |
@SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
|
sl@0
|
825 |
@SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
|
sl@0
|
826 |
@SYMPREQ PREQ1766
|
sl@0
|
827 |
@SYMREQ REQ8741
|
sl@0
|
828 |
*/
|
sl@0
|
829 |
/**
|
sl@0
|
830 |
@file
|
sl@0
|
831 |
@SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4002
|
sl@0
|
832 |
@SYMTestCaseDesc Tests the shaper using Tamil Unicode. Test include OOM tests (oomShapeText), repeated
|
sl@0
|
833 |
calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
|
sl@0
|
834 |
calling the shaper with incremental font sizes.
|
sl@0
|
835 |
@SYMTestPriority High
|
sl@0
|
836 |
@SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
|
sl@0
|
837 |
@SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
|
sl@0
|
838 |
@SYMPREQ PREQ1766
|
sl@0
|
839 |
@SYMREQ REQ8742
|
sl@0
|
840 |
*/
|
sl@0
|
841 |
/**
|
sl@0
|
842 |
@file
|
sl@0
|
843 |
@SYMTestCaseID GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4003
|
sl@0
|
844 |
@SYMTestCaseDesc Tests the shaper using Telugu Unicode. Test include OOM tests (oomShapeText), repeated
|
sl@0
|
845 |
calls to the shaper (repeatShapeText), simple shaping tests (shapeText), and repeatedly
|
sl@0
|
846 |
calling the shaper with incremental font sizes.
|
sl@0
|
847 |
@SYMTestPriority High
|
sl@0
|
848 |
@SYMTestActions Performs various tests of the the shaper, calling CShaper::ShapeText in various use cases
|
sl@0
|
849 |
@SYMTestExpectedResults The test must exit cleanly and there should not be any User:84 errors, KERN-EXEC's or any memory leaks.
|
sl@0
|
850 |
@SYMPREQ PREQ1766
|
sl@0
|
851 |
@SYMREQ REQ8743
|
sl@0
|
852 |
*/
|
sl@0
|
853 |
/**
|
sl@0
|
854 |
@SYMTestCaseID GRAPHICS-TI18N-ICULAYOUTENGINE-CT-4007
|
sl@0
|
855 |
@SYMTestCaseDesc Case to do Gurmukhi component test
|
sl@0
|
856 |
It covers all Iculayout components cases
|
sl@0
|
857 |
@SYMTestPriority High
|
sl@0
|
858 |
@SYMTestActions Iterate Gurmukhi test data, each test data corresponds with a case
|
sl@0
|
859 |
@SYMTestExpectedResults No error returned
|
sl@0
|
860 |
@SYMPREQ 1922: Gurmukhi support
|
sl@0
|
861 |
*/
|
sl@0
|
862 |
/**
|
sl@0
|
863 |
@SYMTestCaseID GRAPHICS-TI18N-ICULAYOUTENGINE-CT-4008
|
sl@0
|
864 |
@SYMTestCaseDesc Case to do Malayalam component test
|
sl@0
|
865 |
It covers all Iculayout components cases
|
sl@0
|
866 |
@SYMTestPriority High
|
sl@0
|
867 |
@SYMTestActions Iterate Malayalam test data, each test data corresponds with a case
|
sl@0
|
868 |
@SYMTestExpectedResults No error returned
|
sl@0
|
869 |
@SYMPREQ 1922: Malayalam support
|
sl@0
|
870 |
*/
|
sl@0
|
871 |
void CShapeTestStep::ShapeTestL()
|
sl@0
|
872 |
{
|
sl@0
|
873 |
INFO_PRINTF1(iTestID);
|
sl@0
|
874 |
|
sl@0
|
875 |
CBitmapFont* font;
|
sl@0
|
876 |
TInt err=KErrNone;
|
sl@0
|
877 |
//the font store can use the normal user heap
|
sl@0
|
878 |
CFontStore* fontStore = CFontStore::NewL(&User::Heap());
|
sl@0
|
879 |
fontStore->iKPixelWidthInTwips = 11860;
|
sl@0
|
880 |
fontStore->iKPixelHeightInTwips = 11860;
|
sl@0
|
881 |
CleanupStack::PushL(fontStore);
|
sl@0
|
882 |
|
sl@0
|
883 |
//load all ecom implemented rasterizer dlls. installs the rasterizer.
|
sl@0
|
884 |
LoadOpenFontLibraries(fontStore);
|
sl@0
|
885 |
|
sl@0
|
886 |
//add the required font file
|
sl@0
|
887 |
TRAP(err,fontStore->AddFileL(iTestDataArr[iTestDataIndex]->iFilename));
|
sl@0
|
888 |
test(err == KErrNone);
|
sl@0
|
889 |
|
sl@0
|
890 |
|
sl@0
|
891 |
//run all tests for TNR_Dev_OT test, which is at position 0 in the aTestDataArr
|
sl@0
|
892 |
TFontSpec fontSpec(iTestDataArr[iTestDataIndex]->iTypeFaceName,12);
|
sl@0
|
893 |
fontStore->GetNearestFontToDesignHeightInPixels((CFont*&)font, fontSpec);
|
sl@0
|
894 |
CleanupStack::PushL(font);
|
sl@0
|
895 |
|
sl@0
|
896 |
INFO_PRINTF2(_L("Repeat %S text shaping test\n"), &iScriptName);
|
sl@0
|
897 |
doRepeatShapeText(font, *iTestDataArr[iTestDataIndex]);
|
sl@0
|
898 |
repeatShapeText(font, *iTestDataArr[iTestDataIndex]);
|
sl@0
|
899 |
|
sl@0
|
900 |
INFO_PRINTF2(_L("OOM %S text shaping test\n"), &iScriptName);
|
sl@0
|
901 |
#if defined(_DEBUG)
|
sl@0
|
902 |
doOomShapeText(font, *iTestDataArr[iTestDataIndex]);
|
sl@0
|
903 |
oomShapeText(font, *iTestDataArr[iTestDataIndex]);
|
sl@0
|
904 |
#else
|
sl@0
|
905 |
INFO_PRINTF1(_L("This test is ignored for release version\n"));
|
sl@0
|
906 |
#endif
|
sl@0
|
907 |
|
sl@0
|
908 |
INFO_PRINTF2(_L("Run simple %S shape test\n"), &iScriptName);
|
sl@0
|
909 |
doShapeText(font, *iTestDataArr[iTestDataIndex], ETrue);
|
sl@0
|
910 |
shapeText(font, *iTestDataArr[iTestDataIndex], ETrue);
|
sl@0
|
911 |
|
sl@0
|
912 |
CleanupStack::Pop(font);
|
sl@0
|
913 |
fontStore->ReleaseFont(font);
|
sl@0
|
914 |
|
sl@0
|
915 |
//for any other test data we have, run the simple shape text test only
|
sl@0
|
916 |
for(TInt i=iTestDataIndex+1; i<iTestDataIndex+iNumberOfTestDataFiles; i++)
|
sl@0
|
917 |
{
|
sl@0
|
918 |
TFontSpec fontSpec(iTestDataArr[i]->iTypeFaceName,12);
|
sl@0
|
919 |
fontStore->GetNearestFontToDesignHeightInPixels((CFont*&)font, fontSpec);
|
sl@0
|
920 |
CleanupStack::PushL(font);
|
sl@0
|
921 |
|
sl@0
|
922 |
// First run does not check heap... this ensures that any memory
|
sl@0
|
923 |
// stashed by the rasterizer does not show up as a leak.
|
sl@0
|
924 |
doShapeText(font, *iTestDataArr[i], ETrue);
|
sl@0
|
925 |
shapeText(font, *iTestDataArr[i], ETrue);
|
sl@0
|
926 |
|
sl@0
|
927 |
CleanupStack::Pop(font);
|
sl@0
|
928 |
fontStore->ReleaseFont(font);
|
sl@0
|
929 |
}
|
sl@0
|
930 |
|
sl@0
|
931 |
// Now do the last test, the shaping test using various font sizes
|
sl@0
|
932 |
INFO_PRINTF2(_L("Repeat %S shaping test using font sizes 20 to 6000\n"), &iScriptName);
|
sl@0
|
933 |
if(iScriptName == KTestStep_Hindi)
|
sl@0
|
934 |
{
|
sl@0
|
935 |
doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KHindi1, KHindi2, KHindi3);
|
sl@0
|
936 |
}
|
sl@0
|
937 |
else if(iScriptName == KTestStep_Kannada)
|
sl@0
|
938 |
{
|
sl@0
|
939 |
doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KKannada1, KKannada2, KKannada3);
|
sl@0
|
940 |
}
|
sl@0
|
941 |
else if(iScriptName == KTestStep_Gujarati)
|
sl@0
|
942 |
{
|
sl@0
|
943 |
doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KGujarati1, KGujarati2, KGujarati3);
|
sl@0
|
944 |
}
|
sl@0
|
945 |
else if(iScriptName == KTestStep_Bengali)
|
sl@0
|
946 |
{
|
sl@0
|
947 |
doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KBengali1, KBengali2, KBengali3);
|
sl@0
|
948 |
}
|
sl@0
|
949 |
else if(iScriptName == KTestStep_Tamil)
|
sl@0
|
950 |
{
|
sl@0
|
951 |
doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KTamil1, KTamil2, KTamil3);
|
sl@0
|
952 |
}
|
sl@0
|
953 |
else if(iScriptName == KTestStep_Telugu)
|
sl@0
|
954 |
{
|
sl@0
|
955 |
doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KTelugu1, KTelugu2, KTelugu3);
|
sl@0
|
956 |
}
|
sl@0
|
957 |
else if(iScriptName == KTestStep_Gurmukhi)
|
sl@0
|
958 |
{
|
sl@0
|
959 |
doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KGurmukhi1, KGurmukhi2, KGurmukhi3);
|
sl@0
|
960 |
}
|
sl@0
|
961 |
else if(iScriptName == KTestStep_Malayalam)
|
sl@0
|
962 |
{
|
sl@0
|
963 |
doRepeatShapeUsingVariousFontSizesTest(fontStore, iTestDataArr[0]->iTypeFaceName, KMalayalam1, KMalayalam2, KMalayalam3);
|
sl@0
|
964 |
}
|
sl@0
|
965 |
|
sl@0
|
966 |
CleanupStack::PopAndDestroy(fontStore);
|
sl@0
|
967 |
REComSession::FinalClose(); //close the ecom session opened by LoadOpenFontLibraries()
|
sl@0
|
968 |
}
|
sl@0
|
969 |
|
sl@0
|
970 |
TVerdict CShapeTestStep::doTestStepL()
|
sl@0
|
971 |
{
|
sl@0
|
972 |
SetTestStepResult(EFail);
|
sl@0
|
973 |
|
sl@0
|
974 |
__UHEAP_MARK;
|
sl@0
|
975 |
|
sl@0
|
976 |
TRAPD(error0, SetupTestDataL());
|
sl@0
|
977 |
|
sl@0
|
978 |
if(error0 == KErrNone)
|
sl@0
|
979 |
{
|
sl@0
|
980 |
TRAPD(error1, ShapeTestL());
|
sl@0
|
981 |
|
sl@0
|
982 |
if(error1 == KErrNone)
|
sl@0
|
983 |
{
|
sl@0
|
984 |
SetTestStepResult(EPass);
|
sl@0
|
985 |
}
|
sl@0
|
986 |
}
|
sl@0
|
987 |
else
|
sl@0
|
988 |
{
|
sl@0
|
989 |
ERR_PRINTF1(_L("Failed to setup test data."));
|
sl@0
|
990 |
}
|
sl@0
|
991 |
|
sl@0
|
992 |
iTestDataArr.ResetAndDestroy(); // close the iTestDataArr opened by SetupTestData()
|
sl@0
|
993 |
|
sl@0
|
994 |
__UHEAP_MARKEND;
|
sl@0
|
995 |
|
sl@0
|
996 |
return TestStepResult();
|
sl@0
|
997 |
}
|
sl@0
|
998 |
|
sl@0
|
999 |
CTestStep * CShapeTestStep::CreateShapeTestStep(const TDesC& aStepName)
|
sl@0
|
1000 |
{
|
sl@0
|
1001 |
if(aStepName == KTestStep_Hindi)
|
sl@0
|
1002 |
{
|
sl@0
|
1003 |
return new CShapeTestStep(KHindiTestDataIndex, KNumberOfHindiTestDataFiles, KDevanagariScriptCode, KHindiLanguageCode,
|
sl@0
|
1004 |
aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3403 "));
|
sl@0
|
1005 |
}
|
sl@0
|
1006 |
else if(aStepName == KTestStep_Kannada)
|
sl@0
|
1007 |
{
|
sl@0
|
1008 |
return new CShapeTestStep(KKannadaTestDataIndex, KNumberOfKannadaTestDataFiles, KKannadaScriptCode, KKannadaLanguageCode,
|
sl@0
|
1009 |
aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3383-0001"));
|
sl@0
|
1010 |
}
|
sl@0
|
1011 |
else if(aStepName == KTestStep_Gujarati)
|
sl@0
|
1012 |
{
|
sl@0
|
1013 |
return new CShapeTestStep(KGujaratiTestDataIndex, KNumberOfGujaratiTestDataFiles, KGujaratiScriptCode, KGujaratiLanguageCode,
|
sl@0
|
1014 |
aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-3383-0002"));
|
sl@0
|
1015 |
}
|
sl@0
|
1016 |
else if(aStepName == KTestStep_Bengali)
|
sl@0
|
1017 |
{
|
sl@0
|
1018 |
return new CShapeTestStep(KBengaliTestDataIndex, KNumberOfBengaliTestDataFiles, KBengaliScriptCode, KBengaliLanguageCode,
|
sl@0
|
1019 |
aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4001"));
|
sl@0
|
1020 |
}
|
sl@0
|
1021 |
else if(aStepName == KTestStep_Tamil)
|
sl@0
|
1022 |
{
|
sl@0
|
1023 |
return new CShapeTestStep(KTamilTestDataIndex, KNumberOfTamilTestDataFiles, KTamilScriptCode, KTamilLanguageCode,
|
sl@0
|
1024 |
aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4002"));
|
sl@0
|
1025 |
}
|
sl@0
|
1026 |
else if(aStepName == KTestStep_Telugu)
|
sl@0
|
1027 |
{
|
sl@0
|
1028 |
return new CShapeTestStep(KTeluguTestDataIndex, KNumberOfTeluguTestDataFiles, KTeluguScriptCode, KTeluguLanguageCode,
|
sl@0
|
1029 |
aStepName, _L("GRAPHICS-SYSLIB-ICULAYOUTENGINE-CT-4003"));
|
sl@0
|
1030 |
}
|
sl@0
|
1031 |
else if(aStepName == KTestStep_Gurmukhi)
|
sl@0
|
1032 |
{
|
sl@0
|
1033 |
return new CShapeTestStep(KGurmukhiTestDataIndex, KNumberOfGurmukhiTestDataFiles, KGurmukhiScriptCode, KGurmukhiLanguageCode,
|
sl@0
|
1034 |
aStepName, _L("GRAPHICS-TI18N-ICULAYOUTENGINE-CT-4007"));
|
sl@0
|
1035 |
}
|
sl@0
|
1036 |
else if(aStepName == KTestStep_Malayalam)
|
sl@0
|
1037 |
{
|
sl@0
|
1038 |
return new CShapeTestStep(KMalayalamTestDataIndex, KNumberOfMalayalamTestDataFiles, KMalayalamScriptCode, KMalayalamLanguageCode,
|
sl@0
|
1039 |
aStepName, _L("GRAPHICS-TI18N-ICULAYOUTENGINE-CT-4007"));
|
sl@0
|
1040 |
}
|
sl@0
|
1041 |
return NULL;
|
sl@0
|
1042 |
}
|