author | William Roberts <williamr@symbian.org> |
Thu, 28 Oct 2010 15:56:26 +0100 | |
branch | RCL_3 |
changeset 298 | 2024e52ac966 |
parent 15 | 4122176ea935 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
15
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
0 | 3 |
* All rights reserved. |
4 |
* This component and the accompanying materials are made available |
|
15
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
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 |
* |
|
15
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
14 |
* Description: |
0 | 15 |
* |
16 |
*/ |
|
17 |
||
18 |
||
15
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
19 |
|
0 | 20 |
#include "t_fat32checkdisk.h" |
21 |
||
22 |
/** |
|
23 |
Class Constructor |
|
24 |
*/ |
|
25 |
CBaseTestFat32CheckDisk::CBaseTestFat32CheckDisk() |
|
26 |
{ |
|
27 |
SetTestStepName(KTestStepCheckDisk); |
|
28 |
} |
|
29 |
||
30 |
/** |
|
31 |
Class Destructor |
|
32 |
*/ |
|
33 |
CBaseTestFat32CheckDisk::~CBaseTestFat32CheckDisk() |
|
34 |
{ |
|
35 |
} |
|
36 |
||
37 |
||
38 |
/** |
|
39 |
The function performs the following actions |
|
40 |
1. Verify the integrity of the disk by calling RFs::ScanDisk() |
|
41 |
2. Check whether the code returned match the code specified in the ini file. |
|
42 |
3. If scan dsik is specified in the ini file then call RFs::ScanDrive() |
|
43 |
||
44 |
@return EPass if test passes and EFail if test fails |
|
45 |
*/ |
|
46 |
TVerdict CBaseTestFat32CheckDisk::doTestStepL() |
|
47 |
{ |
|
48 |
SetTestStepResult(EFail); |
|
49 |
TInt r; |
|
50 |
_LIT(KCheckCode,"CheckCode"); |
|
51 |
TInt checkcode; |
|
52 |
_LIT(KScan,"Scan"); |
|
53 |
TInt scan; |
|
54 |
_LIT(KPassRegardless,"PassRegardless"); |
|
55 |
TBuf<4> passRegardless; |
|
56 |
TPtrC16 passregardless = passRegardless; |
|
57 |
TBool alright = GetIntFromConfig(ConfigSection(), KCheckCode, checkcode); |
|
58 |
if(alright) |
|
59 |
{ |
|
60 |
TBool alright2 = GetStringFromConfig(ConfigSection(), KPassRegardless, passregardless); |
|
61 |
if(alright2) |
|
62 |
{ |
|
63 |
// Perform a check disk. |
|
64 |
r=iTheFs.CheckDisk(iSessionPath); |
|
65 |
if (r!=checkcode) |
|
66 |
{ |
|
67 |
// If the code returned does not match the code expected and would |
|
68 |
// like only a warning to be displayed as opposed to failing the |
|
69 |
// test |
|
70 |
if (passregardless == _L("Y")) |
|
71 |
{ |
|
72 |
SetTestStepResult(EPass); |
|
73 |
_LIT(KErrorPass, "RFs::CheckDisk() returns %d & does not match expected value %d"); |
|
74 |
INFO_PRINTF3(KErrorPass, r, checkcode); |
|
75 |
} |
|
76 |
// If the code returned does not match the code expected and would |
|
77 |
// like to fail the test |
|
78 |
else |
|
79 |
{ |
|
80 |
SetTestStepResult(EFail); |
|
81 |
_LIT(KCheckDiskFail, "RFs::CheckDisk() returns %d & does not match expected value %d"); |
|
82 |
INFO_PRINTF3(KCheckDiskFail, r, checkcode); |
|
83 |
} |
|
84 |
} |
|
85 |
else |
|
86 |
{ |
|
87 |
SetTestStepResult(EPass); |
|
88 |
_LIT(KCheckDiskPass, "RFs::CheckDisk() returns %d & matches expected value %d"); |
|
89 |
INFO_PRINTF3(KCheckDiskPass, r, checkcode); |
|
90 |
} |
|
91 |
// If specified in the ini file, perform a ScanDrive on the volume |
|
92 |
TBool alright = GetIntFromConfig(ConfigSection(), KScan, scan); |
|
93 |
if(alright) |
|
94 |
{ |
|
95 |
r=iTheFs.ScanDrive(iSessionPath); |
|
96 |
if (r!=KErrNone) |
|
97 |
{ |
|
98 |
SetTestStepResult(EFail); |
|
99 |
_LIT(KScanFail, "RFs::ScanDrive() failed returns %d"); |
|
100 |
INFO_PRINTF2(KScanFail, r); |
|
101 |
} |
|
102 |
else |
|
103 |
{ |
|
104 |
SetTestStepResult(EPass); |
|
105 |
_LIT(KScanPass, "RFs::ScanDrive() passed"); |
|
106 |
INFO_PRINTF1(KScanPass); |
|
107 |
} |
|
108 |
} |
|
109 |
else |
|
110 |
{ |
|
111 |
_LIT(KNoScan, "RFs::ScanDrive() not indicated in ini file"); |
|
112 |
INFO_PRINTF1(KNoScan); |
|
113 |
} |
|
114 |
return TestStepResult(); |
|
115 |
} |
|
116 |
||
117 |
else |
|
118 |
{ |
|
119 |
_LIT(KReadIniFail, "Could not read PassRegardless from ini file"); |
|
120 |
INFO_PRINTF1(KReadIniFail); |
|
121 |
return TestStepResult(); |
|
122 |
} |
|
123 |
} |
|
124 |
else |
|
125 |
{ |
|
126 |
_LIT(KReadIniFail, "Could not read CheckCode from ini file"); |
|
127 |
INFO_PRINTF1(KReadIniFail); |
|
128 |
return TestStepResult(); |
|
129 |
} |
|
130 |
} |