baseintegtests/baseintegrationtest/testsuites/fat32/src/basetestfat32server.cpp
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2006-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 //
       
    15 
       
    16 #include "basetestfat32server.h"
       
    17 #include "basetestfat32base.h"
       
    18 #include "basetestfat32format.h"
       
    19 #include "basetestfat32mount.h"
       
    20 #include "basetestfat32readraw.h"
       
    21 #include "basetestfat32writeraw.h"
       
    22 #include "basetestfat32readfile.h"
       
    23 #include "basetestfat32writefile.h"
       
    24 #include "basetestfat32checkdisk.h"
       
    25 #include "basetestfat32calculate.h"
       
    26 #include "basetestfat32filldisk.h"
       
    27 #include "basetestfat32clusterbound.h"
       
    28 #include "basetestfat32readwrite.h"
       
    29 #include "basetestfat32larger512.h"
       
    30 
       
    31 CBaseTestFat32Server* CBaseTestFat32Server::NewL()
       
    32 	{
       
    33 	CBaseTestFat32Server* server = new (ELeave) CBaseTestFat32Server();
       
    34 	CleanupStack::PushL(server);
       
    35 	RProcess handle = RProcess();
       
    36 	TParsePtrC serverName(handle.FileName());
       
    37 	server->ConstructL(serverName.Name());
       
    38 	CleanupStack::Pop(server);
       
    39 	return server;
       
    40 	}
       
    41 
       
    42 LOCAL_C void MainL()
       
    43 	{
       
    44 	RProcess().DataCaging(RProcess::EDataCagingOn);
       
    45 	RProcess().SecureApi(RProcess::ESecureApiOn);
       
    46 
       
    47 	CActiveScheduler* sched=NULL;
       
    48 	sched=new(ELeave) CActiveScheduler;
       
    49 	CActiveScheduler::Install(sched);
       
    50 	CBaseTestFat32Server* server = NULL;
       
    51 	TRAPD(err,server = CBaseTestFat32Server::NewL());
       
    52 	if(!err)
       
    53 		{
       
    54 		RProcess::Rendezvous(KErrNone);
       
    55 		sched->Start();
       
    56 		}
       
    57 	delete server;
       
    58 	delete sched;
       
    59 	}
       
    60 
       
    61 GLDEF_C TInt E32Main()
       
    62 	{
       
    63 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
    64 	if(cleanup == NULL)
       
    65 		{
       
    66 		return KErrNoMemory;
       
    67 		}
       
    68 	TRAP_IGNORE(MainL());
       
    69 	delete cleanup;
       
    70 	return KErrNone;
       
    71     }
       
    72 
       
    73 CTestStep* CBaseTestFat32Server::CreateTestStep(const TDesC& aStepName)
       
    74 	{
       
    75 	CTestStep* testStep = NULL;
       
    76 	
       
    77 	if (aStepName == KTestStepFormat)
       
    78 		{
       
    79 		testStep = new CBaseTestFat32Format();
       
    80 		}
       
    81 		else if (aStepName == KTestStepMount)
       
    82 		{
       
    83 		testStep = new CBaseTestFat32Mount();
       
    84 		}
       
    85 		else if (aStepName == KTestStepReadRaw)
       
    86 		{
       
    87 		testStep = new CBaseTestFat32ReadRaw();
       
    88 		}
       
    89 		else if (aStepName == KTestStepWriteRaw)
       
    90 		{
       
    91 		testStep = new CBaseTestFat32WriteRaw();
       
    92 		}
       
    93 		else if (aStepName == KTestStepReadFile)
       
    94 		{
       
    95 		testStep = new CBaseTestFat32ReadFile();
       
    96 		}
       
    97 		else if (aStepName == KTestStepWriteFile)
       
    98 		{
       
    99 		testStep = new CBaseTestFat32WriteFile();
       
   100 		}
       
   101 		else if (aStepName == KTestStepCheckDisk)
       
   102 		{
       
   103 		testStep = new CBaseTestFat32CheckDisk();
       
   104 		}
       
   105 		else if (aStepName == KTestStepCalculate)
       
   106 		{
       
   107 		testStep = new CBaseTestFat32Calculate();
       
   108 		}
       
   109 		else if (aStepName == KTestStepFillDisk)
       
   110 		{
       
   111 		testStep = new CBaseTestFat32FillDisk();			
       
   112 		}
       
   113 		else if (aStepName == KTestStepClusterBound)
       
   114 		{
       
   115 		testStep = new CBaseTestFat32ClusterBound();			
       
   116 		}
       
   117 		else if (aStepName == KTestStepReadWrite)
       
   118 		{
       
   119 		testStep = new CBaseTestFat32ReadWrite();			
       
   120 		}
       
   121 		else if (aStepName == KTestStepLarger512)
       
   122 		{
       
   123 		testStep = new CBaseTestFat32Larger512();			
       
   124 		}
       
   125 	return testStep;
       
   126 	}