phonebookengines/contactsmodel/tsrc/Integration/TestImpExvCard/inc/TestCompareCntFiles.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /**
       
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Checks the exported vCard
       
    16 * 
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21  
       
    22 #ifndef __TESTCOMPARECNTFILES_H__
       
    23 #define __TESTCOMPARECNTFILES_H__
       
    24 
       
    25 // System includes
       
    26 #include <e32test.h>
       
    27 #include <s32file.h>
       
    28 #include <e32std.h>
       
    29 #include <f32file.h>
       
    30 #include <test/testexecutestepbase.h>
       
    31 
       
    32 // User includes
       
    33 #include "TestImpExvCardSuiteDefs.h"
       
    34 #include "ContactsPBAPExportUtilityClass.h"
       
    35 
       
    36 // Constants
       
    37 const TInt KMaxLengthProperty = 15;
       
    38 const TChar KLinefeedChar = TChar(0xa);
       
    39 
       
    40 
       
    41 class CTestCompareCntFiles : public CTestStep
       
    42 	{
       
    43 public:
       
    44 	CTestCompareCntFiles();
       
    45 	~CTestCompareCntFiles();
       
    46 	virtual TVerdict doTestStepPreambleL();
       
    47 	virtual TVerdict doTestStepL();
       
    48 	virtual TVerdict doTestStepPostambleL();
       
    49 
       
    50 private:
       
    51 	void CompareFileL(const TDesC& aExpectedFile, const TDesC& aFile, TDes8& aProperty);
       
    52 	void CompareLinesL(const TDesC8& aBufExpected, const TDesC8& aBufOutput);
       
    53 	TBool CheckForNoFieldL(const TDesC& aFile, const TDesC& aProperty);
       
    54 	TBool IsPropertyPresent(const TDesC8& aLine, TDes8& aProperty);
       
    55 	void TokenizeAndCompareL();
       
    56 	void TokenizeAndCheckNoFieldL();
       
    57 	TBool CompareWholeFileL(const TDesC& aExpectedFile, const TDesC& aFile);
       
    58 	TBool CompareLine(const TDesC8& aLine1, const TDesC8& aLine2);
       
    59 	
       
    60 private:
       
    61 	CContactsPBAPExportUtilityClass* iExportObj;
       
    62 	TPtrC iExportFilePath;
       
    63 	TPtrC iFieldToVerify;
       
    64 	TPtrC iExpectedExportFilePath;
       
    65 	RFs iFsSession;
       
    66 	TPtrC iNoField;
       
    67 	};
       
    68 
       
    69 _LIT(KTestCompareCntFiles,					"TestCompareCntFiles");
       
    70 _LIT(KCompareFile,							"compareFile");
       
    71 _LIT8(KRevision,							"REV");
       
    72 
       
    73 _LIT(KExportFile,							"ExportFile");
       
    74 _LIT(KExpectedExportFile,					"ExpectedExportFile");
       
    75 _LIT(KFieldToVerify,						"FieldToVerify");
       
    76 _LIT(KNoField,								"NoField");
       
    77 
       
    78 #endif