Пример #1
0
TVerdict CTestExNoBDay::doTestStepL()
/**
 * @return - TVerdict code
 * Override of base class pure virtual
 */
	{
	SetTestStepResult(EFail);
    
    // test codes
	// Export an vCard with the current universal time
    TBuf<90> pathVCF(KExportNoBDayFile);
	ExportItemL(pathVCF, EFalse);
    
    // read from the disk.
    ImportItemL(pathVCF, ETrue);
	
	if(iBDayFromImport == NULL) 
			{
			INFO_PRINTF1(_L("Imported Birthday is NULL (correct), as exported without BDAY"));
			SetTestStepResult(EPass);
			}
		else
			{
			INFO_PRINTF1(_L("Imported Birthday is NOT NULL (incorrect)"));
			SetTestStepResult(EFail);
			}	
			
	return TestStepResult();
	}
Пример #2
0
TVerdict CTestImpNoBDay::doTestStepL()
/**
 * @return - TVerdict code
 * Override of base class pure virtual
 */
	{
	SetTestStepResult(EFail);
		
	for (TInt i =0; i<2; i++)
		{
		INFO_PRINTF2(_L("TEST: %d"), i+1);
		// test codes
		TBuf<90> pathVCF(KPathImportNoBDay);
		OpenBDAYVCFAndImportItemL(pathVCF, i); // Imports vcf 

		// checks if Imported Birthday is NULL
		if(iBDayFromImport == NULL) 
			{
			INFO_PRINTF1(_L("Imported Birthday is NULL (correct)"));
			SetTestStepResult(EPass);
			}
		else
			{
			INFO_PRINTF1(_L("Imported Birthday is NOT NULL (incorrect)"));
			SetTestStepResult(EFail);
			return TestStepResult();
			}	
		}
	
	return TestStepResult();
	}
Пример #3
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();
	}
Пример #4
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();
	}
Пример #5
0
TVerdict CTestExBDayLocal::doTestStepL()
/**
 * @return - TVerdict code
 * Override of base class pure virtual
 */
	{
	SetTestStepResult(EFail);
	
	TInt numberOfCases = 0;
	
	while (ETrue)
		{
		TPtrC ptrBDay = GetBDayL(numberOfCases);
		if(ptrBDay==KNullDesC)
			{
			break;	
			}
		
		INFO_PRINTF2(_L("TEST: %d"), numberOfCases+1);
				
		iBDayLocal = FormatDateTime(ptrBDay);
		TDateTime t = iBDayLocal.DateTime();
		INFO_PRINTF7(_L("Birthday to be exported, Year: %d, Month: %d, Day: %d, Hr: %d, Min: %d, Sec: %d"), t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second());
				
		iName = GetNameL(numberOfCases);
		
		iPhone = GetPhoneL(numberOfCases);
		
		TBuf<90> pathVCF(KExportBDayFile);
		ExportItemL(pathVCF, ETrue);
		// read from the disk.
		ImportItemL(pathVCF, ETrue);
		
		if(!CheckImportedBDay())
			{
			SetTestStepResult(EFail);
			return TestStepResult();
			}
			
		numberOfCases++;
		}// End Of While Loop
		
	SetTestStepResult(EPass);
	return TestStepResult();
	}
Пример #6
0
TVerdict CTestExRevUTC::doTestStepL()
/**
 * @return - TVerdict code
 * Override of base class pure virtual
 */
	{
	SetTestStepResult(EFail);
	
	TBuf<90> pathVCF(KExportRevUTCFile);
	ExportItemL(pathVCF, EFalse);
	
	// read from the disk.
	ImportItemL(pathVCF,EFalse);
	TDateTime t = iRecordedTime.DateTime();
	TDateTime t1 = iTimeFromImport.DateTime();
	
	INFO_PRINTF7(_L("Recorded Last Modified Date Year: %d, Month: %d, Day: %d, Recorded Time Hr: %d, Min: %d, Sec: %d "), t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second());
	INFO_PRINTF7(_L("Imported Last Modified Date Year: %d, Month: %d, Day: %d, Imported Time Hr: %d, Min: %d, Sec: %d "), t1.Year(), t1.Month(), t1.Day(), t1.Hour(), t1.Minute(), t1.Second());
	
	TTimeIntervalSeconds secondsDifference;
	User::LeaveIfError(iTimeFromImport.SecondsFrom(iRecordedTime, secondsDifference));
	TInt difference = secondsDifference.Int();
	
	if (difference < 2 && difference > -2)
		{
		INFO_PRINTF1(_L("Recorded and Imported DateTime match"));
		SetTestStepResult(EPass);
		}
	else
		{
		INFO_PRINTF1(_L("Recorded and Imported DateTime does not match"));
		SetTestStepResult(EFail);
		}
		
	return TestStepResult();
	}