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