|
1 /* |
|
2 * Copyright (c) 2005-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 * Example CTestStep derived implementation |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 @file checkfolderandfilestep.cpp |
|
23 */ |
|
24 #include "checkfolderandfilestep.h" |
|
25 |
|
26 CCheckFolderAndFileStep::~CCheckFolderAndFileStep() |
|
27 /** |
|
28 * Destructor |
|
29 */ |
|
30 { |
|
31 } |
|
32 |
|
33 CCheckFolderAndFileStep::CCheckFolderAndFileStep() |
|
34 /** |
|
35 * Constructor |
|
36 */ |
|
37 { |
|
38 // Call base class method to set up the human readable name for logging |
|
39 SetTestStepName(KCheckFolderAndFileStep); |
|
40 } |
|
41 |
|
42 TVerdict CCheckFolderAndFileStep::doTestStepL() |
|
43 /** |
|
44 * @return - TVerdict code |
|
45 * Override of base class pure virtual |
|
46 * Demonstrates opening up a handle to the data saved at RChunk base using template class |
|
47 * Overwrite shared data with values and also demonstrates the locking mechanism |
|
48 */ |
|
49 { |
|
50 SetTestStepResult(EFail); |
|
51 _LIT(KFilePath, "FilePath"); |
|
52 //_LIT(KFolderPath, "FolderPath"); |
|
53 _LIT(KExpectedResult, "ExpectedResult"); |
|
54 |
|
55 TPtrC filePath; |
|
56 // TPtrC folderPath; |
|
57 TInt expectedResult; |
|
58 TInt err = KErrNone; |
|
59 |
|
60 RFs fs; |
|
61 User::LeaveIfError(fs.Connect()); |
|
62 CleanupClosePushL(fs); |
|
63 TEntry entry; |
|
64 |
|
65 if (!GetStringFromConfig(ConfigSection(), KFilePath(), filePath) |
|
66 //&& !GetStringFromConfig(ConfigSection(), KFolderPath(), folderPath)) |
|
67 || !GetIntFromConfig(ConfigSection(), KExpectedResult(), expectedResult)) |
|
68 { |
|
69 ERR_PRINTF1(_L("Error occurs when get parameters from config file.")); |
|
70 SetTestStepResult(EInconclusive); |
|
71 return TestStepResult(); |
|
72 } |
|
73 |
|
74 /* if (0 != filePath.Length()) |
|
75 { |
|
76 err = fs.Entry(filePath, entry); |
|
77 |
|
78 }*/ |
|
79 err = fs.Entry(filePath, entry); |
|
80 if (err == expectedResult) |
|
81 { |
|
82 SetTestStepResult(EPass); |
|
83 } |
|
84 |
|
85 CleanupStack::PopAndDestroy(&fs); |
|
86 |
|
87 return TestStepResult(); |
|
88 } |