sl@0: /* sl@0: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @test sl@0: @internalComponent sl@0: v sl@0: This contains CT_FileNamesIdenticalData sl@0: */ sl@0: sl@0: // User includes sl@0: #include "T_FileNamesIdenticalData.h" sl@0: #include "T_SfSrvServer.h" sl@0: sl@0: /*@{*/ sl@0: /// Parameters sl@0: _LIT(KFile1, "file1"); sl@0: _LIT(KFile2, "file2"); sl@0: _LIT(KExpected, "expected"); sl@0: sl@0: sl@0: ///Commands sl@0: _LIT(KCmdFileNamesIdentical, "FileNamesIdentical"); sl@0: sl@0: sl@0: CT_FileNamesIdenticalData* CT_FileNamesIdenticalData::NewL() sl@0: /** sl@0: * Two phase constructor sl@0: */ sl@0: { sl@0: CT_FileNamesIdenticalData* ret = new (ELeave) CT_FileNamesIdenticalData(); sl@0: CleanupStack::PushL(ret); sl@0: ret->ConstructL(); sl@0: CleanupStack::Pop(ret); sl@0: return ret; sl@0: } sl@0: sl@0: sl@0: CT_FileNamesIdenticalData::CT_FileNamesIdenticalData() sl@0: /** sl@0: * Protected constructor. First phase construction sl@0: */ sl@0: { sl@0: } sl@0: sl@0: sl@0: void CT_FileNamesIdenticalData::ConstructL() sl@0: /** sl@0: * Protected constructor. Second phase construction sl@0: */ sl@0: { sl@0: } sl@0: sl@0: sl@0: CT_FileNamesIdenticalData::~CT_FileNamesIdenticalData() sl@0: /** sl@0: * Destructor. sl@0: */ sl@0: { sl@0: } sl@0: sl@0: sl@0: TAny* CT_FileNamesIdenticalData::GetObject() sl@0: { sl@0: return NULL; sl@0: } sl@0: sl@0: sl@0: TBool CT_FileNamesIdenticalData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt /*aAsyncErrorIndex*/) sl@0: /** sl@0: * Process a command read from the ini file sl@0: * sl@0: * @param aCommand the command to process sl@0: * @param aSection the section in the ini file requiring the command to be processed sl@0: * sl@0: * @return ETrue if the command is processed sl@0: */ sl@0: { sl@0: TBool retVal = ETrue; sl@0: sl@0: if (aCommand == KCmdFileNamesIdentical) sl@0: { sl@0: DoCmdFileNamesIdentical(aSection); sl@0: } sl@0: return retVal; sl@0: } sl@0: sl@0: void CT_FileNamesIdenticalData::DoCmdFileNamesIdentical(const TDesC& aSection) sl@0: { sl@0: TPtrC file1, file2; sl@0: TBool expected; sl@0: if(GET_MANDATORY_STRING_PARAMETER(KFile1, aSection, file1) sl@0: && GET_MANDATORY_STRING_PARAMETER(KFile2, aSection, file2) sl@0: && GET_MANDATORY_BOOL_PARAMETER(KExpected, aSection, expected)) sl@0: { sl@0: TBool identical = EFalse; sl@0: sl@0: INFO_PRINTF1(_L("Comparing files:")); sl@0: INFO_PRINTF2(_L("File 1: %S"), &file1); sl@0: INFO_PRINTF2(_L("File 2: %S"), &file2); sl@0: sl@0: identical = FileNamesIdentical(file1,file2); sl@0: if(identical != expected) sl@0: { sl@0: ERR_PRINTF1(_L("File names are not identical and it's not expected!")); sl@0: SetBlockResult(EFail); sl@0: } sl@0: else sl@0: { sl@0: if (expected) sl@0: { sl@0: INFO_PRINTF1(_L("File names are identical.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("File names are not identical, but it's expected.")); sl@0: } sl@0: } sl@0: } sl@0: }