os/kernelhwsrv/kerneltest/f32test/server/clean_prepdc.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// f32test\server\clean_prepdc.cpp
sl@0
    15
// This test call all the other datacaging tests so that the relevant configuration and cleanup 
sl@0
    16
// for the test may be carried out.
sl@0
    17
// 
sl@0
    18
//
sl@0
    19
sl@0
    20
sl@0
    21
#include <f32file.h>
sl@0
    22
#include <e32test.h>
sl@0
    23
#include <e32std.h>
sl@0
    24
#include <e32std_private.h>
sl@0
    25
#include <e32svr.h>
sl@0
    26
#include <hal.h>
sl@0
    27
#include "t_server.h"
sl@0
    28
sl@0
    29
GLDEF_D RTest test(_L("clean_prepdc"));
sl@0
    30
sl@0
    31
//_LIT(KResourcePath, "?:\\Resource\\");
sl@0
    32
#ifndef __WINS__
sl@0
    33
//_LIT(KSystemPath,	"?:\\System\\");
sl@0
    34
#else
sl@0
    35
//_LIT(KSystemPath,	"?:\\Sys\\");
sl@0
    36
#endif
sl@0
    37
//_LIT(KPrivatePath,	"?:\\Private\\");
sl@0
    38
sl@0
    39
//_LIT(Kt_dcroot, "t_dcroot");
sl@0
    40
//_LIT(Kt_dctcb, "t_dctcb");
sl@0
    41
//_LIT(Kt_dcnone, "t_dcnone");
sl@0
    42
//_LIT(Kt_dcallfiles, "t_dcallfiles");
sl@0
    43
//_LIT(Kt_dcdiskadmin, "t_dcdiskadmin");
sl@0
    44
//_LIT(Kt_dcrootallfiles, "t_dcrootallfiles");
sl@0
    45
//_LIT(Kt_dctcballfiles, "t_dctcballfiles");
sl@0
    46
//_LIT(Kt_dcrootdiskadmin, "t_dcrootdiskadmin");
sl@0
    47
//_LIT(Kt_dctcbdiskadmin, "t_dctcbdiskadmin");
sl@0
    48
//_LIT(Kt_dcdiskadminallfiles, "t_dcdiskadminallfiles");
sl@0
    49
sl@0
    50
sl@0
    51
sl@0
    52
GLDEF_C void CleanupL()
sl@0
    53
//
sl@0
    54
//Tidy up after each security test
sl@0
    55
//
sl@0
    56
	{
sl@0
    57
	CFileMan* fMan=CFileMan::NewL(TheFs);
sl@0
    58
	TInt r=fMan->RmDir(_L("\\Resource\\"));
sl@0
    59
	test(r==KErrNone || r==KErrPathNotFound);
sl@0
    60
	r=fMan->RmDir(_L("\\Sys\\"));
sl@0
    61
	test(r==KErrNone || r==KErrPathNotFound);
sl@0
    62
	r=fMan->RmDir(_L("\\Private\\"));
sl@0
    63
	test(r==KErrNone || r==KErrPathNotFound);
sl@0
    64
	delete fMan;
sl@0
    65
	}
sl@0
    66
sl@0
    67
GLDEF_C void TestSetup()
sl@0
    68
//
sl@0
    69
//creates files for each security test
sl@0
    70
//
sl@0
    71
	{
sl@0
    72
	TInt r=TheFs.MkDir(_L("\\Resource\\"));
sl@0
    73
	test(r==KErrNone);
sl@0
    74
	r=TheFs.MkDir(_L("\\Sys\\"));
sl@0
    75
	test(r==KErrNone);
sl@0
    76
	RFile f;
sl@0
    77
	r=f.Create(TheFs,_L("\\Resource\\resourcefile.txt"),EFileWrite);
sl@0
    78
	test(r==KErrNone || r==KErrAlreadyExists);
sl@0
    79
	f.Close();
sl@0
    80
	}	
sl@0
    81
sl@0
    82
GLDEF_C void CallTestsL(/*TChar aDriveLetter*/)
sl@0
    83
//
sl@0
    84
// Calls all data caging tests after setting up the file system for them
sl@0
    85
//
sl@0
    86
	{
sl@0
    87
	TBuf<30> tmp;
sl@0
    88
	TInt r= TheFs.SessionPath(tmp);
sl@0
    89
	test(r==KErrNone);
sl@0
    90
	RDebug::Print(_L("sessp=%S"),&tmp);
sl@0
    91
	CleanupL();
sl@0
    92
	TestSetup();
sl@0
    93
	}