phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/src/TestImpRevLocalTZ.cpp
changeset 0 e686773b3f54
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 "TestImpRevLocalTZ.h"
       
    17 
       
    18 CTestImpRevLocalTZ::~CTestImpRevLocalTZ()
       
    19 /**
       
    20  * Destructor
       
    21  */
       
    22 	{
       
    23 	}
       
    24 
       
    25 CTestImpRevLocalTZ::CTestImpRevLocalTZ()
       
    26 /**
       
    27  * Constructor
       
    28  */
       
    29 	{
       
    30 	// **MUST** call SetTestStepName in the constructor as the controlling
       
    31 	// framework uses the test step name immediately following construction to set
       
    32 	// up the step's unique logging ID.
       
    33 	SetTestStepName(KTestImpRevLocalTZ);
       
    34 	}
       
    35 
       
    36 TVerdict CTestImpRevLocalTZ::doTestStepPreambleL()
       
    37 /**
       
    38  * @return - TVerdict code
       
    39  * Override of base class virtual
       
    40  */
       
    41 	{
       
    42 	INFO_PRINTF1(KCITFSIE4);
       
    43 	INFO_PRINTF1(_L("Start Import of vCards (REV with TZ property) Tests"));
       
    44 	
       
    45 	iScheduler = new (ELeave) CActiveScheduler;
       
    46 	CActiveScheduler::Install(iScheduler);
       
    47 	
       
    48 	SetTestStepResult(EPass);
       
    49 	return TestStepResult();
       
    50 	}
       
    51 
       
    52 TVerdict CTestImpRevLocalTZ::doTestStepL()
       
    53 /**
       
    54  * @return - TVerdict code
       
    55  * Override of base class pure virtual
       
    56  */
       
    57 	{
       
    58     SetTestStepResult(EFail);	       
       
    59 	
       
    60 	TInt numberOfCases = 0;
       
    61 
       
    62 	while(ETrue)
       
    63 		{
       
    64 		TBuf<90> config(KImportRevLocalTZ);
       
    65 		TPtrC ptrexpUTC = GetExpectedUTCFromIniL(numberOfCases, config, EFalse);
       
    66 		if(ptrexpUTC==KNullDesC)
       
    67 			{
       
    68 			break;	
       
    69 			}
       
    70 			
       
    71 		INFO_PRINTF2(_L("TEST: %d"), numberOfCases+1);
       
    72 		iExpectedUTC = FormatDateTime(ptrexpUTC);
       
    73 		TBuf<90> pathVCF(KPathImportRevLocalTZ);
       
    74 		OpenVCFAndImportItemL(pathVCF, iFsSession, numberOfCases); // Imports vcf 
       
    75 
       
    76 		TDateTime t = iTimeFromImport.DateTime();
       
    77 		TDateTime t1 = iExpectedUTC.DateTime();
       
    78 		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());
       
    79 		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());
       
    80 	
       
    81 		if (iExpectedUTC==iTimeFromImport) // checks if imported time is correct
       
    82 			{
       
    83 			INFO_PRINTF1(_L("Imported Time is correct"));
       
    84 			SetTestStepResult(EPass);	
       
    85 			}
       
    86 		else
       
    87 			{
       
    88 			INFO_PRINTF1(_L("Imported Time is NOT correct"));
       
    89 			SetTestStepResult(EFail);
       
    90 			return TestStepResult();
       
    91 			}
       
    92 			
       
    93 		numberOfCases++;
       
    94 		}
       
    95 
       
    96 	return TestStepResult();
       
    97 	}
       
    98 
       
    99 TVerdict CTestImpRevLocalTZ::doTestStepPostambleL()
       
   100 /**
       
   101  * @return - TVerdict code
       
   102  * Override of base class virtual
       
   103  */
       
   104 	{
       
   105 	CActiveScheduler::Install(NULL);
       
   106 	delete iScheduler;
       
   107 	INFO_PRINTF1(_L("Completed Import of vCards (REV with TZ property) Tests")); 
       
   108 	return TestStepResult();
       
   109 	}
       
   110 
       
   111