kerneltest/e32test/buffer/t_farray.cpp
changeset 247 d8d70de2bd36
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
201:43365a9b78a3 247:d8d70de2bd36
   155 			TInt seglen=ptr-bak;
   155 			TInt seglen=ptr-bak;
   156 			test(seglen==KTestGranularity || seglen==index3 || seglen==index3%KTestGranularity);
   156 			test(seglen==KTestGranularity || seglen==index3 || seglen==index3%KTestGranularity);
   157 			}
   157 			}
   158 		test(&aFix[index3-1]==--ptr);
   158 		test(&aFix[index3-1]==--ptr);
   159 		}
   159 		}
       
   160 	
       
   161 	//Test ExpandL
       
   162 	//Expand array in slot 1
       
   163 	TBuf16<0x10> exp;
       
   164 	exp=_L("abc AbC");
       
   165 	aFix.InsertL(0,exp);
       
   166 	aFix.InsertL(1,exp);
       
   167 	aFix.InsertL(2,exp);
       
   168 	exp=aFix.ExpandL(1);
       
   169 	test(aFix[0]==_L("abc AbC"));
       
   170 	test(aFix[1]==_L(""));
       
   171 	test(aFix[2]==_L("abc AbC"));
       
   172 	test(aFix[3]==_L("abc AbC"));
       
   173 	
       
   174 	//Test ResizeL and InsertReplL
       
   175 	//Resize the array to containing 20 records,
       
   176 	//copying a record into any new slots.
       
   177 	TBuf<0x10> res(_L("bbbbb"));
       
   178 	aFix.Reset();
       
   179 	aFix.ResizeL(20,res);
       
   180 	for(TInt i=0;i<20;i++)
       
   181 	    {
       
   182         test(aFix[1]==_L("bbbbb"));
       
   183 	    }
   160 	}
   184 	}
   161 
   185 
   162 LOCAL_C void test1(CArrayFix<TText>& aFix)
   186 LOCAL_C void test1(CArrayFix<TText>& aFix)
   163 //
   187 //
   164 	{
   188 	{
   340 	delete pFixFlatArr;
   364 	delete pFixFlatArr;
   341 
   365 
   342 	CArrayFixFlat<TInt>* pFixFlatInt=new CArrayFixFlat<TInt>(KTestGranularity);
   366 	CArrayFixFlat<TInt>* pFixFlatInt=new CArrayFixFlat<TInt>(KTestGranularity);
   343 	test3(*pFixFlatInt);
   367 	test3(*pFixFlatInt);
   344 	delete pFixFlatInt;
   368 	delete pFixFlatInt;
       
   369 	
       
   370 	CArrayFixFlat<TUid>* pFixFlatTUid=new CArrayFixFlat<TUid>(KTestGranularity);
       
   371 	if (pFixFlatTUid==NULL)
       
   372 		{
       
   373 	    test.Panic(_L("Allocating array of TUid"));
       
   374 		}
       
   375 	delete pFixFlatTUid; 
   345 
   376 
   346 	test.Next(_L("class CArrayPtrFlat of CBase"));
   377 	test.Next(_L("class CArrayPtrFlat of CBase"));
   347 	
   378 	
   348 	CArrayPtrFlat<MyCBase>* pPtrFlatCBase=new CArrayPtrFlat<MyCBase>(KTestGranularity); 
   379 	CArrayPtrFlat<MyCBase>* pPtrFlatCBase=new CArrayPtrFlat<MyCBase>(KTestGranularity); 
   349 	if (pPtrFlatCBase==NULL)
   380 	if (pPtrFlatCBase==NULL)