phonebookengines_old/contactsmodel/tsrc/cntmodel2/T_CStatesTestMain.cpp
branchRCL_3
changeset 19 5b6f26637ad3
equal deleted inserted replaced
18:d4f567ce2e7c 19:5b6f26637ad3
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <e32test.h>
       
    17 #include "T_CStatesTest.h"
       
    18 
       
    19 LOCAL_C void DoTestsL()
       
    20 	{
       
    21 
       
    22 	COpenCommitTest* cntTest = COpenCommitTest::NewLC();
       
    23    	
       
    24   	__UHEAP_MARK;	
       
    25 	cntTest->RunOpenCommitTestL();
       
    26 	cntTest->RunGroupTestL();
       
    27     __UHEAP_MARKEND;
       
    28 	
       
    29 	CleanupStack::PopAndDestroy(cntTest);
       
    30 	cntTest	   = NULL;
       
    31 
       
    32 
       
    33 	}
       
    34 
       
    35 
       
    36 
       
    37 
       
    38 GLDEF_C TInt E32Main()
       
    39 	{
       
    40     // Init
       
    41     CTrapCleanup* cleanupStack = CTrapCleanup::New();
       
    42   	if (!cleanupStack)
       
    43       return KErrNoMemory;
       
    44         
       
    45     CActiveScheduler* activeScheduler = new CActiveScheduler;
       
    46     if (!activeScheduler)
       
    47         return KErrNoMemory;
       
    48     CActiveScheduler::Install(activeScheduler);
       
    49 
       
    50     // Run the tests
       
    51     __UHEAP_MARK;
       
    52     TRAPD(err, DoTestsL());
       
    53     __UHEAP_MARKEND;
       
    54 
       
    55 		
       
    56     // Cleanup
       
    57     delete activeScheduler;
       
    58  	delete cleanupStack;
       
    59 	activeScheduler = NULL;
       
    60 	cleanupStack = NULL;
       
    61 	
       
    62 	return err;
       
    63     }