author | John Imhofe <john.imhofe@nokia.com> |
Mon, 21 Dec 2009 16:14:42 +0000 | |
changeset 2 | 4122176ea935 |
parent 0 | a41df078684a |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2
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 |
|
2
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 |
* |
|
2
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 |
||
2
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_fat32mount.h" |
21 |
||
22 |
/** |
|
23 |
Class Constructor |
|
24 |
*/ |
|
25 |
CBaseTestFat32Mount::CBaseTestFat32Mount() |
|
26 |
{ |
|
27 |
SetTestStepName(KTestStepMount); |
|
28 |
} |
|
29 |
||
30 |
/** |
|
31 |
Class Destructor |
|
32 |
*/ |
|
33 |
CBaseTestFat32Mount::~CBaseTestFat32Mount() |
|
34 |
{ |
|
35 |
} |
|
36 |
||
37 |
/** |
|
38 |
Mounting the file system |
|
39 |
From the ini file obtain whether the mount should pass or fail |
|
40 |
||
41 |
@return EPass if test passes and EFail if test fails |
|
42 |
*/ |
|
43 |
TVerdict CBaseTestFat32Mount::doTestStepL() |
|
44 |
{ |
|
45 |
SetTestStepResult(EFail); |
|
46 |
TDriveUnit drive (CurrentDrive()); |
|
47 |
TInt r; |
|
48 |
TInt res; |
|
49 |
_LIT(KMountPass, "Pass"); |
|
50 |
_LIT(KMountFail, "Fail"); |
|
51 |
_LIT(KCorrectVerdict,"CorrectVerdict"); |
|
52 |
TBuf<4> correctVerdict; |
|
53 |
TPtrC16 correct = correctVerdict; |
|
54 |
TBuf<4> actualVerdict; |
|
55 |
TPtrC16 actual = actualVerdict; |
|
56 |
||
57 |
if(IsFileSystemFAT32()) |
|
58 |
{ |
|
59 |
TFullName oldFs; |
|
60 |
res = iTheFs.FileSystemName(oldFs,CurrentDrive()); |
|
61 |
res = iTheFs.DismountFileSystem(oldFs,CurrentDrive()); |
|
62 |
if (res != KErrNone) |
|
63 |
{ |
|
64 |
_LIT(KDismountError, "Error %d - could not could not dismount filesystem from drive %d"); |
|
65 |
INFO_PRINTF3(KDismountError, res, CurrentDrive()); |
|
66 |
} |
|
67 |
_LIT(KFsNameFat32, "Fat"); |
|
68 |
r = iTheFs.AddFileSystem(KFsNameFat32); |
|
69 |
||
70 |
TBool alright = GetStringFromConfig(ConfigSection(), KCorrectVerdict, correct); |
|
71 |
if(alright) |
|
72 |
{ |
|
73 |
r = iTheFs.MountFileSystem(KFsNameFat32, CurrentDrive()); |
|
74 |
if (r != KErrNone) |
|
75 |
{ |
|
76 |
actualVerdict = KMountFail; |
|
77 |
} |
|
78 |
else |
|
79 |
{ |
|
80 |
actualVerdict = KMountPass; |
|
81 |
} |
|
82 |
if (actualVerdict == correct) |
|
83 |
{ |
|
84 |
SetTestStepResult(EPass); |
|
85 |
return TestStepResult(); |
|
86 |
} |
|
87 |
else |
|
88 |
{ |
|
89 |
SetTestStepResult(EFail); |
|
90 |
return TestStepResult(); |
|
91 |
} |
|
92 |
} |
|
93 |
} |
|
94 |
else |
|
95 |
{ |
|
96 |
_LIT(KFsNameFat, "Fat"); |
|
97 |
res = iTheFs.DismountFileSystem(KFsNameFat,CurrentDrive()); |
|
98 |
if (res !=KErrNone) |
|
99 |
{ |
|
100 |
_LIT(KDismountError, "Error %d - could not could not dismount filesystem from drive %d"); |
|
101 |
INFO_PRINTF3(KDismountError, res, CurrentDrive()); |
|
102 |
} |
|
103 |
r = iTheFs.MountFileSystem(KFsNameFat, CurrentDrive()); |
|
104 |
} |
|
105 |
if (r != KErrNone) |
|
106 |
{ |
|
107 |
_LIT(KMountError, "Error %d - could not mount filesystem on drive %d"); |
|
108 |
INFO_PRINTF3(KMountError, r, CurrentDrive()); |
|
109 |
SetTestStepResult(EFail); |
|
110 |
return TestStepResult(); |
|
111 |
} |
|
112 |
||
113 |
SetTestStepResult(EPass); |
|
114 |
return TestStepResult(); |
|
115 |
} |