int main() {
  assert(testFix() == 0);
  return 0;
}
Example #2
0
GLDEF_C TInt E32Main()
//
// Test the Array classes.
//
    {

	test.Title();
	__UHEAP_MARK;
	test.Start(_L("class CArrayFixFlat"));
	CArrayFixFlat<TBuf<0x10> >* pFixFlat=new CArrayFixFlat<TBuf<0x10> >(KTestGranularity);
	if (pFixFlat==NULL)
		test.Panic(_L("Allocating array"));
	testFix(*pFixFlat);
	delete pFixFlat;

	CArrayFixFlat<TText>* pFixFlatChar=new CArrayFixFlat<TText>(KTestGranularity);
	test1(*pFixFlatChar);
	delete pFixFlatChar; 
		
	CArrayFixFlat<TArr<TText,4> >* pFixFlatArr=new CArrayFixFlat<TArr<TText,4> >(KTestGranularity);
	test2(*pFixFlatArr);
	delete pFixFlatArr;

	CArrayFixFlat<TInt>* pFixFlatInt=new CArrayFixFlat<TInt>(KTestGranularity);
	test3(*pFixFlatInt);
	delete pFixFlatInt;
	
	CArrayFixFlat<TUid>* pFixFlatTUid=new CArrayFixFlat<TUid>(KTestGranularity);
	if (pFixFlatTUid==NULL)
		{
	    test.Panic(_L("Allocating array of TUid"));
		}
	delete pFixFlatTUid; 

	test.Next(_L("class CArrayPtrFlat of CBase"));
	
	CArrayPtrFlat<MyCBase>* pPtrFlatCBase=new CArrayPtrFlat<MyCBase>(KTestGranularity); 
	if (pPtrFlatCBase==NULL)
		test.Panic(_L("Allocating array of CBase*"));
	MyCBase* c1 = new MyCBase();
	pPtrFlatCBase->InsertL(0,&c1,1);
	pPtrFlatCBase->ResetAndDestroy();
//	test(pFixFlatCBase->iBase==0);
	pPtrFlatCBase->ResetAndDestroy();
	delete pPtrFlatCBase;

	test.Next(_L("class CArrayFixFlat of CBase"));
	
	CArrayFixFlat<MyCBase>* pFixFlatCBase=new CArrayFixFlat<MyCBase>(KTestGranularity); 
	if (pFixFlatCBase==NULL)
		test.Panic(_L("Allocating array of CBase"));
	delete pFixFlatCBase;

	test.Next(_L("class CArrayFixSeg"));
	CArrayFixSeg<TBuf<0x10> >* pFixSeg=new CArrayFixSeg<TBuf<0x10> >(KTestGranularity);
	if (pFixSeg==NULL)
		test.Panic(_L("Allocating array"));
	testFix(*pFixSeg);
	delete pFixSeg;

	CArrayFixSeg<TText>* pFixSegChar=new CArrayFixSeg<TText>(KTestGranularity);
	test1(*pFixSegChar);
	delete pFixSegChar; 
		
	CArrayFixSeg<TArr<TText,4> >* pFixSegArr=new CArrayFixSeg<TArr<TText,4> >(KTestGranularity);
	test2(*pFixSegArr);
	delete pFixSegArr;

	CArrayFixSeg<TInt>* pFixSegInt=new CArrayFixSeg<TInt>(KTestGranularity);
	test3(*pFixSegInt);
	delete pFixSegInt;

	test.End();
	__UHEAP_MARKEND;
	return(0);
    }