kernel/eka/euser/epoc/win32/uc_epoc.cpp
branchanywhere
changeset 95 f561f9ae805b
parent 94 f36eb4948686
child 96 428c5911a502
equal deleted inserted replaced
94:f36eb4948686 95:f561f9ae805b
    23 #include <nwdl.h>
    23 #include <nwdl.h>
    24 
    24 
    25 #if defined __SYMC__
    25 #if defined __SYMC__
    26 
    26 
    27 //SL: Empty on FCL ?
    27 //SL: Empty on FCL ?
       
    28 //For now we use this for basic testing on our SYMC implementation
       
    29 
       
    30 
       
    31 GLDEF_C void MainL()
       
    32 	{
       
    33 
       
    34 	CBase* base=new(ELeave) CBase();
       
    35 	delete base;
       
    36 	
       
    37 	//Testing cleanup stack
       
    38 	TRAPD(err,
       
    39 	base=new(ELeave) CBase();
       
    40 	CleanupStack::PushL(base);
       
    41 	User::Leave(KErrCancel);
       
    42 	);
       
    43 
       
    44 	ASSERT(err==KErrCancel);
       
    45 
       
    46 	//Testing alloc failure
       
    47 	TRAP(err,
       
    48 	TUint8* test=new(ELeave) TUint8[1024*1024*10];
       
    49 	delete[] test;
       
    50 	);
       
    51 
       
    52 	ASSERT(err==KErrNoMemory);
       
    53 
       
    54 	}
    28 
    55 
    29 
    56 
    30 GLDEF_C TInt E32Main()
    57 GLDEF_C TInt E32Main()
    31 	{
    58 	{
    32 	//What do we do then
    59 	//What do we do then
    38 	delete base;
    65 	delete base;
    39 
    66 
    40 	TUint8* test=new TUint8[1024*9];
    67 	TUint8* test=new TUint8[1024*9];
    41 	delete[] test;
    68 	delete[] test;
    42 
    69 
       
    70 	CTrapCleanup* cleanupStack = CTrapCleanup::New();
       
    71 	if (!cleanupStack)
       
    72 		{
       
    73 		return KErrNoMemory;
       
    74 		}
       
    75 
       
    76 	TRAPD(err,MainL());
       
    77 
       
    78 	delete cleanupStack;
       
    79 
    43 	__UHEAP_MARKEND;
    80 	__UHEAP_MARKEND;
    44 
    81 
    45 	return KErrNone;
    82 	return err;
    46 	}
    83 	}
    47 
    84 
    48 
    85 
    49 TInt main()
    86 TInt main()
    50 	{
    87 	{