예제 #1
0
// Each test step must supply a implementation for doTestStepL
enum TVerdict CTestAgendaAddAppt::doTestStepL( void )
	{
	// Printing to the console and log file
	INFO_PRINTF1(_L("TEST-> ADDING APPOINTMENT ENTRIES"));

	OpenDatabaseL();
	if ( TestStepResult() == EPass )
		{
		TRAPD(r, AddEntriesL());
		if (r!=KErrNone)
			SetTestStepResult(EFail);
		}
	CleanupDatabase();

	// test steps return a result
	return TestStepResult();
	}
/**
* Function which performs addition, update and deletion of the entries.
@param aDeleteFlag Flag to perform different delete operations like delete by reference,
*				   delete by uid, local uid and delete by instances.
*/
void CTestCalInterimApiModifier::AddModifyDeleteEntriesL(const TPtrC& aDeleteFlag)
	{
	TBool addEntriesFlag = EFalse;
	iTestStep->GetBoolFromConfig(iTestStep->ConfigSection(), KAddEntriesFlag, addEntriesFlag);
	// If this flag is set, then add the entries in the calendar file
	if( addEntriesFlag )
		{
		AddEntriesL();
		}

	TBool updateEntriesFlag = EFalse;
	iTestStep->GetBoolFromConfig(iTestStep->ConfigSection(), KUpdateEntriesFlag, updateEntriesFlag);
	// If this flag is set, then update the entries in the calendar file
	if( updateEntriesFlag )
		{
		UpdateEntriesL();
		}

	TBool deleteEntriesFlag = EFalse;
	iTestStep->GetBoolFromConfig(iTestStep->ConfigSection(), KDeleteEntriesFlag, deleteEntriesFlag);
	// If this flag is set, then delete the entries in the calendar file
	if( deleteEntriesFlag )
		{
		if ( !aDeleteFlag.Compare(KDeleteByInstances) )
			{
			DeleteInstancesL();
			}
		if( !aDeleteFlag.Compare(KDeleteByLocalUids) )
			{
			DeleteEntriesByArrayOfLocalUidsL();
			}
		else if( !aDeleteFlag.Compare(KDeleteByReference) )
			{
			DeleteEntriesByReferenceL();
			}
		else if ( !aDeleteFlag.Compare(KDeleteByTimeRange) )
			{
			DeleteEntriesByTimeRangeL();
			}
		else // DeleteByUid
			{
			DeleteEntriesByUidListL();
			}
		}
	}