kernel/eka/euser/epoc/win32/uc_epoc.cpp
branchanywhere
changeset 96 428c5911a502
parent 95 f561f9ae805b
child 101 86a1781f0e9b
--- a/kernel/eka/euser/epoc/win32/uc_epoc.cpp	Tue Apr 27 20:22:55 2010 +0200
+++ b/kernel/eka/euser/epoc/win32/uc_epoc.cpp	Wed Apr 28 00:44:14 2010 +0200
@@ -28,11 +28,21 @@
 //For now we use this for basic testing on our SYMC implementation
 
 
-GLDEF_C void MainL()
+class CBaseTest: public CBase
 	{
 
+	};
+
+
+GLDEF_C void MainL()
+	{
+	
+	CBase* other=new(ELeave) CBase();
+	CleanupStack::PushL(other);
 	CBase* base=new(ELeave) CBase();
-	delete base;
+	CleanupStack::PushL(base);
+	CleanupStack::PopAndDestroy(2,other);
+	//delete base;
 	
 	//Testing cleanup stack
 	TRAPD(err,
@@ -50,7 +60,10 @@
 	);
 
 	ASSERT(err==KErrNoMemory);
-
+	
+	//Testing unbalanced cleanup stack
+	//base=new(ELeave) CBase();
+	//CleanupStack::PushL(base);
 	}
 
 
@@ -64,6 +77,15 @@
 	CBase* base=new CBase();
 	delete base;
 
+	CBaseTest* baseTest=new CBaseTest();
+	delete baseTest;
+
+	HBufC* buf=HBufC::New(10);
+	delete buf;
+
+	CArrayFix<TInt>* active=new CArrayFixFlat<TInt>(10);
+	delete active;
+
 	TUint8* test=new TUint8[1024*9];
 	delete[] test;
 
@@ -73,7 +95,8 @@
 		return KErrNoMemory;
 		}
 
-	TRAPD(err,MainL());
+	TInt err=KErrNone;
+	TRAP(err,MainL());
 
 	delete cleanupStack;