54 //Tidy up after each security test |
55 //Tidy up after each security test |
55 // |
56 // |
56 { |
57 { |
57 CFileMan* fMan=CFileMan::NewL(TheFs); |
58 CFileMan* fMan=CFileMan::NewL(TheFs); |
58 TInt r=fMan->RmDir(_L("\\Resource\\")); |
59 TInt r=fMan->RmDir(_L("\\Resource\\")); |
59 test(r==KErrNone || r==KErrPathNotFound); |
60 test_Value(r, r == KErrNone || r==KErrPathNotFound); |
60 r=fMan->RmDir(_L("\\Sys\\")); |
61 r=fMan->RmDir(_L("\\Sys\\")); |
61 test(r==KErrNone || r==KErrPathNotFound); |
62 test_Value(r, r == KErrNone || r==KErrPathNotFound); |
62 r=fMan->RmDir(_L("\\Private\\")); |
63 r=fMan->RmDir(_L("\\Private\\")); |
63 test(r==KErrNone || r==KErrPathNotFound); |
64 test_Value(r, r == KErrNone || r==KErrPathNotFound); |
64 delete fMan; |
65 delete fMan; |
65 } |
66 } |
66 |
67 |
67 GLDEF_C void TestSetup() |
68 GLDEF_C void TestSetup() |
68 // |
69 // |
69 //creates files for each security test |
70 //creates files for each security test |
70 // |
71 // |
71 { |
72 { |
72 TInt r=TheFs.MkDir(_L("\\Resource\\")); |
73 TInt r=TheFs.MkDir(_L("\\Resource\\")); |
73 test(r==KErrNone); |
74 test_KErrNone(r); |
74 r=TheFs.MkDir(_L("\\Sys\\")); |
75 r=TheFs.MkDir(_L("\\Sys\\")); |
75 test(r==KErrNone); |
76 test_KErrNone(r); |
76 RFile f; |
77 RFile f; |
77 r=f.Create(TheFs,_L("\\Resource\\resourcefile.txt"),EFileWrite); |
78 r=f.Create(TheFs,_L("\\Resource\\resourcefile.txt"),EFileWrite); |
78 test(r==KErrNone || r==KErrAlreadyExists); |
79 test_Value(r, r == KErrNone || r==KErrAlreadyExists); |
79 f.Close(); |
80 f.Close(); |
80 } |
81 } |
81 |
82 |
82 GLDEF_C void CallTestsL(/*TChar aDriveLetter*/) |
83 GLDEF_C void CallTestsL(/*TChar aDriveLetter*/) |
83 // |
84 // |
84 // Calls all data caging tests after setting up the file system for them |
85 // Calls all data caging tests after setting up the file system for them |
85 // |
86 // |
86 { |
87 { |
87 TBuf<30> tmp; |
88 TBuf<30> tmp; |
88 TInt r= TheFs.SessionPath(tmp); |
89 TInt r= TheFs.SessionPath(tmp); |
89 test(r==KErrNone); |
90 test_KErrNone(r); |
90 RDebug::Print(_L("sessp=%S"),&tmp); |
91 RDebug::Print(_L("sessp=%S"),&tmp); |
91 CleanupL(); |
92 CleanupL(); |
92 TestSetup(); |
93 TestSetup(); |
93 } |
94 } |