phonebookengines/contactsmodel/tsrc/cntmodel2/T_CProgressNotificationMain.cpp
changeset 0 e686773b3f54
child 24 0ba2181d7c28
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     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_CProgressNotification.h"
       
    18 
       
    19 LOCAL_C void DoTestsL()
       
    20 	{
       
    21 
       
    22   	__UHEAP_MARK;
       
    23 	CProgressNotificationTest* cntTest = CProgressNotificationTest::NewLC();
       
    24 
       
    25 	cntTest->AddContactsL(100);
       
    26 	
       
    27 #if defined(_DEBUG)
       
    28 	//Only valid in udeb build
       
    29 	cntTest->RunRecoverNotifyTestL();
       
    30 
       
    31 #ifndef __SYMBIAN_CNTMODEL_USE_SQLITE__
       
    32 	cntTest->RunRecoverNotifyCancelTestL();
       
    33 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
       
    34 
       
    35 #endif //_DEBUG
       
    36 	
       
    37 	cntTest->RunCompressNotifyTestL();
       
    38 	cntTest->RunCompressNotifyCancelTestL();
       
    39 	cntTest->DeleteContactsL(100);
       
    40 
       
    41 	CleanupStack::PopAndDestroy(cntTest);
       
    42 	cntTest	   = NULL;
       
    43     __UHEAP_MARKEND;	
       
    44 	
       
    45 	}
       
    46 
       
    47 
       
    48 GLDEF_C TInt E32Main()
       
    49 	{
       
    50     // Init
       
    51     CTrapCleanup* cleanupStack = CTrapCleanup::New();
       
    52   	if (!cleanupStack)
       
    53       return KErrNoMemory;
       
    54         
       
    55     CActiveScheduler* activeScheduler = new CActiveScheduler;
       
    56     if (!activeScheduler)
       
    57         return KErrNoMemory;
       
    58     CActiveScheduler::Install(activeScheduler);
       
    59 
       
    60     // Run the tests
       
    61     __UHEAP_MARK;
       
    62     TRAPD(err, DoTestsL());
       
    63     User::LeaveIfError(err);
       
    64     __UHEAP_MARKEND;
       
    65 
       
    66 		
       
    67     // Cleanup
       
    68     delete activeScheduler;
       
    69  	delete cleanupStack;
       
    70 	activeScheduler = NULL;
       
    71 	cleanupStack = NULL;
       
    72 	
       
    73 	return err;
       
    74     }