author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 15:50:07 +0300 | |
changeset 201 | 43365a9b78a3 |
parent 109 | b3a1d9898418 |
child 257 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1995-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 the License "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". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// f32test\server\clean_prepdc.cpp |
|
15 |
// This test call all the other datacaging tests so that the relevant configuration and cleanup |
|
16 |
// for the test may be carried out. |
|
17 |
// |
|
18 |
// |
|
19 |
||
20 |
||
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
21 |
#define __E32TEST_EXTENSION__ |
0 | 22 |
#include <f32file.h> |
23 |
#include <e32test.h> |
|
24 |
#include <e32std.h> |
|
25 |
#include <e32std_private.h> |
|
26 |
#include <e32svr.h> |
|
27 |
#include <hal.h> |
|
28 |
#include "t_server.h" |
|
29 |
||
30 |
GLDEF_D RTest test(_L("clean_prepdc")); |
|
31 |
||
32 |
//_LIT(KResourcePath, "?:\\Resource\\"); |
|
33 |
#ifndef __WINS__ |
|
34 |
//_LIT(KSystemPath, "?:\\System\\"); |
|
35 |
#else |
|
36 |
//_LIT(KSystemPath, "?:\\Sys\\"); |
|
37 |
#endif |
|
38 |
//_LIT(KPrivatePath, "?:\\Private\\"); |
|
39 |
||
40 |
//_LIT(Kt_dcroot, "t_dcroot"); |
|
41 |
//_LIT(Kt_dctcb, "t_dctcb"); |
|
42 |
//_LIT(Kt_dcnone, "t_dcnone"); |
|
43 |
//_LIT(Kt_dcallfiles, "t_dcallfiles"); |
|
44 |
//_LIT(Kt_dcdiskadmin, "t_dcdiskadmin"); |
|
45 |
//_LIT(Kt_dcrootallfiles, "t_dcrootallfiles"); |
|
46 |
//_LIT(Kt_dctcballfiles, "t_dctcballfiles"); |
|
47 |
//_LIT(Kt_dcrootdiskadmin, "t_dcrootdiskadmin"); |
|
48 |
//_LIT(Kt_dctcbdiskadmin, "t_dctcbdiskadmin"); |
|
49 |
//_LIT(Kt_dcdiskadminallfiles, "t_dcdiskadminallfiles"); |
|
50 |
||
51 |
||
52 |
||
53 |
GLDEF_C void CleanupL() |
|
54 |
// |
|
55 |
//Tidy up after each security test |
|
56 |
// |
|
57 |
{ |
|
58 |
CFileMan* fMan=CFileMan::NewL(TheFs); |
|
59 |
TInt r=fMan->RmDir(_L("\\Resource\\")); |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
60 |
test_Value(r, r == KErrNone || r==KErrPathNotFound); |
0 | 61 |
r=fMan->RmDir(_L("\\Sys\\")); |
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
62 |
test_Value(r, r == KErrNone || r==KErrPathNotFound); |
0 | 63 |
r=fMan->RmDir(_L("\\Private\\")); |
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
64 |
test_Value(r, r == KErrNone || r==KErrPathNotFound); |
0 | 65 |
delete fMan; |
66 |
} |
|
67 |
||
68 |
GLDEF_C void TestSetup() |
|
69 |
// |
|
70 |
//creates files for each security test |
|
71 |
// |
|
72 |
{ |
|
73 |
TInt r=TheFs.MkDir(_L("\\Resource\\")); |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
74 |
test_KErrNone(r); |
0 | 75 |
r=TheFs.MkDir(_L("\\Sys\\")); |
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
76 |
test_KErrNone(r); |
0 | 77 |
RFile f; |
78 |
r=f.Create(TheFs,_L("\\Resource\\resourcefile.txt"),EFileWrite); |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
79 |
test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
0 | 80 |
f.Close(); |
81 |
} |
|
82 |
||
83 |
GLDEF_C void CallTestsL(/*TChar aDriveLetter*/) |
|
84 |
// |
|
85 |
// Calls all data caging tests after setting up the file system for them |
|
86 |
// |
|
87 |
{ |
|
88 |
TBuf<30> tmp; |
|
89 |
TInt r= TheFs.SessionPath(tmp); |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
90 |
test_KErrNone(r); |
0 | 91 |
RDebug::Print(_L("sessp=%S"),&tmp); |
92 |
CleanupL(); |
|
93 |
TestSetup(); |
|
94 |
} |