author | sl |
Tue, 10 Jun 2014 14:32:02 +0200 | |
changeset 1 | 260cb5ec6c19 |
permissions | -rw-r--r-- |
sl@0 | 1 |
/* |
sl@0 | 2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
sl@0 | 3 |
* All rights reserved. |
sl@0 | 4 |
* This component and the accompanying materials are made available |
sl@0 | 5 |
* under the terms of "Eclipse Public License v1.0" |
sl@0 | 6 |
* which accompanies this distribution, and is available |
sl@0 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
sl@0 | 8 |
* |
sl@0 | 9 |
* Initial Contributors: |
sl@0 | 10 |
* Nokia Corporation - initial contribution. |
sl@0 | 11 |
* |
sl@0 | 12 |
* Contributors: |
sl@0 | 13 |
* |
sl@0 | 14 |
* Description: |
sl@0 | 15 |
* |
sl@0 | 16 |
*/ |
sl@0 | 17 |
|
sl@0 | 18 |
|
sl@0 | 19 |
|
sl@0 | 20 |
|
sl@0 | 21 |
#include "T_FatCharsetConvServer.h" |
sl@0 | 22 |
#include "T_CP874.h" |
sl@0 | 23 |
#include "T_CP932.h" |
sl@0 | 24 |
#include "T_CP936.h" |
sl@0 | 25 |
#include "T_CP949.h" |
sl@0 | 26 |
#include "T_CP950.h" |
sl@0 | 27 |
#include "T_CP1250.h" |
sl@0 | 28 |
#include "T_CP1251.h" |
sl@0 | 29 |
#include "T_CP1252.h" |
sl@0 | 30 |
#include "T_CP1253.h" |
sl@0 | 31 |
#include "T_CP1254.h" |
sl@0 | 32 |
#include "T_CP1255.h" |
sl@0 | 33 |
#include "T_CP1256.h" |
sl@0 | 34 |
#include "T_CP1257.h" |
sl@0 | 35 |
#include "T_CP1258.h" |
sl@0 | 36 |
#include "T_CP54936.h" |
sl@0 | 37 |
|
sl@0 | 38 |
/* Path to the script |
sl@0 | 39 |
|
sl@0 | 40 |
c:\z:\t_TEF\t_TEF_All.script |
sl@0 | 41 |
|
sl@0 | 42 |
*/ |
sl@0 | 43 |
|
sl@0 | 44 |
_LIT(KServerName,"T_FatCharsetConvServer"); |
sl@0 | 45 |
|
sl@0 | 46 |
CT_FatCharsetConvServer *CT_FatCharsetConvServer::NewL() |
sl@0 | 47 |
/** |
sl@0 | 48 |
@return - Instance of the test server |
sl@0 | 49 |
Same code for Secure and non-secure variants |
sl@0 | 50 |
Called inside the MainL() function to create and start the |
sl@0 | 51 |
CTestServer derived server. |
sl@0 | 52 |
*/ |
sl@0 | 53 |
{ |
sl@0 | 54 |
CT_FatCharsetConvServer * server = new (ELeave) CT_FatCharsetConvServer(); |
sl@0 | 55 |
CleanupStack::PushL(server); |
sl@0 | 56 |
// CServer base class call |
sl@0 | 57 |
server->StartL(KServerName); |
sl@0 | 58 |
CleanupStack::Pop(server); |
sl@0 | 59 |
return server; |
sl@0 | 60 |
} |
sl@0 | 61 |
|
sl@0 | 62 |
|
sl@0 | 63 |
LOCAL_C void MainL() |
sl@0 | 64 |
// |
sl@0 | 65 |
// Secure variant |
sl@0 | 66 |
// Much simpler, uses the new Rendezvous() call to sync with the client |
sl@0 | 67 |
// |
sl@0 | 68 |
{ |
sl@0 | 69 |
#if (defined __DATA_CAGING__) |
sl@0 | 70 |
RProcess().DataCaging(RProcess::EDataCagingOn); |
sl@0 | 71 |
RProcess().SecureApi(RProcess::ESecureApiOn); |
sl@0 | 72 |
#endif |
sl@0 | 73 |
CActiveScheduler* sched=NULL; |
sl@0 | 74 |
sched=new(ELeave) CActiveScheduler; |
sl@0 | 75 |
CActiveScheduler::Install(sched); |
sl@0 | 76 |
CT_FatCharsetConvServer *server = NULL; |
sl@0 | 77 |
// Create the CTestServer derived server |
sl@0 | 78 |
TRAPD(err,server = CT_FatCharsetConvServer::NewL()); |
sl@0 | 79 |
if(!err) |
sl@0 | 80 |
{ |
sl@0 | 81 |
// Sync with the client and enter the active scheduler |
sl@0 | 82 |
RProcess::Rendezvous(KErrNone); |
sl@0 | 83 |
sched->Start(); |
sl@0 | 84 |
} |
sl@0 | 85 |
delete server; |
sl@0 | 86 |
delete sched; |
sl@0 | 87 |
} |
sl@0 | 88 |
|
sl@0 | 89 |
/** @return - Standard Epoc error code on process exit |
sl@0 | 90 |
Secure variant only |
sl@0 | 91 |
Process entry point. Called by client using RProcess API |
sl@0 | 92 |
*/ |
sl@0 | 93 |
GLDEF_C TInt E32Main() |
sl@0 | 94 |
{ |
sl@0 | 95 |
__UHEAP_MARK; |
sl@0 | 96 |
CTrapCleanup* cleanup = CTrapCleanup::New(); |
sl@0 | 97 |
if(cleanup == NULL) |
sl@0 | 98 |
{ |
sl@0 | 99 |
return KErrNoMemory; |
sl@0 | 100 |
} |
sl@0 | 101 |
TRAPD(err,MainL()); |
sl@0 | 102 |
// This if statement is here just to shut up RVCT, which would otherwise warn |
sl@0 | 103 |
// that err was set but never used |
sl@0 | 104 |
if (err) |
sl@0 | 105 |
{ |
sl@0 | 106 |
err = KErrNone; |
sl@0 | 107 |
} |
sl@0 | 108 |
delete cleanup; |
sl@0 | 109 |
__UHEAP_MARKEND; |
sl@0 | 110 |
return KErrNone; |
sl@0 | 111 |
} |
sl@0 | 112 |
|
sl@0 | 113 |
CTestStep *CT_FatCharsetConvServer::CreateTestStep(const TDesC& aStepName) |
sl@0 | 114 |
/** |
sl@0 | 115 |
@return - A CTestStep derived instance |
sl@0 | 116 |
Secure and non-secure variants |
sl@0 | 117 |
Implementation of CTestServer pure virtual |
sl@0 | 118 |
*/ |
sl@0 | 119 |
{ |
sl@0 | 120 |
if(aStepName == KTestStep_T_CP874) |
sl@0 | 121 |
{ |
sl@0 | 122 |
return new CT_CP874(); |
sl@0 | 123 |
} |
sl@0 | 124 |
else if(aStepName == KTestStep_T_CP932) |
sl@0 | 125 |
{ |
sl@0 | 126 |
return new CT_CP932(); |
sl@0 | 127 |
} |
sl@0 | 128 |
else if(aStepName == KTestStep_T_CP936) |
sl@0 | 129 |
{ |
sl@0 | 130 |
return new CT_CP936(); |
sl@0 | 131 |
} |
sl@0 | 132 |
else if(aStepName == KTestStep_T_CP949) |
sl@0 | 133 |
{ |
sl@0 | 134 |
return new CT_CP949(); |
sl@0 | 135 |
} |
sl@0 | 136 |
else if(aStepName == KTestStep_T_CP950) |
sl@0 | 137 |
{ |
sl@0 | 138 |
return new CT_CP950(); |
sl@0 | 139 |
} |
sl@0 | 140 |
else if(aStepName == KTestStep_T_CP1250) |
sl@0 | 141 |
{ |
sl@0 | 142 |
return new CT_CP1250(); |
sl@0 | 143 |
} |
sl@0 | 144 |
else if(aStepName == KTestStep_T_CP1251) |
sl@0 | 145 |
{ |
sl@0 | 146 |
return new CT_CP1251(); |
sl@0 | 147 |
} |
sl@0 | 148 |
else if(aStepName == KTestStep_T_CP1252) |
sl@0 | 149 |
{ |
sl@0 | 150 |
return new CT_CP1252(); |
sl@0 | 151 |
} |
sl@0 | 152 |
else if(aStepName == KTestStep_T_CP1253) |
sl@0 | 153 |
{ |
sl@0 | 154 |
return new CT_CP1253(); |
sl@0 | 155 |
} |
sl@0 | 156 |
else if(aStepName == KTestStep_T_CP1254) |
sl@0 | 157 |
{ |
sl@0 | 158 |
return new CT_CP1254(); |
sl@0 | 159 |
} |
sl@0 | 160 |
else if(aStepName == KTestStep_T_CP1255) |
sl@0 | 161 |
{ |
sl@0 | 162 |
return new CT_CP1255(); |
sl@0 | 163 |
} |
sl@0 | 164 |
else if(aStepName == KTestStep_T_CP1256) |
sl@0 | 165 |
{ |
sl@0 | 166 |
return new CT_CP1256(); |
sl@0 | 167 |
} |
sl@0 | 168 |
else if(aStepName == KTestStep_T_CP1257) |
sl@0 | 169 |
{ |
sl@0 | 170 |
return new CT_CP1257(); |
sl@0 | 171 |
} |
sl@0 | 172 |
else if(aStepName == KTestStep_T_CP1258) |
sl@0 | 173 |
{ |
sl@0 | 174 |
return new CT_CP1258(); |
sl@0 | 175 |
} |
sl@0 | 176 |
else if(aStepName == KTestStep_T_CP54936) |
sl@0 | 177 |
{ |
sl@0 | 178 |
return new CT_CP54936(); |
sl@0 | 179 |
} |
sl@0 | 180 |
return NULL; |
sl@0 | 181 |
} |
sl@0 | 182 |