kerneltest/e32test/buffer/t_farray.cpp
branchRCL_3
changeset 44 3e88ff8f41d5
parent 43 c1f20ce4abcf
equal deleted inserted replaced
43:c1f20ce4abcf 44:3e88ff8f41d5
   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 	    }
       
   184 	}
   160 	}
   185 
   161 
   186 LOCAL_C void test1(CArrayFix<TText>& aFix)
   162 LOCAL_C void test1(CArrayFix<TText>& aFix)
   187 //
   163 //
   188 	{
   164 	{
   364 	delete pFixFlatArr;
   340 	delete pFixFlatArr;
   365 
   341 
   366 	CArrayFixFlat<TInt>* pFixFlatInt=new CArrayFixFlat<TInt>(KTestGranularity);
   342 	CArrayFixFlat<TInt>* pFixFlatInt=new CArrayFixFlat<TInt>(KTestGranularity);
   367 	test3(*pFixFlatInt);
   343 	test3(*pFixFlatInt);
   368 	delete pFixFlatInt;
   344 	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; 
       
   376 
   345 
   377 	test.Next(_L("class CArrayPtrFlat of CBase"));
   346 	test.Next(_L("class CArrayPtrFlat of CBase"));
   378 	
   347 	
   379 	CArrayPtrFlat<MyCBase>* pPtrFlatCBase=new CArrayPtrFlat<MyCBase>(KTestGranularity); 
   348 	CArrayPtrFlat<MyCBase>* pPtrFlatCBase=new CArrayPtrFlat<MyCBase>(KTestGranularity); 
   380 	if (pPtrFlatCBase==NULL)
   349 	if (pPtrFlatCBase==NULL)