os/ossrv/lowlevellibsandfws/apputils/multipartparser/test/tef/smoketest/src/mppsmoketeststeps.cpp
Update contrib.
1 // Copyright (c) 2008-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // mppSmokeTestStepsDom.cpp
19 #include "mppsmoketeststeps.h"
24 #include <xml/parser.h>
25 #include <xml/parserfeature.h>
33 TVerdict CParseBase64Encoding::doTestStepL()
35 CMultipartTestContainer* tester = CMultipartTestContainer::NewLC(Logger());
39 success = GetStringFromConfig(ConfigSection(), _L("InputFile"), inputFile);
40 if (success == EFalse)
42 User::Leave(KErrArgument);
46 success = BaflUtils::FileExists(fs, inputFile);
47 if (success == EFalse)
49 User::Leave(KErrArgument);
53 success = GetStringFromConfig(ConfigSection(), _L("Url"), url);
54 if (success == EFalse)
56 User::Leave(KErrArgument);
59 success = GetStringFromConfig(ConfigSection(), _L("OutputFile"), outputFile);
60 if (success == EFalse)
62 User::Leave(KErrArgument);
66 TRAP(ret, tester->ParseFileL(inputFile, url, outputFile));
69 User::Leave(KErrGeneral);
72 // find out if the test passed or failed
74 success = GetStringFromConfig(ConfigSection(), _L("CompareFile1"), filename1);
75 if (success == EFalse)
77 User::Leave(KErrArgument);
80 success = GetStringFromConfig(ConfigSection(), _L("CompareFile2"), filename2);
81 if (success == EFalse)
83 User::Leave(KErrArgument);
85 TBool skipWhitespace = EFalse;
86 success = GetBoolFromConfig(ConfigSection(), _L("SkipWhitespace"), skipWhitespace);
87 if (success == EFalse)
89 User::Leave(KErrArgument);
92 ret = tester->CompareFilesL(filename1, filename2, skipWhitespace);
95 CleanupClosePushL(fs);
96 //Must not be read-only on hardware or files cannot be
97 // deleted, set attr in .iby file.
98 User::LeaveIfError(fs.Delete(outputFile));
99 CleanupStack::PopAndDestroy(1, &fs);
102 CleanupStack::PopAndDestroy(1);
105 SetTestStepResult(EPass);
110 SetTestStepResult(EFail);
111 INFO_PRINTF2(_L("CompareFiles error code: %d"), ret);