Update contrib.
1 // Copyright (c) 1995-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\buffer\t_key.cpp
16 // Test arrays keys against flat and segmented arrays of characters (8 and 16 bit) and records.
18 // TKeyArrayFix, TKeyArrayVar.
20 // - Create flat and segmented array of TText8, TText16, TText. Append some text to the
21 // arrays and test the functions of the TKeyArrayFix class using the Find method which
22 // calls SetPtr, Set, Compare methods with ECmpNormal8, ECmpFolded8, ECmpCollated8,
23 // ECmpNormal16, ECmpFolded16, ECmpCollated16, ECmpNormal, ECmpFolded, ECmpCollated key types.
24 // - Test the functions of the TKeyArrayVar class using the Find method which calls SetPtr, Set,
25 // Compare methods with ECmpNormal8, ECmpFolded8, ECmpCollated8, ECmpNormal16, ECmpFolded16,
26 // ECmpCollated16, ECmpNormal, ECmpFolded, ECmpCollated key types.
27 // - Create flat and segmented array of TText, append some structures with different values.
28 // - Test the functions of the TKeyArrayFix, TKeyArrayVar classes by searching the values using
29 // sequential search technique with ECmpNormal, ECmpTInt32 key type and verifying that it is
30 // found at correct position.
31 // - For TKeyArrayFix and TKeyArrayVar class, create a flat array of TText, append some structures
32 // with different numeric values, sort the array, search the values using ECmpTInt, ECmpTUint,
33 // ECmpTint8, ECmpTUint8, ECmpTint16, ECmpTUint16, ECmpTint32, ECmpTUint32 key types and verify
34 // that values are found in order as expected.
35 // Platforms/Drives/Compatibility:
37 // Assumptions/Requirement/Pre-requisites:
38 // Failures and causes:
39 // Base Port information:
44 #include <e32std_private.h>
46 #include <e32base_private.h>
52 #pragma warning (disable:4710) // Function not expanded
53 #pragma warning (disable:4702) // Unreachable code
56 const TInt KTestGranularity=0x02;
58 LOCAL_D RTest test(_L("T_KEY"));
60 template <class T,TInt S>
65 TInt Count() const {return S;}
66 T& operator[](TInt anIndex) {return iArr[anIndex];}
67 const T& operator[](TInt anIndex) const {return iArr[anIndex];}
90 }Rec1, Rec2, Rec3, Rec4;
92 LOCAL_C void SetRecordData(void)
100 Rec3.tint8=-KMaxTInt8;
101 Rec4.tint8=(TInt8)KMinTInt8;
102 Rec1.tint16=KMaxTInt16;
104 Rec3.tint16=-KMaxTInt16;
105 Rec4.tint16=(TInt16)KMinTInt16;
106 Rec1.tint32=KMaxTInt32;
108 Rec3.tint32=-KMaxTInt32;
109 Rec4.tint32=(TInt32)KMinTInt32;
112 Rec3.tuint=KMaxTUint-1;
113 Rec4.tuint=KMaxTUint;
116 Rec3.tuint8=(TUint8)(KMaxTUint8-1);
117 Rec4.tuint8=(TUint8)KMaxTUint8;
120 Rec3.tuint16=(TUint16)(KMaxTUint16-1);
121 Rec4.tuint16=(TUint16)KMaxTUint16;
124 Rec3.tuint32=(TUint32)(KMaxTUint32-1);
125 Rec4.tuint32=KMaxTUint32;
128 typedef enum {eEight, eSixteen} TMode;
130 template<class KeyType, class ArrayType, class S> // S is TText8, TTExt etc. called S as _TL requires S in e32test.h
134 void Test1(TKeyCmpText, TKeyCmpText, TKeyCmpText);
135 void Test2(TKeyCmpText, TKeyCmpText, TKeyCmpText);
142 template<class KeyType, class ArrayType, class S>
143 GLDEF_C void TestTKey<KeyType, ArrayType, S>::Test1(TKeyCmpText N, TKeyCmpText F, TKeyCmpText C)
145 // This tests the functions of the TKey classes indirectly - mostly using the Find method
146 // which calls SetPtr(), Set() (both trivial) and more importantly Compare(),
148 ArrayType* pArray=new ArrayType(KTestGranularity);
149 pArray->AppendL(*(const TArr<S,5>*)_TL("aa cc"));
150 pArray->AppendL(*(const TArr<S,5>*)_TL("bb bb"));
151 pArray->AppendL(*(const TArr<S,5>*)_TL("cc aa"));
153 KeyType NormalKey(0,N,5);
154 KeyType NormalKeyOffset(sizeof(S)*3,N,2) ;
155 KeyType FoldedKey(0,F,5);
156 KeyType FoldedKeyOffset(sizeof(S)*3,F,2);
157 KeyType CollatedKey(0,C,5);
158 KeyType CollatedKeyOffset(sizeof(S)*3,C,2);
161 test(pArray->Find(*(const TArr<S,5>*)_TL("aa cc"), NormalKey, pos)==0);
163 test(pArray->Find(*(const TArr<S,5>*)_TL("bb bb"), NormalKey, pos)==0);
165 test(pArray->Find(*(const TArr<S,5>*)_TL("cc aa"), NormalKey, pos)==0);
167 test(pArray->Find(*(const TArr<S,5>*)_TL("BB BB"), NormalKey, pos)!=0);
170 test(pArray->Find(*(const TArr<S,5>*)_TL("___cc"), NormalKeyOffset, pos)==0);
172 test(pArray->Find(*(const TArr<S,5>*)_TL("___bb"), NormalKeyOffset, pos)==0);
174 test(pArray->Find(*(const TArr<S,5>*)_TL("___aa"), NormalKeyOffset, pos)==0);
176 test(pArray->Find(*(const TArr<S,5>*)_TL("___ax"), NormalKeyOffset, pos)!=0);
179 test(pArray->Find(*(const TArr<S,5>*)_TL("aa cc"), FoldedKey, pos)==0);
181 test(pArray->Find(*(const TArr<S,5>*)_TL("bb bb"), FoldedKey, pos)==0);
183 test(pArray->Find(*(const TArr<S,5>*)_TL("cc aa"), FoldedKey, pos)==0);
187 test(pArray->Find(*(const TArr<S,5>*)_TL("___CC"), FoldedKeyOffset, pos)==0);
189 test(pArray->Find(*(const TArr<S,5>*)_TL("___bB"), FoldedKeyOffset, pos)==0);
191 test(pArray->Find(*(const TArr<S,5>*)_TL("___Aa"), FoldedKeyOffset, pos)==0);
193 test(pArray->Find(*(const TArr<S,5>*)_TL("___ax"), FoldedKeyOffset, pos)!=0);
196 test(pArray->Find(*(const TArr<S,5>*)_TL("aa cc"), CollatedKey, pos)==0);
198 test(pArray->Find(*(const TArr<S,5>*)_TL("bb bb"), CollatedKey, pos)==0);
200 test(pArray->Find(*(const TArr<S,5>*)_TL("cc aa"), CollatedKey, pos)==0);
204 test(pArray->Find(*(const TArr<S,5>*)_TL("___cc"), CollatedKeyOffset, pos)==0);
206 test(pArray->Find(*(const TArr<S,5>*)_TL("___bb"), CollatedKeyOffset, pos)==0);
208 test(pArray->Find(*(const TArr<S,5>*)_TL("___aa"), CollatedKeyOffset, pos)==0);
210 test(pArray->Find(*(const TArr<S,5>*)_TL("___ax"), CollatedKeyOffset, pos)!=0);
216 template<class KeyType, class ArrayType, class S>
217 GLDEF_C void TestTKey<KeyType, ArrayType, S>::Test2(TKeyCmpText N, TKeyCmpText F, TKeyCmpText C)
219 // This tests the functions of the TKey classes indirectly - mostly using the Find method
220 // which calls SetPtr(), Set() (both trivial) and more importantly Compare(),
222 ArrayType* pArray=new ArrayType(KTestGranularity);
223 pArray->AppendL(*(S(*))_TL("aa cc"), 5*sizeof(S));
224 pArray->AppendL(*(S(*))_TL("bb bbb"), 6*sizeof(S));
225 pArray->AppendL(*(S(*))_TL("cc aaaa"), 7*sizeof(S));
227 KeyType NormalKey5(0,N,5);
228 KeyType NormalKey6(0,N,6);
229 KeyType NormalKey7(0,N,7);
230 KeyType NormalKeyOffset(sizeof(S)*3,N,2);
232 KeyType FoldedKey5(0,F,5);
233 KeyType FoldedKey6(0,F,6);
234 KeyType FoldedKey7(0,F,7);
235 KeyType FoldedKeyOffset(sizeof(S)*3,F,2);
237 KeyType CollatedKey5(0,C,5);
238 KeyType CollatedKey6(0,C,6);
239 KeyType CollatedKey7(0,C,7);
240 KeyType CollatedKeyOffset(sizeof(S)*3,C,2);
243 test(pArray->Find(*(S(*))_TL("aa cc"), NormalKey5, pos)==0);
245 test(pArray->Find(*(S(*))_TL("bb bbb"), NormalKey6, pos)==0);
247 test(pArray->Find(*(S(*))_TL("cc aaaa"), NormalKey7, pos)==0);
249 test(pArray->Find(*(S(*))_TL("BB BB"), NormalKey5, pos)!=0);
252 test(pArray->Find(*(S(*))_TL("___cc"), NormalKeyOffset, pos)==0);
254 test(pArray->Find(*(S(*))_TL("___bb"), NormalKeyOffset, pos)==0);
256 test(pArray->Find(*(S(*))_TL("___aa"), NormalKeyOffset, pos)==0);
258 test(pArray->Find(*(S(*))_TL("___ax"), NormalKeyOffset, pos)!=0);
261 test(pArray->Find(*(S(*))_TL("aa cc"), FoldedKey5, pos)==0);
263 test(pArray->Find(*(S(*))_TL("bb bbb"), FoldedKey6, pos)==0);
265 test(pArray->Find(*(S(*))_TL("cc aaaa"), FoldedKey7, pos)==0);
269 test(pArray->Find(*(S(*))_TL("___CC"), FoldedKeyOffset, pos)==0);
271 test(pArray->Find(*(S(*))_TL("___bB"), FoldedKeyOffset, pos)==0);
273 test(pArray->Find(*(S(*))_TL("___Aa"), FoldedKeyOffset, pos)==0);
275 test(pArray->Find(*(S(*))_TL("___ax"), FoldedKeyOffset, pos)!=0);
278 test(pArray->Find(*(S(*))_TL("aa cc"), CollatedKey5, pos)==0);
280 test(pArray->Find(*(S(*))_TL("bb bbb"), CollatedKey6, pos)==0);
282 test(pArray->Find(*(S(*))_TL("cc aaaa"), CollatedKey7, pos)==0);
286 test(pArray->Find(*(S(*))_TL("___cc"), CollatedKeyOffset, pos)==0);
288 test(pArray->Find(*(S(*))_TL("___bb"), CollatedKeyOffset, pos)==0);
290 test(pArray->Find(*(S(*))_TL("___aa"), CollatedKeyOffset, pos)==0);
292 test(pArray->Find(*(S(*))_TL("___ax"), CollatedKeyOffset, pos)!=0);
298 template<class KeyType, class ArrayType, class S>
299 GLDEF_C void TestTKey<KeyType, ArrayType, S>::Test3(void)
301 ArrayType* pArray=new ArrayType(KTestGranularity);
302 Record rec1, rec2, rec3;
304 rec1.name=(_TL("fred"));
308 rec2.name=(_TL("bill"));
312 rec3.name=(_TL("bert"));
316 pArray->AppendL(rec1);
317 pArray->AppendL(rec2);
318 pArray->AppendL(rec3);
322 KeyType codekey(_FOFF(Record, code),ECmpNormal,1);
323 test(pArray->Find(rec1, codekey, pos)==0);
325 test(pArray->Find(rec2, codekey, pos)==0);
327 test(pArray->Find(rec3, codekey, pos)==0);
330 KeyType agekey(_FOFF(Record, age), ECmpTInt32);
331 test(pArray->Find(rec1, agekey, pos)==0);
333 test(pArray->Find(rec2, agekey, pos)==0);
335 test(pArray->Find(rec3, agekey, pos)==0);
338 rec1.age=-50; // march 95 - this isn't allowed , lucky that it works
339 test(pArray->Find(rec1, agekey, pos)!=0);
342 pArray->Sort(agekey);
343 test(pArray->Find(rec1, agekey, pos)==0);
345 test(pArray->Find(rec2, agekey, pos)==0);
347 test(pArray->Find(rec3, agekey, pos)==0);
353 template<class KeyType, class ArrayType, class S>
354 GLDEF_C void TestTKey<KeyType, ArrayType, S>::Test4(void)
356 ArrayType* pArray=new ArrayType(KTestGranularity);
357 Record rec1, rec2, rec3;
359 rec1.name=(_TL("fred"));
362 rec2.name=(_TL("bill"));
365 rec3.name=(_TL("bert"));
369 pArray->AppendL(rec1, sizeof(Record));
370 pArray->AppendL(rec2, sizeof(Record));
371 pArray->AppendL(rec3, sizeof(Record));
374 KeyType codekey(_FOFF(Record, code),ECmpNormal,1);
375 test(pArray->Find(rec1, codekey, pos)==0);
377 test(pArray->Find(rec2, codekey, pos)==0);
379 test(pArray->Find(rec3, codekey, pos)==0);
382 KeyType agekey(_FOFF(Record, age), ECmpTInt32);
383 test(pArray->Find(rec1, agekey, pos)==0);
385 test(pArray->Find(rec2, agekey, pos)==0);
387 test(pArray->Find(rec3, agekey, pos)==0);
389 rec1.age=-50; // march 95 - this isn't allowed - lucky to get away with it
390 test(pArray->Find(rec1, agekey, pos)!=0);
393 pArray->Sort(agekey);
394 test(pArray->Find(rec1, agekey, pos)==0);
396 test(pArray->Find(rec2, agekey, pos)==0);
398 test(pArray->Find(rec3, agekey, pos)==0);
404 template<class KeyType, class ArrayType, class S>
405 GLDEF_C void TestTKey<KeyType, ArrayType, S>::Test5(void)
407 // test the numeric enumeration types
408 ArrayType* pArray=new ArrayType(KTestGranularity);
411 KeyType TIntKey(_FOFF(Record2, tint), ECmpTInt);
412 KeyType TUintKey(_FOFF(Record2, tuint), ECmpTUint);
413 KeyType TInt8Key(_FOFF(Record2, tint8), ECmpTInt8);
414 KeyType TUint8Key(_FOFF(Record2, tuint8), ECmpTUint8);
415 KeyType TInt16Key(_FOFF(Record2, tint16), ECmpTInt16);
416 KeyType TUint16Key(_FOFF(Record2, tuint16), ECmpTUint16);
417 KeyType TInt32Key(_FOFF(Record2, tint32), ECmpTInt32);
418 KeyType TUint32Key(_FOFF(Record2, tuint32), ECmpTUint32);
422 pArray->AppendL(Rec1);
423 pArray->AppendL(Rec2);
424 pArray->AppendL(Rec3);
425 pArray->AppendL(Rec4);
427 pArray->Sort(TIntKey);
428 // order should be 4,3,2,1
429 test(pArray->Find(Rec4, TIntKey, pos)==0);
431 test(pArray->Find(Rec3, TIntKey, pos)==0);
433 test(pArray->Find(Rec2, TIntKey, pos)==0);
435 test(pArray->Find(Rec1, TIntKey, pos)==0);
438 pArray->Sort(TUintKey);
439 // order should be 1,2,3,4
440 test(pArray->Find(Rec1, TUintKey, pos)==0);
442 test(pArray->Find(Rec2, TUintKey, pos)==0);
444 test(pArray->Find(Rec3, TUintKey, pos)==0);
446 test(pArray->Find(Rec4, TUintKey, pos)==0);
449 pArray->Sort(TInt8Key);
450 // order should be 4,3,2,1
451 test(pArray->Find(Rec4, TInt8Key, pos)==0);
453 test(pArray->Find(Rec3, TInt8Key, pos)==0);
455 test(pArray->Find(Rec2, TInt8Key, pos)==0);
457 test(pArray->Find(Rec1, TInt8Key, pos)==0);
460 pArray->Sort(TUint8Key);
461 // order should be 1,2,3,4
462 test(pArray->Find(Rec1, TUint8Key, pos)==0);
464 test(pArray->Find(Rec2, TUint8Key, pos)==0);
466 test(pArray->Find(Rec3, TUint8Key, pos)==0);
468 test(pArray->Find(Rec4, TUint8Key, pos)==0);
471 pArray->Sort(TInt16Key);
472 // order should be 4,3,2,1
473 test(pArray->Find(Rec4, TInt16Key, pos)==0);
475 test(pArray->Find(Rec3, TInt16Key, pos)==0);
477 test(pArray->Find(Rec2, TInt16Key, pos)==0);
479 test(pArray->Find(Rec1, TInt16Key, pos)==0);
482 pArray->Sort(TUintKey);
483 // order should be 1,2,3,4
484 test(pArray->Find(Rec1, TUint16Key, pos)==0);
486 test(pArray->Find(Rec2, TUint16Key, pos)==0);
488 test(pArray->Find(Rec3, TUint16Key, pos)==0);
490 test(pArray->Find(Rec4, TUint16Key, pos)==0);
493 pArray->Sort(TInt32Key);
494 // order should be 4,3,2,1
495 test(pArray->Find(Rec4, TInt32Key, pos)==0);
497 test(pArray->Find(Rec3, TInt32Key, pos)==0);
499 test(pArray->Find(Rec2, TInt32Key, pos)==0);
501 test(pArray->Find(Rec1, TInt32Key, pos)==0);
504 pArray->Sort(TUint32Key);
505 // order should be 1,2,3,4
506 test(pArray->Find(Rec1, TUint32Key, pos)==0);
508 test(pArray->Find(Rec2, TUint32Key, pos)==0);
510 test(pArray->Find(Rec3, TUint32Key, pos)==0);
512 test(pArray->Find(Rec4, TUint32Key, pos)==0);
518 template<class KeyType, class ArrayType, class S>
519 GLDEF_C void TestTKey<KeyType, ArrayType, S>::Test6(void)
521 // test the numeric enumeration types
522 ArrayType* pArray=new ArrayType(KTestGranularity);
525 KeyType TIntKey(_FOFF(Record2, tint), ECmpTInt);
526 KeyType TUintKey(_FOFF(Record2, tuint), ECmpTUint);
527 KeyType TInt8Key(_FOFF(Record2, tint8), ECmpTInt8);
528 KeyType TUint8Key(_FOFF(Record2, tuint8), ECmpTUint8);
529 KeyType TInt16Key(_FOFF(Record2, tint16), ECmpTInt16);
530 KeyType TUint16Key(_FOFF(Record2, tuint16), ECmpTUint16);
531 KeyType TInt32Key(_FOFF(Record2, tint32), ECmpTInt32);
532 KeyType TUint32Key(_FOFF(Record2, tuint32), ECmpTUint32);
536 pArray->AppendL(Rec1, sizeof(Record2));
537 pArray->AppendL(Rec2, sizeof(Record2));
538 pArray->AppendL(Rec3, sizeof(Record2));
539 pArray->AppendL(Rec4, sizeof(Record2));
541 pArray->Sort(TIntKey);
542 // order should be 4,3,2,1
543 test(pArray->Find(Rec4, TIntKey, pos)==0);
545 test(pArray->Find(Rec3, TIntKey, pos)==0);
547 test(pArray->Find(Rec2, TIntKey, pos)==0);
549 test(pArray->Find(Rec1, TIntKey, pos)==0);
552 pArray->Sort(TUintKey);
553 // order should be 1,2,3,4
554 test(pArray->Find(Rec1, TUintKey, pos)==0);
556 test(pArray->Find(Rec2, TUintKey, pos)==0);
558 test(pArray->Find(Rec3, TUintKey, pos)==0);
560 test(pArray->Find(Rec4, TUintKey, pos)==0);
563 pArray->Sort(TInt8Key);
564 // order should be 4,3,2,1
565 test(pArray->Find(Rec4, TInt8Key, pos)==0);
567 test(pArray->Find(Rec3, TInt8Key, pos)==0);
569 test(pArray->Find(Rec2, TInt8Key, pos)==0);
571 test(pArray->Find(Rec1, TInt8Key, pos)==0);
574 pArray->Sort(TUint8Key);
575 // order should be 1,2,3,4
576 test(pArray->Find(Rec1, TUint8Key, pos)==0);
578 test(pArray->Find(Rec2, TUint8Key, pos)==0);
580 test(pArray->Find(Rec3, TUint8Key, pos)==0);
582 test(pArray->Find(Rec4, TUint8Key, pos)==0);
585 pArray->Sort(TInt16Key);
586 // order should be 4,3,2,1
587 test(pArray->Find(Rec4, TInt16Key, pos)==0);
589 test(pArray->Find(Rec3, TInt16Key, pos)==0);
591 test(pArray->Find(Rec2, TInt16Key, pos)==0);
593 test(pArray->Find(Rec1, TInt16Key, pos)==0);
596 pArray->Sort(TUintKey);
597 // order should be 1,2,3,4
598 test(pArray->Find(Rec1, TUint16Key, pos)==0);
600 test(pArray->Find(Rec2, TUint16Key, pos)==0);
602 test(pArray->Find(Rec3, TUint16Key, pos)==0);
604 test(pArray->Find(Rec4, TUint16Key, pos)==0);
607 pArray->Sort(TInt32Key);
608 // order should be 4,3,2,1
609 test(pArray->Find(Rec4, TInt32Key, pos)==0);
611 test(pArray->Find(Rec3, TInt32Key, pos)==0);
613 test(pArray->Find(Rec2, TInt32Key, pos)==0);
615 test(pArray->Find(Rec1, TInt32Key, pos)==0);
618 pArray->Sort(TUint32Key);
619 // order should be 1,2,3,4
620 test(pArray->Find(Rec1, TUint32Key, pos)==0);
622 test(pArray->Find(Rec2, TUint32Key, pos)==0);
624 test(pArray->Find(Rec3, TUint32Key, pos)==0);
626 test(pArray->Find(Rec4, TUint32Key, pos)==0);
632 GLDEF_C TInt E32Main()
636 test.Start(_L("Fixed key class with a flat array of TText8"));
637 typedef CArrayFixFlat<TArr<TText8,5> > aFixedFlatArrayOfTText8;
638 TestTKey<TKeyArrayFix, aFixedFlatArrayOfTText8, TText8> T1;
639 T1.Test1(ECmpNormal8, ECmpFolded8, ECmpCollated8);
641 test.Next(_L("Fixed key class with a flat array of TText16"));
642 typedef CArrayFixFlat<TArr<TText16,5> > aFixedFlatArrayOfTText16;
643 TestTKey<TKeyArrayFix, aFixedFlatArrayOfTText16, TText16> T2;
644 T2.Test1(ECmpNormal16, ECmpFolded16, ECmpCollated16);
646 test.Next(_L("Fixed key class with a flat array of TText"));
647 typedef CArrayFixFlat<TArr<TText,5> > aFixedFlatArrayOfTText;
648 TestTKey<TKeyArrayFix, aFixedFlatArrayOfTText, TText> T3;
649 T3.Test1(ECmpNormal, ECmpFolded, ECmpCollated);
651 test.Next(_L("Fixed key class with a segmented array of TText8"));
652 typedef CArrayFixSeg<TArr<TText8,5> > aFixedSegmentedArrayOfTText8;
653 TestTKey<TKeyArrayFix, aFixedSegmentedArrayOfTText8, TText8> T4;
654 T4.Test1(ECmpNormal8, ECmpFolded8, ECmpCollated8);
656 test.Next(_L("Fixed key class with a segmented array of TText16"));
657 typedef CArrayFixSeg<TArr<TText16,5> > aFixedSegmentedArrayOfTText16;
658 TestTKey<TKeyArrayFix, aFixedSegmentedArrayOfTText16, TText16> T5;
659 T5.Test1(ECmpNormal16, ECmpFolded16, ECmpCollated16);
661 test.Next(_L("Fixed key class with a segmented array of TText"));
662 typedef CArrayFixSeg<TArr<TText,5> > aFixedSegmentedArrayOfTText;
663 TestTKey<TKeyArrayFix, aFixedSegmentedArrayOfTText, TText> T6;
664 T6.Test1(ECmpNormal, ECmpFolded, ECmpCollated);
666 test.Next(_L("Var key with a flat array of TText8"));
667 typedef CArrayVarFlat<TText8> aVarFlatArrayOfTText8;
668 TestTKey<TKeyArrayVar, aVarFlatArrayOfTText8, TText8> T7;
669 T7.Test2(ECmpNormal8, ECmpFolded8, ECmpCollated8);
671 test.Next(_L("Var key with a flat array of TText16"));
672 typedef CArrayVarFlat<TText16> aVarFlatArrayOfTText16;
673 TestTKey<TKeyArrayVar, aVarFlatArrayOfTText16, TText16> T8;
674 T8.Test2(ECmpNormal16, ECmpFolded16, ECmpCollated16);
676 test.Next(_L("Var key with a flat array of TText"));
677 typedef CArrayVarFlat<TText> aVarFlatArrayOfTText;
678 TestTKey<TKeyArrayVar, aVarFlatArrayOfTText, TText> T9;
679 T9.Test2(ECmpNormal, ECmpFolded, ECmpCollated);
681 test.Next(_L("Var key with a segmented array of TText8"));
682 typedef CArrayVarSeg<TText8> aVarSegmentedArrayOfTText8;
683 TestTKey<TKeyArrayVar, aVarSegmentedArrayOfTText8, TText8> T10;
684 T10.Test2(ECmpNormal8, ECmpFolded8, ECmpCollated8);
686 test.Next(_L("Var key with a segmented array of TText16"));
687 typedef CArrayVarSeg<TText16> aVarSegmentedArrayOfTText16;
688 TestTKey<TKeyArrayVar, aVarSegmentedArrayOfTText16, TText16> T11;
689 T11.Test2(ECmpNormal16, ECmpFolded16, ECmpCollated16);
691 test.Next(_L("Var key with a segmented array of TText"));
692 typedef CArrayVarSeg<TText> aVarSegmentedArrayOfTText;
693 TestTKey<TKeyArrayVar, aVarSegmentedArrayOfTText, TText> T12;
694 T12.Test2(ECmpNormal, ECmpFolded, ECmpCollated);
696 test.Next(_L("Fixed key with a flat array of structs"));
697 typedef CArrayFixFlat<Record> aFixedFlatArrayOfRecord;
698 TestTKey<TKeyArrayFix, aFixedFlatArrayOfRecord, TText> T13;
701 test.Next(_L("Fixed key with a segmented array of structs"));
702 typedef CArrayFixSeg<Record> aFixedSegmentedArrayOfRecord;
703 TestTKey<TKeyArrayFix, aFixedSegmentedArrayOfRecord, TText> T14;
706 test.Next(_L("Var key with a flat array of structs"));
707 typedef CArrayVarFlat<Record> aVarFlatArrayOfRecord;
708 TestTKey<TKeyArrayVar, aVarFlatArrayOfRecord, TText> T15;
711 test.Next(_L("Var key with a segmented array of structs"));
712 typedef CArrayVarSeg<Record> aVarSegmentedArrayOfRecord;
713 TestTKey<TKeyArrayVar, aVarSegmentedArrayOfRecord, TText> T16;
716 test.Next(_L("Fixed key with a flat array of structs testing numeric types"));
717 typedef CArrayFixFlat<Record2> aFixedFlatArrayOfRecord2;
718 TestTKey<TKeyArrayFix, aFixedFlatArrayOfRecord2, TText> T17;
721 test.Next(_L("Var key with a flat array of structs testing numeric types"));
722 typedef CArrayVarFlat<Record2> aVarFlatArrayOfRecord2;
723 TestTKey<TKeyArrayVar, aVarFlatArrayOfRecord2, TText> T18;
730 GLDEF_C TInt E32Main()
732 // Test unavailable in release build.
737 test.Start(_L("No tests for release builds"));