os/kernelhwsrv/baseapitest/basesvs/validation/f32/sfsrv/src/T_FileNamesIdenticalData.cpp
Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
23 This contains CT_FileNamesIdenticalData
27 #include "T_FileNamesIdenticalData.h"
28 #include "T_SfSrvServer.h"
32 _LIT(KFile1, "file1");
33 _LIT(KFile2, "file2");
34 _LIT(KExpected, "expected");
38 _LIT(KCmdFileNamesIdentical, "FileNamesIdentical");
41 CT_FileNamesIdenticalData* CT_FileNamesIdenticalData::NewL()
43 * Two phase constructor
46 CT_FileNamesIdenticalData* ret = new (ELeave) CT_FileNamesIdenticalData();
47 CleanupStack::PushL(ret);
49 CleanupStack::Pop(ret);
54 CT_FileNamesIdenticalData::CT_FileNamesIdenticalData()
56 * Protected constructor. First phase construction
62 void CT_FileNamesIdenticalData::ConstructL()
64 * Protected constructor. Second phase construction
70 CT_FileNamesIdenticalData::~CT_FileNamesIdenticalData()
78 TAny* CT_FileNamesIdenticalData::GetObject()
84 TBool CT_FileNamesIdenticalData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/)
86 * Process a command read from the ini file
88 * @param aCommand the command to process
89 * @param aSection the section in the ini file requiring the command to be processed
91 * @return ETrue if the command is processed
96 if (aCommand == KCmdFileNamesIdentical)
98 DoCmdFileNamesIdentical(aSection);
103 void CT_FileNamesIdenticalData::DoCmdFileNamesIdentical(const TDesC& aSection)
107 if(GET_MANDATORY_STRING_PARAMETER(KFile1, aSection, file1)
108 && GET_MANDATORY_STRING_PARAMETER(KFile2, aSection, file2)
109 && GET_MANDATORY_BOOL_PARAMETER(KExpected, aSection, expected))
111 TBool identical = EFalse;
113 INFO_PRINTF1(_L("Comparing files:"));
114 INFO_PRINTF2(_L("File 1: %S"), &file1);
115 INFO_PRINTF2(_L("File 2: %S"), &file2);
117 identical = FileNamesIdentical(file1,file2);
118 if(identical != expected)
120 ERR_PRINTF1(_L("File names are not identical and it's not expected!"));
121 SetBlockResult(EFail);
127 INFO_PRINTF1(_L("File names are identical."));
131 INFO_PRINTF1(_L("File names are not identical, but it's expected."));