Ejemplo n.º 1
0
TVerdict CTestImpBDay::doTestStepL()
/**
 * @return - TVerdict code
 * Override of base class pure virtual
 */
	{
	SetTestStepResult(EFail);
	
	TInt numberOfCases = 0;
	
	while(ETrue)
		{
		TBuf<90> config(KImportBDay);
		TPtrC ptrexpUTC = GetExpectedUTCFromIniL(numberOfCases, config, ETrue);
		if(ptrexpUTC==KNullDesC)
			{
			break;	
			}
			
		INFO_PRINTF2(_L("TEST: %d"), numberOfCases+1);
		iExpectedBDay = FormatDateTime(ptrexpUTC);
		TBuf<90> pathVCF(KPathImportBDay);
		OpenBDAYVCFAndImportItemL(pathVCF, numberOfCases); // Imports vcf 
	
		TDateTime importedDateTime = iBDayFromImport.DateTime();
		TDateTime expectedDateTime = iExpectedBDay.DateTime();
	
		// If birthday does not match, test will fail
		if((importedDateTime.Year() != expectedDateTime.Year()) ||     
		   (importedDateTime.Month() != expectedDateTime.Month()) ||
		   (importedDateTime.Day() != expectedDateTime.Day()) )
			{
			INFO_PRINTF1(_L("Imported Birthday not correct"));
		   	SetTestStepResult(EFail);
		   	return TestStepResult();
			}
		else
			{
			INFO_PRINTF1(_L("Imported Birthday as expected"));
			SetTestStepResult(EPass);
			}
			
		numberOfCases++;
		}
		
	return TestStepResult();
	}
Ejemplo n.º 2
0
TVerdict CTestImpRevLocal::doTestStepL()
/**
 * @return - TVerdict code
 * Override of base class pure virtual
 */
	{
	SetTestStepResult(EFail);
	
	TInt numberOfCases = 0;
	
	while(ETrue)
		{
		TBuf<90> config(KImportRevLocal);
		TPtrC ptrexpUTC = GetExpectedUTCFromIniL(numberOfCases, config, EFalse);
		if(ptrexpUTC==KNullDesC)
			{
			break;	
			}
			
		INFO_PRINTF2(_L("TEST: %d"), numberOfCases+1);
		iExpectedUTC = FormatDateTime(ptrexpUTC);
		TBuf<80> pathVCF(KPathImportRevLocal);
		OpenVCFAndImportItemL(pathVCF, iFsSession, numberOfCases); // Imports vcf 
	
		TDateTime t = iTimeFromImport.DateTime();
		TDateTime t1 = iExpectedUTC.DateTime();
		INFO_PRINTF7(_L("Imported Date Year: %d, Month: %d, Day: %d, Imported Time Hr: %d, Min: %d, Sec: %d "), t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second());
		INFO_PRINTF7(_L("Expected Date Year: %d, Month: %d, Day: %d, Expected Time Hr: %d, Min: %d, Sec: %d "), t1.Year(), t1.Month(), t1.Day(), t1.Hour(), t1.Minute(), t1.Second());
	
		if (iExpectedUTC==iTimeFromImport) // checks if imported time is correct
			{
			INFO_PRINTF1(_L("Imported Time as local (correct)"));
			SetTestStepResult(EPass);	
			}
		else
			{
			INFO_PRINTF1(_L("Imported Time not imported as local (NOT CORRECT)"));
			SetTestStepResult(EFail);
			return TestStepResult();
			}
		
		numberOfCases++;
		}

	return TestStepResult();
	}