pimappservices/calendar/tsrc/TestCalIndexFile/src/TestCalIndexFilePerfStep.cpp
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 // Copyright (c) 2006-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 "TestCalIndexFilePerfStep.h"
       
    17 #include <fbs.h>
       
    18 #include <e32math.h>
       
    19 #include <calcategory.h>
       
    20 #include <caldataexchange.h>
       
    21 #include <caldataformat.h>
       
    22 #include <calsession.h>
       
    23 #include <s32file.h>
       
    24 
       
    25 
       
    26 CTestCalIndexFilePerfStep::~CTestCalIndexFilePerfStep()
       
    27 /**
       
    28  * Destructor
       
    29  */
       
    30 	{
       
    31 	}
       
    32 
       
    33 CTestCalIndexFilePerfStep::CTestCalIndexFilePerfStep()
       
    34 /**
       
    35  * Constructor
       
    36  */
       
    37 	{
       
    38 	SetTestStepName(KTestCalIndexFilePerfStep);
       
    39 	}
       
    40 
       
    41 TVerdict CTestCalIndexFilePerfStep::doTestStepPostambleL()
       
    42 	{
       
    43 	return TestStepResult();
       
    44 	}
       
    45 
       
    46 TVerdict CTestCalIndexFilePerfStep::doTestStepL()
       
    47 	{
       
    48 	// this method assumes a pass. Checks that fail will stop
       
    49 	// the test step
       
    50 	SetUpCalDirL();
       
    51 	
       
    52 	// check if we can open the agenda and have the index file
       
    53 	// created
       
    54 	AddCalendarFileL();
       
    55 	OpenAgendaL();
       
    56 	if (!ValidateDbContentsL())
       
    57 		{
       
    58 		INFO_PRINTF1(_L("Open Step Failed validating DB contents without idx file"));
       
    59 		CloseAgendaL();
       
    60 		SetTestStepResult(EFail);
       
    61 		return EFail;
       
    62 		}	
       
    63 	CloseAgendaL();
       
    64 	if (!CheckIndexFilePresentL())
       
    65 		{
       
    66 		INFO_PRINTF1(_L("Open Step Failed - no index file created"));
       
    67 		SetTestStepResult(EFail);
       
    68 		return EFail;
       
    69 		}
       
    70 		
       
    71 	// check if we can open with the index file present
       
    72 	OpenAgendaL();
       
    73 	if (!ValidateDbContentsL())
       
    74 		{
       
    75 		INFO_PRINTF1(_L("Open Step Failed validating DB contents with idx file"));
       
    76 		CloseAgendaL();
       
    77 		SetTestStepResult(EFail);
       
    78 		return EFail;
       
    79 		}	
       
    80 	CloseAgendaL();
       
    81 	
       
    82 	SetTestStepResult(EPass);
       
    83 	return EPass;
       
    84 	}