sl@0: // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // f32test\server\clean_prepdc.cpp sl@0: // This test call all the other datacaging tests so that the relevant configuration and cleanup sl@0: // for the test may be carried out. sl@0: // sl@0: // sl@0: sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include "t_server.h" sl@0: sl@0: GLDEF_D RTest test(_L("clean_prepdc")); sl@0: sl@0: //_LIT(KResourcePath, "?:\\Resource\\"); sl@0: #ifndef __WINS__ sl@0: //_LIT(KSystemPath, "?:\\System\\"); sl@0: #else sl@0: //_LIT(KSystemPath, "?:\\Sys\\"); sl@0: #endif sl@0: //_LIT(KPrivatePath, "?:\\Private\\"); sl@0: sl@0: //_LIT(Kt_dcroot, "t_dcroot"); sl@0: //_LIT(Kt_dctcb, "t_dctcb"); sl@0: //_LIT(Kt_dcnone, "t_dcnone"); sl@0: //_LIT(Kt_dcallfiles, "t_dcallfiles"); sl@0: //_LIT(Kt_dcdiskadmin, "t_dcdiskadmin"); sl@0: //_LIT(Kt_dcrootallfiles, "t_dcrootallfiles"); sl@0: //_LIT(Kt_dctcballfiles, "t_dctcballfiles"); sl@0: //_LIT(Kt_dcrootdiskadmin, "t_dcrootdiskadmin"); sl@0: //_LIT(Kt_dctcbdiskadmin, "t_dctcbdiskadmin"); sl@0: //_LIT(Kt_dcdiskadminallfiles, "t_dcdiskadminallfiles"); sl@0: sl@0: sl@0: sl@0: GLDEF_C void CleanupL() sl@0: // sl@0: //Tidy up after each security test sl@0: // sl@0: { sl@0: CFileMan* fMan=CFileMan::NewL(TheFs); sl@0: TInt r=fMan->RmDir(_L("\\Resource\\")); sl@0: test(r==KErrNone || r==KErrPathNotFound); sl@0: r=fMan->RmDir(_L("\\Sys\\")); sl@0: test(r==KErrNone || r==KErrPathNotFound); sl@0: r=fMan->RmDir(_L("\\Private\\")); sl@0: test(r==KErrNone || r==KErrPathNotFound); sl@0: delete fMan; sl@0: } sl@0: sl@0: GLDEF_C void TestSetup() sl@0: // sl@0: //creates files for each security test sl@0: // sl@0: { sl@0: TInt r=TheFs.MkDir(_L("\\Resource\\")); sl@0: test(r==KErrNone); sl@0: r=TheFs.MkDir(_L("\\Sys\\")); sl@0: test(r==KErrNone); sl@0: RFile f; sl@0: r=f.Create(TheFs,_L("\\Resource\\resourcefile.txt"),EFileWrite); sl@0: test(r==KErrNone || r==KErrAlreadyExists); sl@0: f.Close(); sl@0: } sl@0: sl@0: GLDEF_C void CallTestsL(/*TChar aDriveLetter*/) sl@0: // sl@0: // Calls all data caging tests after setting up the file system for them sl@0: // sl@0: { sl@0: TBuf<30> tmp; sl@0: TInt r= TheFs.SessionPath(tmp); sl@0: test(r==KErrNone); sl@0: RDebug::Print(_L("sessp=%S"),&tmp); sl@0: CleanupL(); sl@0: TestSetup(); sl@0: }