author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 31 Aug 2010 16:34:26 +0300 | |
branch | RCL_3 |
changeset 43 | c1f20ce4abcf |
parent 0 | a41df078684a |
child 44 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// e32test\buffer\t_farray.cpp |
|
15 |
// Overview: |
|
16 |
// Test the functionality of CArrayFixFlat, CArrayPtrFlat, CArrayFixSeg classes. |
|
17 |
// API Information: |
|
18 |
// CArrayFixFlat, CArrayPtrFlat, CArrayFixSeg. |
|
19 |
// Details: |
|
20 |
// - Create an array of fixed length buffer descriptor objects contained within a flat |
|
21 |
// dynamic and segmented buffer and verify that |
|
22 |
// - number of elements held in the array is 0. |
|
23 |
// - length of an element is as specified. |
|
24 |
// - array is compressed and reset as expected. |
|
25 |
// - the elements of the array are sorted as expected. |
|
26 |
// - insertion of a text into the array at specified position and filling a blank space |
|
27 |
// at the beginning is as expected. |
|
28 |
// - return value is 0 when available element is searched within the array. |
|
29 |
// - removal of first element from the array is successful. |
|
30 |
// - number of elements held in the array is 1 after appending a single element onto |
|
31 |
// the end of the array. |
|
32 |
// - the position of specified element is found successfully |
|
33 |
// - resetting the array is as expected |
|
34 |
// - End and Back methods are as expected. |
|
35 |
// - Create an array of fixed length text character objects contained within a flat dynamic |
|
36 |
// and segmented buffer. |
|
37 |
// - append a text onto the end of the array, check the contents and number of elements |
|
38 |
// held in the array are as expected. |
|
39 |
// - insert a text and verify that the change in the content of array and number of |
|
40 |
// elements held in the array are as expected. |
|
41 |
// - remove a single character and multiple characters from the array and verify that |
|
42 |
// the Delete method is as expected. Compress the array. |
|
43 |
// - Create an array of fixed length text character objects contained within a flat dynamic |
|
44 |
// and segmented buffer. |
|
45 |
// - append strings of specified length onto the end of the array and verify that the |
|
46 |
// number of elements held in the array is as expected. |
|
47 |
// - insert strings at specified location and check that the contents are as expected. |
|
48 |
// - reset the array, append a string, compress the array and verify that content is as |
|
49 |
// expected. |
|
50 |
// - sort the array and verify that content is as expected. |
|
51 |
// - verify the correct position of the element and return value is zero when an element |
|
52 |
// is found using binary and sequential search technique and nonzero if not present in |
|
53 |
// the array. |
|
54 |
// - Create an array of fixed length text character objects contained within a flat dynamic |
|
55 |
// and segmented buffer. |
|
56 |
// - Insert some elements into the array at specified positions determined by key of |
|
57 |
// type TInt and verify that KErrAlreadyExists is returned if an element with the |
|
58 |
// same key already exists within the array. |
|
59 |
// - Create an array of pointers to objects implemented using a flat dynamic buffer, insert one |
|
60 |
// element into the array at the specified position and destroy the object whose pointer form |
|
61 |
// the element of the array, before resetting the array. |
|
62 |
// - Create and delete an array of CBase objects contained within a flat dynamic buffer. |
|
63 |
// - Test whether the heap has been corrupted by all the tests. |
|
64 |
// Platforms/Drives/Compatibility: |
|
65 |
// All |
|
66 |
// Assumptions/Requirement/Pre-requisites: |
|
67 |
// Failures and causes: |
|
68 |
// Base Port information: |
|
69 |
// |
|
70 |
// |
|
71 |
||
72 |
#include <e32test.h> |
|
73 |
||
74 |
class MyCBase : public CBase |
|
75 |
{ |
|
76 |
}; |
|
77 |
||
78 |
const TInt KTestGranularity=0x02; |
|
79 |
||
80 |
LOCAL_D RTest test(_L("T_FARRAY")); |
|
81 |
||
82 |
template <class T,TInt S> |
|
83 |
class TArr |
|
84 |
{ |
|
85 |
public: |
|
86 |
TArr() {} |
|
87 |
TInt Count() const {return S;} |
|
88 |
T& operator[](TInt anIndex) {return iArr[anIndex];} |
|
89 |
const T& operator[](TInt anIndex) const {return iArr[anIndex];} |
|
90 |
private: |
|
91 |
T iArr[S]; |
|
92 |
}; |
|
93 |
||
94 |
LOCAL_C void testFix(CArrayFix<TBuf<0x10> >& aFix) |
|
95 |
// |
|
96 |
// Test all methods |
|
97 |
// |
|
98 |
{ |
|
99 |
test.Next(_L("Test all methods")); |
|
100 |
test(aFix.Count()==0); |
|
101 |
test(aFix.Length()==sizeof(TBuf<0x10>)); |
|
102 |
aFix.Compress(); |
|
103 |
test(TRUE); |
|
104 |
aFix.Reset(); |
|
105 |
test(TRUE); |
|
106 |
TKeyArrayFix kk(0,ECmpNormal,0x10); |
|
107 |
test(TRUE); |
|
108 |
aFix.Sort(kk); |
|
109 |
test(TRUE); |
|
110 |
TBuf<0x10> aa(_L("aaaaa")); |
|
111 |
aFix.InsertL(0,aa); |
|
112 |
test(TRUE); |
|
113 |
aFix[0].Fill(' '); |
|
114 |
test(TRUE); |
|
115 |
TBuf<0x10> z(aFix[0]); |
|
116 |
z.Length(); |
|
117 |
test(TRUE); |
|
118 |
aFix[0].Fill('a'); |
|
119 |
test(TRUE); |
|
120 |
TInt pp; |
|
121 |
test(aFix.Find(aa,kk,pp)==0); |
|
122 |
test(pp==0); |
|
123 |
aFix.Delete(0); |
|
124 |
TBuf<0x10> bb(_L("bbbbb")); |
|
125 |
aFix.AppendL(bb); |
|
126 |
test(aFix.Count()==1); |
|
127 |
test(aFix.InsertIsqAllowDuplicatesL(aa,kk)==0); |
|
128 |
test(aFix.InsertIsqAllowDuplicatesL(bb,kk)==2); |
|
129 |
test(aFix.FindIsq(aa,kk,pp)==0); |
|
130 |
test(pp==0); |
|
131 |
aFix.Reset(); |
|
132 |
for(TInt index=0;index<KTestGranularity*7/2;index++) |
|
133 |
aFix.AppendL(aa); |
|
134 |
const TBuf<0x10> *end=NULL; |
|
135 |
const TBuf<0x10> *ptr=NULL; |
|
136 |
for(TInt index2=0;index2<KTestGranularity*7/2;index2++) |
|
137 |
{ |
|
138 |
if (end==ptr) |
|
139 |
{ |
|
140 |
end=aFix.End(index2); |
|
141 |
ptr=&aFix[index2]; |
|
142 |
TInt seglen=end-ptr; |
|
143 |
test(seglen==KTestGranularity || seglen==(aFix.Count()-index2)); |
|
144 |
} |
|
145 |
test(&aFix[index2]==ptr++); |
|
146 |
} |
|
147 |
const TBuf<0x10> *bak=NULL; |
|
148 |
ptr=NULL; |
|
149 |
for(TInt index3=KTestGranularity*7/2;index3>0;index3--) |
|
150 |
{ |
|
151 |
if (bak==ptr) |
|
152 |
{ |
|
153 |
bak=aFix.Back(index3); |
|
154 |
ptr=&aFix[index3-1]+1; |
|
155 |
TInt seglen=ptr-bak; |
|
156 |
test(seglen==KTestGranularity || seglen==index3 || seglen==index3%KTestGranularity); |
|
157 |
} |
|
158 |
test(&aFix[index3-1]==--ptr); |
|
159 |
} |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
160 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
161 |
//Test ExpandL |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
//Expand array in slot 1 |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
163 |
TBuf16<0x10> exp; |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
164 |
exp=_L("abc AbC"); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
165 |
aFix.InsertL(0,exp); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
166 |
aFix.InsertL(1,exp); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
167 |
aFix.InsertL(2,exp); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
168 |
exp=aFix.ExpandL(1); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
169 |
test(aFix[0]==_L("abc AbC")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
170 |
test(aFix[1]==_L("")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
171 |
test(aFix[2]==_L("abc AbC")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
172 |
test(aFix[3]==_L("abc AbC")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
173 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
174 |
//Test ResizeL and InsertReplL |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
175 |
//Resize the array to containing 20 records, |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
176 |
//copying a record into any new slots. |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
177 |
TBuf<0x10> res(_L("bbbbb")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
178 |
aFix.Reset(); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
179 |
aFix.ResizeL(20,res); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
180 |
for(TInt i=0;i<20;i++) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
181 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
182 |
test(aFix[1]==_L("bbbbb")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
183 |
} |
0 | 184 |
} |
185 |
||
186 |
LOCAL_C void test1(CArrayFix<TText>& aFix) |
|
187 |
// |
|
188 |
{ |
|
189 |
test.Next(_L("AppendL and InsertL single chars")); |
|
190 |
aFix.AppendL(_S("abcd"),4); |
|
191 |
test(aFix[0]=='a'); |
|
192 |
test(aFix[1]=='b'); |
|
193 |
test(aFix[3]=='d'); |
|
194 |
test(aFix.Count()==4); |
|
195 |
aFix.InsertL(2,_S("ef"),2); |
|
196 |
test(aFix[1]=='b'); |
|
197 |
test(aFix[2]=='e'); |
|
198 |
test(aFix[4]=='c'); |
|
199 |
test(aFix.Count()==6); |
|
200 |
aFix.AppendL(TText('z')); |
|
201 |
test(aFix[6]=='z'); |
|
202 |
aFix.InsertL(0,TText('y')); |
|
203 |
test(aFix[0]=='y'); |
|
204 |
test(aFix[1]=='a'); |
|
205 |
test(aFix.Count()==8); |
|
206 |
test.Next(_L("Delete single chars")); |
|
207 |
aFix.Delete(3); |
|
208 |
test(aFix[2]=='b'); |
|
209 |
test(aFix[3]=='f'); |
|
210 |
test(aFix[4]=='c'); |
|
211 |
aFix.Delete(1,2); |
|
212 |
test(aFix[0]=='y'); |
|
213 |
test(aFix[1]=='f'); |
|
214 |
test(aFix[2]=='c'); |
|
215 |
test(aFix.Count()==5); |
|
216 |
aFix.Compress(); |
|
217 |
} |
|
218 |
||
219 |
LOCAL_C void test2(CArrayFix<TArr<TText,4> >& aFix) |
|
220 |
// |
|
221 |
{ |
|
222 |
test(aFix.Length()==sizeof(TArr<TText,4>)); |
|
223 |
test.Next(_L("AppendL and insert strings of length 4")); |
|
224 |
TPtrC des1=_L("abcd"); |
|
225 |
TPtrC des2=_L("efgh"); |
|
226 |
aFix.AppendL(*(const TArr<TText,4>*)des1.Ptr()); |
|
227 |
aFix.AppendL(*(const TArr<TText,4>*)des2.Ptr()); |
|
228 |
test(aFix.Count()==2); |
|
229 |
TPtrC des3(&aFix[0][0],4); |
|
230 |
TPtrC des4(&aFix[1][0],4); |
|
231 |
test(des3==_L("abcd")); |
|
232 |
test(des4==_L("efgh")); |
|
233 |
aFix.InsertL(1,*(const TArr<TText,4>*)_S("ijkl")); |
|
234 |
test(aFix.Count()==3); |
|
235 |
TPtrC des5(&aFix[2][0],4); |
|
236 |
test(des3==_L("abcd")); |
|
237 |
test(des4==_L("ijkl")); |
|
238 |
test(des5==_L("efgh")); |
|
239 |
||
240 |
test.Next(_L("Reset and Compress")); |
|
241 |
aFix.Reset(); |
|
242 |
TBuf<0x10> buf1=_L("abcdefgh"); |
|
243 |
aFix.AppendL((const TArr<TText,4>*)buf1.Ptr(),2); |
|
244 |
aFix.Compress(); |
|
245 |
TPtrC des6(&aFix[0][0],4); |
|
246 |
test(des6==_L("abcd")); |
|
247 |
TPtrC des7(&aFix[1][0],4); |
|
248 |
test(des7==_L("efgh")); |
|
249 |
buf1=_L("ghighhxy"); |
|
250 |
aFix.InsertL(1,(const TArr<TText,4>*)buf1.Ptr(),2); |
|
251 |
aFix.Compress(); |
|
252 |
TPtrC des8(&aFix[0][0],4); |
|
253 |
test(des8==_L("abcd")); |
|
254 |
TPtrC des9(&aFix[1][0],4); |
|
255 |
test(des9==_L("ghig")); |
|
256 |
TPtrC des10(&aFix[2][0],4); |
|
257 |
test(des10==_L("hhxy")); |
|
258 |
TPtrC des11(&aFix[3][0],4); |
|
259 |
test(des11==_L("efgh")); |
|
260 |
||
261 |
test.Next(_L("Sort strings")); |
|
262 |
TKeyArrayFix kk(0,ECmpNormal,0x04); |
|
263 |
aFix.Sort(kk); |
|
264 |
TPtrC des12(&aFix[0][0],4); |
|
265 |
test(des12==_L("abcd")); |
|
266 |
TPtrC des13(&aFix[1][0],4); |
|
267 |
test(des13==_L("efgh")); |
|
268 |
TPtrC des14(&aFix[2][0],4); |
|
269 |
test(des14==_L("ghig")); |
|
270 |
TPtrC des15(&aFix[3][0],4); |
|
271 |
test(des15==_L("hhxy")); |
|
272 |
||
273 |
test.Next(_L("Find and FindIsq")); |
|
274 |
aFix.Compress(); |
|
275 |
test(aFix.InsertIsqL(*(const TArr<TText,4>*)_S("ffff"),kk)==2); |
|
276 |
aFix.Compress(); |
|
277 |
test(aFix.InsertIsqAllowDuplicatesL(*(const TArr<TText,4>*)_S("ffff"),kk)==3); |
|
278 |
aFix.Compress(); |
|
279 |
TRAPD(r,aFix.InsertIsqL(*(const TArr<TText,4>*)_S("ffff"),kk)) |
|
280 |
test(r==KErrAlreadyExists); |
|
281 |
TInt aPos=0; |
|
282 |
test(aFix.Find(*(const TArr<TText,4>*)_S("xxxx"),kk,aPos)==1); |
|
283 |
test(aPos==6); |
|
284 |
test(aFix.Find(*(const TArr<TText,4>*)_S("abcd"),kk,aPos)==0); |
|
285 |
test(aPos==0); |
|
286 |
test(aFix.Find(*(const TArr<TText,4>*)_S("ghig"),kk,aPos)==0); |
|
287 |
test(aPos==4); |
|
288 |
test(aFix.Find(*(const TArr<TText,4>*)_S("ffff"),kk,aPos)==0); |
|
289 |
test(aPos==2); |
|
290 |
test(aFix.Find(*(const TArr<TText,4>*)_S("hhxy"),kk,aPos)==0); |
|
291 |
test(aPos==5); |
|
292 |
test(aFix.FindIsq(*(const TArr<TText,4>*)_S("bbbb"),kk,aPos)!=0); |
|
293 |
test(aPos==1); |
|
294 |
test(aFix.FindIsq(*(const TArr<TText,4>*)_S("abcd"),kk,aPos)==0); |
|
295 |
test(aPos==0); |
|
296 |
test(aFix.FindIsq(*(const TArr<TText,4>*)_S("ghig"),kk,aPos)==0); |
|
297 |
test(aPos==4); |
|
298 |
test(aFix.FindIsq(*(const TArr<TText,4>*)_S("ffff"),kk,aPos)==0); |
|
299 |
test(aPos==2); |
|
300 |
test(aFix.InsertIsqL(*(const TArr<TText,4>*)_S("fghz"),kk)==4); |
|
301 |
test(aFix.FindIsq(*(const TArr<TText,4>*)_S("fghz"),kk,aPos)==0); |
|
302 |
test(aPos==4); |
|
303 |
test(aFix.FindIsq(*(const TArr<TText,4>*)_S("hhxy"),kk,aPos)==0); |
|
304 |
test(aPos==6); |
|
305 |
} |
|
306 |
||
307 |
LOCAL_C void test3(CArrayFix<TInt>& aFix) |
|
308 |
{ |
|
309 |
||
310 |
test.Next(_L("InsertIsqL")); |
|
311 |
TKeyArrayFix kk(0,ECmpTInt); |
|
312 |
||
313 |
TInt pos=0; |
|
314 |
TInt mod=47; |
|
315 |
TInt inc=23; |
|
316 |
TInt i=0; |
|
317 |
||
318 |
FOREVER |
|
319 |
{ |
|
320 |
TInt ret; |
|
321 |
if (i&1) |
|
322 |
TRAP(ret,aFix.InsertIsqL(i,kk)) |
|
323 |
else |
|
324 |
{ |
|
325 |
TRAP(ret,pos=aFix.InsertIsqL(i,kk)) |
|
326 |
if (ret==KErrNone) |
|
327 |
test(aFix[pos]==i); |
|
328 |
} |
|
329 |
if (ret==KErrAlreadyExists) |
|
330 |
break; |
|
331 |
i=(i+inc)%mod; |
|
332 |
} |
|
333 |
||
334 |
for(i=0;i<mod;i++) |
|
335 |
{ |
|
336 |
test(aFix.FindIsq(i,kk,pos)==0); |
|
337 |
test(pos==i); |
|
338 |
TRAPD(r,aFix.InsertIsqL(i,kk)) |
|
339 |
test(r==KErrAlreadyExists); |
|
340 |
} |
|
341 |
} |
|
342 |
||
343 |
GLDEF_C TInt E32Main() |
|
344 |
// |
|
345 |
// Test the Array classes. |
|
346 |
// |
|
347 |
{ |
|
348 |
||
349 |
test.Title(); |
|
350 |
__UHEAP_MARK; |
|
351 |
test.Start(_L("class CArrayFixFlat")); |
|
352 |
CArrayFixFlat<TBuf<0x10> >* pFixFlat=new CArrayFixFlat<TBuf<0x10> >(KTestGranularity); |
|
353 |
if (pFixFlat==NULL) |
|
354 |
test.Panic(_L("Allocating array")); |
|
355 |
testFix(*pFixFlat); |
|
356 |
delete pFixFlat; |
|
357 |
||
358 |
CArrayFixFlat<TText>* pFixFlatChar=new CArrayFixFlat<TText>(KTestGranularity); |
|
359 |
test1(*pFixFlatChar); |
|
360 |
delete pFixFlatChar; |
|
361 |
||
362 |
CArrayFixFlat<TArr<TText,4> >* pFixFlatArr=new CArrayFixFlat<TArr<TText,4> >(KTestGranularity); |
|
363 |
test2(*pFixFlatArr); |
|
364 |
delete pFixFlatArr; |
|
365 |
||
366 |
CArrayFixFlat<TInt>* pFixFlatInt=new CArrayFixFlat<TInt>(KTestGranularity); |
|
367 |
test3(*pFixFlatInt); |
|
368 |
delete pFixFlatInt; |
|
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
369 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
370 |
CArrayFixFlat<TUid>* pFixFlatTUid=new CArrayFixFlat<TUid>(KTestGranularity); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
371 |
if (pFixFlatTUid==NULL) |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
372 |
{ |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
373 |
test.Panic(_L("Allocating array of TUid")); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
374 |
} |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
375 |
delete pFixFlatTUid; |
0 | 376 |
|
377 |
test.Next(_L("class CArrayPtrFlat of CBase")); |
|
378 |
||
379 |
CArrayPtrFlat<MyCBase>* pPtrFlatCBase=new CArrayPtrFlat<MyCBase>(KTestGranularity); |
|
380 |
if (pPtrFlatCBase==NULL) |
|
381 |
test.Panic(_L("Allocating array of CBase*")); |
|
382 |
MyCBase* c1 = new MyCBase(); |
|
383 |
pPtrFlatCBase->InsertL(0,&c1,1); |
|
384 |
pPtrFlatCBase->ResetAndDestroy(); |
|
385 |
// test(pFixFlatCBase->iBase==0); |
|
386 |
pPtrFlatCBase->ResetAndDestroy(); |
|
387 |
delete pPtrFlatCBase; |
|
388 |
||
389 |
test.Next(_L("class CArrayFixFlat of CBase")); |
|
390 |
||
391 |
CArrayFixFlat<MyCBase>* pFixFlatCBase=new CArrayFixFlat<MyCBase>(KTestGranularity); |
|
392 |
if (pFixFlatCBase==NULL) |
|
393 |
test.Panic(_L("Allocating array of CBase")); |
|
394 |
delete pFixFlatCBase; |
|
395 |
||
396 |
test.Next(_L("class CArrayFixSeg")); |
|
397 |
CArrayFixSeg<TBuf<0x10> >* pFixSeg=new CArrayFixSeg<TBuf<0x10> >(KTestGranularity); |
|
398 |
if (pFixSeg==NULL) |
|
399 |
test.Panic(_L("Allocating array")); |
|
400 |
testFix(*pFixSeg); |
|
401 |
delete pFixSeg; |
|
402 |
||
403 |
CArrayFixSeg<TText>* pFixSegChar=new CArrayFixSeg<TText>(KTestGranularity); |
|
404 |
test1(*pFixSegChar); |
|
405 |
delete pFixSegChar; |
|
406 |
||
407 |
CArrayFixSeg<TArr<TText,4> >* pFixSegArr=new CArrayFixSeg<TArr<TText,4> >(KTestGranularity); |
|
408 |
test2(*pFixSegArr); |
|
409 |
delete pFixSegArr; |
|
410 |
||
411 |
CArrayFixSeg<TInt>* pFixSegInt=new CArrayFixSeg<TInt>(KTestGranularity); |
|
412 |
test3(*pFixSegInt); |
|
413 |
delete pFixSegInt; |
|
414 |
||
415 |
test.End(); |
|
416 |
__UHEAP_MARKEND; |
|
417 |
return(0); |
|
418 |
} |
|
419 |