Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\buffer\ptr_arr.cpp
21 #include <e32std_private.h>
24 const TInt KArraySize=1024;
27 GLREF_C TInt Random();
33 inline TBool operator!=(const SEntry& anEntry) const
34 {return (iValue!=anEntry.iValue || iKey!=anEntry.iKey);}
35 inline TBool operator==(const SEntry& anEntry) const
36 {return (iValue==anEntry.iValue && iKey==anEntry.iKey);}
47 LOCAL_D TInt64* Int64s;
48 LOCAL_D SEntry* Entries;
50 LOCAL_C TInt Order64Bit(const TInt64& aLeft, const TInt64& aRight)
59 LOCAL_C TBool Compare64Bit(const TInt64& aLeft, const TInt64& aRight)
61 return (aLeft==aRight);
64 TInt OrderSEntry(const SEntry& aLeft, const SEntry& aRight)
66 if (aLeft.iKey<aRight.iKey)
68 else if (aLeft.iKey>aRight.iKey)
74 TInt OrderSEntryU(const SEntry& aLeft, const SEntry& aRight)
76 TUint l = (TUint)aLeft.iKey;
77 TUint r = (TUint)aRight.iKey;
86 TInt OrderSEntry2(const SEntry& aLeft, const SEntry& aRight)
88 if (aLeft.iKey<aRight.iKey)
90 else if (aLeft.iKey>aRight.iKey)
93 return aLeft.iValue - aRight.iValue;
96 TInt OrderSEntryU2(const SEntry& aLeft, const SEntry& aRight)
98 TUint l = (TUint)aLeft.iKey;
99 TUint r = (TUint)aRight.iKey;
105 return aLeft.iValue - aRight.iValue;
108 TInt OrderSEntryByKey(const TInt* aKey, const SEntry& aObject)
110 if (*aKey<aObject.iKey)
112 else if (*aKey>aObject.iKey)
118 LOCAL_C TBool CompareSEntryKey(const SEntry& aLeft, const SEntry& aRight)
120 return (aLeft.iKey==aRight.iKey);
123 LOCAL_C TBool CompareSEntry(const SEntry& aLeft, const SEntry& aRight)
125 return (aLeft.iKey==aRight.iKey && aLeft.iValue==aRight.iValue);
128 TBool CompareSEntryByKeyKey(const TInt* aKey, const SEntry& aRight)
130 return *aKey==aRight.iKey;
133 TBool CompareSEntryByKeyValue(const TInt* aValue, const SEntry& aRight)
135 return *aValue==aRight.iValue;
138 GLDEF_D TLinearOrder<TInt64> Int64Order(Order64Bit);
139 GLDEF_D TIdentityRelation<TInt64> Int64Identity(Compare64Bit);
140 GLDEF_D TLinearOrder<SEntry> SEntryOrder(OrderSEntry);
141 GLDEF_D TIdentityRelation<SEntry> SEntryKeyIdentity(CompareSEntryKey);
142 GLDEF_D TIdentityRelation<SEntry> SEntryIdentity(CompareSEntry);
144 LOCAL_C TInt64 Random64(TInt64& aMask)
146 TInt64 x = MAKE_TINT64(Random()&I64HIGH(aMask), Random()&I64LOW(aMask));
150 LOCAL_C TInt IntAppendAndAccessTest(TInt aCount, TInt aNumTests, TInt64 aMask)
153 for (n=0; n<aNumTests; n++)
155 RPointerArray<TInt64> a;
156 TInt64 *pA=new TInt64[aCount];
163 for (i=0; i<aCount; i++)
165 Int64s[i]=Random64(aMask);
167 a.Append(&Int64s[i]);
169 if (a.Count()!=aCount)
174 for (i=0; i<aCount; i++)
176 if (a[i]!=&Int64s[i])
188 if (a.Count()!=aCount)
193 for (i=0; i<aCount; i++)
200 if (*a[i]!=Int64s[i])
212 LOCAL_C TInt IntFindTest(TInt aCount, TInt aNumTests, TInt64 aMask)
215 for (n=0; n<aNumTests; n++)
217 RPointerArray<TInt64> a;
218 TInt64 *pA=new TInt64[aCount];
225 for (i=0; i<aCount; i++)
227 pA[i]=Random64(aMask);
229 a.Append(&Int64s[i]);
231 if (a.Count()!=aCount)
236 for (i=0; i<aCount; i++)
238 TInt r=a.Find(&Int64s[i]);
250 r=a.Find(&pA[i],Int64Identity);
251 if (r<0 || pA[i]!=Int64s[i] || r>i)
263 LOCAL_C TInt EntryFindTest(TInt aCount, TInt aNumTests)
266 for (n=0; n<aNumTests; n++)
268 RPointerArray<SEntry> a;
269 SEntry *pE=new SEntry[aCount];
276 for (i=0; i<aCount; i++)
278 pE[i].iValue=Random();
281 a.Append(&Entries[i]);
283 if (a.Count()!=aCount)
288 for (i=0; i<aCount; i++)
290 TInt r=a.Find(&Entries[i]);
302 r=a.Find(&pE[i],SEntryIdentity);
303 if (r<0 || pE[i]!=Entries[i] || r>i)
308 r=a.Find(&pE[i],SEntryKeyIdentity);
314 r=a.Find(pE[i].iValue,CompareSEntryByKeyValue);
315 if (r<0 || pE[i].iValue!=Entries[i].iValue || r>i)
320 r=a.Find(pE[i].iKey,CompareSEntryByKeyKey);
334 LOCAL_C TInt IntFindReverseTest(TInt aCount, TInt aNumTests, TInt64 aMask)
339 for (n=0; n<aNumTests; n++)
341 RPointerArray<TInt64> a;
342 TInt64 *pA=new TInt64[aCount];
348 for (i=0; i<aCount; i++)
350 pA[i]=Random64(aMask);
352 a.Append(&Int64s[i]);
354 if (a.Count()!=aCount)
360 for (i=0; i<aCount; i++)
362 TInt r=a.FindReverse(&Int64s[i]);
368 r=a.FindReverse(&pA[i]);
374 r=a.FindReverse(&pA[i],Int64Identity);
375 if (pA[i]!=Int64s[i] || r<i)
389 LOCAL_C TInt EntryFindReverseTest(TInt aCount, TInt aNumTests)
392 TInt revOffs = aCount-(((aCount-1)&7)+1);
394 for (n=0; n<aNumTests; n++)
396 RPointerArray<SEntry> a;
397 SEntry *pE=new SEntry[aCount];
404 for (i=0; i<aCount; i++)
406 pE[i].iValue=Random();
407 pE[i].iKey=((aCount-1)-i)&7;
409 a.Append(&Entries[i]);
411 if (a.Count()!=aCount)
416 for (i=0; i<aCount; i++)
418 TInt r=a.FindReverse(&Entries[i]);
424 r=a.FindReverse(&pE[i]);
430 r=a.FindReverse(&pE[i],SEntryIdentity);
431 if (pE[i]!=Entries[i] || r<i)
436 r=a.FindReverse(&pE[i],SEntryKeyIdentity);
437 if (r!=revOffs+(i&7))
442 r=a.FindReverse(pE[i].iValue,CompareSEntryByKeyValue);
443 if (pE[i].iValue!=Entries[i].iValue || r<i)
448 r=a.FindReverse(pE[i].iKey,CompareSEntryByKeyKey);
449 if (r!=revOffs+(i&7))
461 LOCAL_C TInt IntFindInOrderTest(TInt aCount, TInt aNumTests, TInt64 aMask)
462 // require aRange*aCount<2^32
465 for (n=0; n<aNumTests; n++)
467 RPointerArray<TInt64> a;
468 TInt64 *pA=new TInt64[aCount];
476 for(i=0; i<aCount; i++)
478 TInt64 x=Random64(aMask); // this is always >=0
482 a.Append(&Int64s[i]);
484 if (a.Count()!=aCount)
489 for (i=0; i<aCount; i++)
491 TInt r=a.FindInOrder(&pA[i],Int64Order);
492 if (r<0 || Int64s[r]!=pA[i])
497 TInt64 x=Random64(aMask);
498 r=a.FindInOrder(&x,Int64Order);
502 for (j=0; j<aCount; j++)
511 else if (Int64s[r]!=x)
523 LOCAL_C TInt EntryFindInOrderTest(TInt aCount, TInt aNumTests)
524 // require aRange*aCount<2^32
527 for (n=0; n<aNumTests; n++)
529 RPointerArray<SEntry> a;
530 SEntry *pE=new SEntry[aCount];
537 for(i=0; i<aCount; i++)
540 pE[i].iValue=Random();
542 a.Append(&Entries[i]);
544 if (a.Count()!=aCount)
549 for (i=0; i<aCount; i++)
551 TInt r=a.FindInOrder(&pE[i],SEntryOrder);
557 TInt x=Random()&1023;
560 r=a.FindInOrder(&e,SEntryOrder);
574 r=a.FindInOrder(x,OrderSEntryByKey);
595 LOCAL_C TInt IntInsertInOrderTest(TInt aCount, TInt aNumTests, TInt64 aMask)
598 for (n=0; n<aNumTests; n++)
600 RPointerArray<TInt64> a;
601 RPointerArray<TInt64> b;
602 RPointerArray<TInt64> c;
605 for (i=0; i<aCount; i++)
607 Int64s[i]=Random64(aMask);
608 a.Append(&Int64s[i]);
609 b.InsertInOrderAllowRepeats(&Int64s[i],Int64Order);
610 TInt r=c.InsertInOrder(&Int64s[i],Int64Order);
614 if (a.Count()!=aCount)
621 if (b.Count()!=aCount)
628 for (i=0; i<aCount-1; i++)
638 for (i=0; i<aCount; i++)
640 if (a.Find(b[i],Int64Identity)<0)
647 if (b.Find(a[i],Int64Identity)<0)
654 if (c.Find(a[i],Int64Identity)<0)
669 for (i=0; i<c.Count()-1; i++)
678 if (a.Find(c[i],Int64Identity)<0)
693 LOCAL_C TInt SEntrySpecificFindTests(TInt aCount, TInt aNumTests, TInt aRange)
699 for (n=0; n<aNumTests; n++)
701 RPointerArray<SEntry> a;
702 RPointerArray<SEntry> b;
703 RPointerArray<SEntry> c;
704 RPointerArray<SEntry> d;
706 for (i=0; i<aCount; i++)
708 TInt x=Random()&aRange;
710 SEntry& e = Entries[i];
715 b.InsertInOrderAllowRepeats(&e, &OrderSEntry);
716 d.InsertInOrderAllowRepeats(&e, &OrderSEntryU);
718 a.Sort(&OrderSEntry2);
719 c.Sort(&OrderSEntryU2);
720 test(a.Count()==aCount);
721 test(b.Count()==aCount);
722 test(c.Count()==aCount);
723 test(d.Count()==aCount);
724 for (i=0; i<aCount; i++)
729 for (i=-(aRange>>1); i<=(aRange>>1); ++i)
733 TInt first = a.SpecificFindInOrder(&es, &OrderSEntry, EArrayFindMode_First);
734 TInt last = a.SpecificFindInOrder(&es, &OrderSEntry, EArrayFindMode_Last);
735 TInt any = a.SpecificFindInOrder(&es, &OrderSEntry, EArrayFindMode_Any);
737 TInt first2 = a.SpecificFindInOrder(&es, fi, &OrderSEntry, EArrayFindMode_First);
738 TInt last2 = a.SpecificFindInOrder(&es, li, &OrderSEntry, EArrayFindMode_Last);
739 TInt any2 = a.SpecificFindInOrder(&es, ai, &OrderSEntry, EArrayFindMode_Any);
743 test(first == KErrNotFound);
746 test(first == first2);
747 test(first == last2);
751 test(li==aCount || a[li]->iKey>i);
752 test(li==0 || a[li-1]->iKey<i);
757 test(first2 == KErrNone);
758 test(last2 == KErrNone);
759 test(any2 == KErrNone);
763 test(a[fi]->iKey == i);
764 test(a[li-1]->iKey == i);
765 test(li==aCount || a[li]->iKey>i);
766 test(ai>=fi && ai<li);
767 test(a[ai]->iKey == i);
772 for (j=fi+1; j<li; ++j)
773 test(a[j]->iValue > a[j-1]->iValue);
777 for (i=-(aRange>>1); i<=(aRange>>1); ++i)
782 TInt first = c.SpecificFindInOrder(&eu, &OrderSEntryU, EArrayFindMode_First);
783 TInt last = c.SpecificFindInOrder(&eu, &OrderSEntryU, EArrayFindMode_Last);
784 TInt any = c.SpecificFindInOrder(&eu, &OrderSEntryU, EArrayFindMode_Any);
786 TInt first2 = c.SpecificFindInOrder(&eu, fi, &OrderSEntryU, EArrayFindMode_First);
787 TInt last2 = c.SpecificFindInOrder(&eu, li, &OrderSEntryU, EArrayFindMode_Last);
788 TInt any2 = c.SpecificFindInOrder(&eu, ai, &OrderSEntryU, EArrayFindMode_Any);
792 test(first == KErrNotFound);
795 test(first == first2);
796 test(first == last2);
800 test(li==aCount || TUint(c[li]->iKey)>u);
801 test(li==0 || TUint(c[li-1]->iKey)<u);
806 test(first2 == KErrNone);
807 test(last2 == KErrNone);
808 test(any2 == KErrNone);
812 test(c[fi]->iKey == i);
813 test(c[li-1]->iKey == i);
814 test(li==aCount || TUint(c[li]->iKey)>u);
815 test(ai>=fi && ai<li);
816 test(c[ai]->iKey == i);
821 for (j=fi+1; j<li; ++j)
822 test(c[j]->iValue > c[j-1]->iValue);
831 test.Printf(_L("ntot=%d nmiss=%d nrpt=%d\n"), ntot, nmiss, nrpt);
835 LOCAL_C TInt EntryInsertInOrderTest()
837 RPointerArray<SEntry> b;
838 RPointerArray<SEntry> c;
840 for (i=0; i<1024; i++)
846 b.InsertInOrderAllowRepeats(&Entries[i],SEntryOrder);
847 c.InsertInOrder(&Entries[i],SEntryOrder);
855 for (i=0; i<1024; i++)
864 if (e.iValue!=((i&31)<<5 | (i>>5)))
898 LOCAL_C TInt IntSortTest(TInt aCount, TInt aNumTests, TInt64 aMask)
901 for (n=0; n<aNumTests; n++)
903 RPointerArray<TInt64> a;
904 RPointerArray<TInt64> b;
906 for (i=0; i<aCount; i++)
908 Int64s[i]=Random64(aMask);
909 a.Append(&Int64s[i]);
910 b.InsertInOrderAllowRepeats(&Int64s[i],Int64Order);
913 if (a.Count()!=aCount)
919 if (b.Count()!=aCount)
925 for (i=0; i<aCount; i++)
940 LOCAL_C void TestGrowCompress(RPointerArray<TInt64>* a, ...)
942 SPointerArray& pa = *(SPointerArray*)a;
949 TInt action = VA_ARG(list, TInt);
952 TInt result = VA_ARG(list, TInt);
953 TInt orig = pa.iAllocated;
956 else if (action == -2)
957 a->GranularCompress();
958 else if (action == -3)
959 a->Remove(pa.iCount - 1);
963 for (i=0; i<action && r==KErrNone; ++i)
966 if ( (r<0 && (result!=r || pa.iAllocated!=orig)) || (r==0 && pa.iAllocated!=result) )
968 test.Printf(_L("Action %d Orig %d Expected %d r=%d newalloc=%d\n"), action, orig, result, r, pa.iAllocated);
975 LOCAL_C void TestGrowCompress()
977 RPointerArray<TInt64> a;
978 TestGrowCompress(&a, 1, 8, 7, 8, 1, 16, 7, 16, 1, 24, -2, 24, -1, 17, 1, 25, -2, 25, -3, 25, -2, 24, -99);
979 TestGrowCompress(&a, 1, 8, 7, 8, 1, 16, 7, 16, 1, 24, -2, 24, -1, 17, 1, 25, -2, 25, -3, 25, -3, 25, -2, 16, -99);
981 RPointerArray<TInt64> b(100);
982 TestGrowCompress(&b, 1, 100, 99, 100, 1, 200, 99, 200, 1, 300, -2, 300, -1, 201, 1, 301, -2, 301, -3, 301, -2, 300, -99);
983 TestGrowCompress(&b, 1, 100, 99, 100, 1, 200, 99, 200, 1, 300, -2, 300, -1, 201, 1, 301, -2, 301, -3, 301, -3, 301, -2, 200, -99);
985 RPointerArray<TInt64> c(8, 512);
986 TestGrowCompress(&c, 1, 8, 7, 8, 1, 16, 7, 16, 1, 32, 15, 32, 1, 64, -2, 40, 7, 40, 1, 80, -1, 41, -99);
988 RPointerArray<TInt64> d(20, 640);
989 TestGrowCompress(&d, 1, 20, 19, 20, 1, 50, 29, 50, 1, 125, -2, 60, -1, 51, -99);
991 RPointerArray<TInt64> e(8, 320);
992 TestGrowCompress(&e, 1, 8, 7, 8, 1, 16, 7, 16, 1, 24, 7, 24, 1, 32, 7, 32, 1, 40, 7, 40, 1, 50, 9, 50, 1, 63, -99);
994 RPointerArray<TInt64> f(2, 257);
995 TestGrowCompress(&f, 1, 2, 255, 256, 256, 512, 128, 640, 1, 643, 2, 643, 1, 646, -99);
998 GLDEF_C void DoPointerArrayTests()
1000 test.Start(_L("Pointer Arrays..."));
1001 test.Next(_L("Allocate memory"));
1002 Int64s=new TInt64[KArraySize];
1003 Entries=new SEntry[KArraySize];
1004 test(Int64s && Entries);
1006 test.Next(_L("AppendAndAccess tests..."));
1007 test.Next(_L("Count 10 Mask 0x0000000300000003"));
1008 test(IntAppendAndAccessTest(10,NUM_TESTS,MAKE_TINT64(0x3,0x3))==KErrNone);
1009 test.Next(_L("Count 100 Range all"));
1010 test(IntAppendAndAccessTest(100,NUM_TESTS,MAKE_TINT64(0xffffffff,0xffffffff))==KErrNone);
1012 test.Next(_L("Find tests..."));
1013 test.Next(_L("Count 10 Mask 0x0000000300000003"));
1014 test(IntFindTest(10,NUM_TESTS,MAKE_TINT64(3,3))==KErrNone);
1015 test.Next(_L("Count 100 Range all"));
1016 test(IntFindTest(100,NUM_TESTS,MAKE_TINT64(0xffffffff,0xffffffff))==KErrNone);
1017 test.Next(_L("SEntry find tests"));
1018 test(EntryFindTest(128,NUM_TESTS)==KErrNone);
1020 test.Next(_L("FindReverse tests..."));
1021 test.Next(_L("Count 10 Mask 0x0000000300000003"));
1022 test(IntFindReverseTest(10,NUM_TESTS,MAKE_TINT64(3,3))==KErrNone);
1023 test.Next(_L("Count 100 Range all"));
1024 test(IntFindReverseTest(100,NUM_TESTS,MAKE_TINT64(0xffffffff,0xffffffff))==KErrNone);
1025 test.Next(_L("SEntry find tests"));
1027 test(EntryFindReverseTest(128,NUM_TESTS)==KErrNone);
1029 test.Next(_L("FindInOrder tests..."));
1030 test.Next(_L("Count 20 Mask 0x00000003C0000000"));
1031 test(IntFindInOrderTest(20,NUM_TESTS,MAKE_TINT64(0x3,0xc0000000))==KErrNone);
1032 test.Next(_L("Count 100 Mask 0x0000000FF0000000"));
1033 test(IntFindInOrderTest(100,NUM_TESTS,MAKE_TINT64(0xf,0xf0000000))==KErrNone);
1034 test.Next(_L("SEntry FindInOrder test"));
1035 test(EntryFindInOrderTest(128,NUM_TESTS)==KErrNone);
1037 test.Next(_L("InsertInOrder tests..."));
1038 test.Next(_L("Count 50 Mask 0x00000003C0000000"));
1039 test(IntInsertInOrderTest(50,NUM_TESTS,MAKE_TINT64(0x3,0xc0000000))==KErrNone);
1040 test.Next(_L("Count 100 all"));
1041 test(IntInsertInOrderTest(100,NUM_TESTS,MAKE_TINT64(0xffffffff,0xffffffff))==KErrNone);
1042 test.Next(_L("SEntry InsertInOrder test"));
1043 test(EntryInsertInOrderTest()==KErrNone);
1045 test.Next(_L("Sort tests..."));
1046 test.Next(_L("Count 30 Mask 0x00000003C0000000"));
1047 test(IntSortTest(30,NUM_TESTS,MAKE_TINT64(0x3,0xc0000000))==KErrNone);
1048 test.Next(_L("Count 100 all"));
1049 test(IntSortTest(100,NUM_TESTS,MAKE_TINT64(0xffffffff,0xffffffff))==KErrNone);
1051 test.Next(_L("SEntrySpecificFindTests..."));
1052 test(SEntrySpecificFindTests(100, 10, 15)==KErrNone);
1053 test(SEntrySpecificFindTests(100, 10, 127)==KErrNone);
1055 test.Next(_L("Test Grow/Compress"));
1058 test.Next(_L("Test RPointerArray::Array..."));
1062 RPointerArray<TInt> ptrArr;
1067 TArray<TInt*> arr=ptrArr.Array();
1068 test(arr.Count()==3);
1080 GLDEF_C void DoPointerArrayLeavingInterfaceTest()
1084 for (TInt i=0;i<3;i++) Int64s[i] = i;
1086 RPointerArray<TInt64> pArray;
1087 CleanupClosePushL(pArray);
1089 test.Start(_L("Checking Leaving Pointer Arrays Interface..."));
1091 test.Next(_L("AppendL test..."));
1092 TRAP(trap, pArray.AppendL(&Int64s[0]));
1093 test(trap==KErrNone);
1095 test.Next(_L("InsertL test..."));
1096 TRAP(trap, pArray.InsertL(&Int64s[1],1));
1097 test(trap==KErrNone);
1099 test.Next(_L("Test FindL(const T* anEntry) const..."));
1100 TRAP(trap, ret = pArray.FindL(&Int64s[0]));
1103 TRAP(trap, ret = pArray.FindL(&Int64s[2]));
1104 test(trap==KErrNotFound);
1106 test.Next(_L("Test FindL(const T* anEntry, TIdentityRelation<T> anIdentity) const..."));
1107 TRAP(trap, ret = pArray.FindL(&Int64s[0],Int64Identity));
1110 TRAP(trap, ret = pArray.FindL(&Int64s[2],Int64Identity));
1111 test(trap==KErrNotFound);
1113 test.Next(_L("Test FindInAddressOrderL(const T* anEntry) const..."));
1114 TRAP(trap, ret = pArray.FindInAddressOrderL(&Int64s[0]));
1117 TRAP(trap, ret = pArray.FindInAddressOrderL(&Int64s[2]));
1118 test(trap==KErrNotFound);
1120 test.Next(_L("Test FindInOrderL(const T* anEntry, TLinearOrder<T> anOrder) const..."));
1121 TRAP(trap, ret = pArray.FindInOrderL(&Int64s[0], Int64Order));
1124 TRAP(trap, ret = pArray.FindInOrderL(&Int64s[2], Int64Order));
1125 test(trap==KErrNotFound);
1127 test.Next(_L("Test FindInAddressOrderL(const T* anEntry, TInt& anIndex) const..."));
1128 TRAP(trap, pArray.FindInAddressOrderL(&Int64s[0], ret));
1131 TRAP(trap, pArray.FindInAddressOrderL(&Int64s[2], ret));
1132 test(trap==KErrNotFound);
1134 test.Next(_L("Test FindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const..."));
1135 TRAP(trap, pArray.FindInOrderL(&Int64s[0], ret, Int64Order));
1138 TRAP(trap, pArray.FindInOrderL(&Int64s[2], ret, Int64Order));
1139 test(trap==KErrNotFound);
1141 test.Next(_L("Test SpecificFindInAddressOrderL(const T* anEntry, TInt aMode) const..."));
1142 TRAP(trap, ret = pArray.SpecificFindInAddressOrderL(&Int64s[0], EArrayFindMode_First));
1145 TRAP(trap, ret = pArray.SpecificFindInAddressOrderL(&Int64s[2], EArrayFindMode_First));
1146 test(trap==KErrNotFound);
1148 test.Next(_L("Test SpecificFindInOrderL(const T* anEntry, TLinearOrder<T> anOrder, TInt aMode) const..."));
1149 TRAP(trap, ret = pArray.SpecificFindInOrderL(&Int64s[0], Int64Order, EArrayFindMode_First));
1152 TRAP(trap, ret = pArray.SpecificFindInOrderL(&Int64s[2], Int64Order, EArrayFindMode_First));
1153 test(trap==KErrNotFound);
1155 test.Next(_L("Test SpecificFindInAddressOrderL(const T* anEntry, TInt& anIndex, TInt aMode) const..."));
1156 TRAP(trap, pArray.SpecificFindInAddressOrderL(&Int64s[0], ret, EArrayFindMode_First));
1159 TRAP(trap, pArray.SpecificFindInAddressOrderL(&Int64s[2], ret, EArrayFindMode_First));
1160 test(trap==KErrNotFound);
1162 test.Next(_L("Test SpecificFindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const..."));
1163 TRAP(trap, pArray.SpecificFindInOrderL(&Int64s[0], ret, Int64Order, EArrayFindMode_First));
1166 TRAP(trap, pArray.SpecificFindInOrderL(&Int64s[2], ret, Int64Order, EArrayFindMode_First));
1167 test(trap==KErrNotFound);
1169 test.Next(_L("Test InsertInAddressOrderL(const T* anEntry)..."));
1170 TRAP(trap, pArray.InsertInAddressOrderL(&Int64s[0]));
1171 test(trap==KErrAlreadyExists);
1172 TRAP(trap, pArray.InsertInAddressOrderL(&Int64s[2]));
1173 test(trap==KErrNone);
1176 test.Next(_L("Test InsertInOrderL(const T* anEntry, TLinearOrder<T> anOrder)..."));
1177 TRAP(trap, pArray.InsertInOrderL(&Int64s[0], Int64Order));
1178 test(trap==KErrAlreadyExists);
1179 TRAP(trap, pArray.InsertInOrderL(&Int64s[2], Int64Order));
1180 test(trap==KErrNone);
1183 test.Next(_L("Test InsertInAddressOrderAllowRepeatsL(const T* anEntry)..."));
1184 TRAP(trap, pArray.InsertInAddressOrderAllowRepeatsL(&Int64s[2]));
1185 test(trap==KErrNone);
1188 test.Next(_L("Test InsertInOrderAllowRepeatsL(const T* anEntry, TLinearOrder<T> anOrder)..."));
1189 TRAP(trap, pArray.InsertInOrderAllowRepeatsL(&Int64s[2], Int64Order));
1190 test(trap==KErrNone);
1193 CleanupStack::PopAndDestroy(&pArray);