genericopenlibs/openenvcore/libm/test/testfloat_blr/src/tfloat_blrserver.cpp
changeset 0 e4d67989cc36
child 48 ab61c4cedc64
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <c32comm.h>
       
    21 
       
    22 #if defined (__WINS__)
       
    23 #define PDD_NAME		_L("ECDRV")
       
    24 #else
       
    25 #define PDD_NAME		_L("EUART1")
       
    26 #define PDD2_NAME		_L("EUART2")
       
    27 #define PDD3_NAME		_L("EUART3")
       
    28 #define PDD4_NAME		_L("EUART4")
       
    29 #endif
       
    30 
       
    31 #define LDD_NAME		_L("ECOMM")
       
    32 
       
    33 /**
       
    34  * @file
       
    35  *
       
    36  * Pipe test server implementation
       
    37  */
       
    38 #include "tfloat_blrserver.h"
       
    39 #include "tfloat_blr.h"
       
    40 
       
    41 
       
    42 _LIT(KServerName, "tfloat_blr");
       
    43 
       
    44 CFloat_blrTestServer* CFloat_blrTestServer::NewL()
       
    45 	{
       
    46 	CFloat_blrTestServer *server = new(ELeave) CFloat_blrTestServer();
       
    47 	CleanupStack::PushL(server);
       
    48 	server->ConstructL(KServerName);
       
    49 	CleanupStack::Pop(server);
       
    50 	return server;
       
    51 	}
       
    52 
       
    53 static void InitCommsL()
       
    54     {
       
    55     TInt ret = User::LoadPhysicalDevice(PDD_NAME);
       
    56     User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
       
    57 
       
    58 #ifndef __WINS__
       
    59     ret = User::LoadPhysicalDevice(PDD2_NAME);
       
    60     ret = User::LoadPhysicalDevice(PDD3_NAME);
       
    61     ret = User::LoadPhysicalDevice(PDD4_NAME);
       
    62 #endif
       
    63 
       
    64     ret = User::LoadLogicalDevice(LDD_NAME);
       
    65     User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
       
    66     ret = StartC32();
       
    67     User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
       
    68     }
       
    69 
       
    70 LOCAL_C void MainL()
       
    71 	{
       
    72 	// Leave the hooks in for platform security
       
    73 #if (defined __DATA_CAGING__)
       
    74 	RProcess().DataCaging(RProcess::EDataCagingOn);
       
    75 	RProcess().SecureApi(RProcess::ESecureApiOn);
       
    76 #endif
       
    77 	InitCommsL();
       
    78 	
       
    79 	CActiveScheduler* sched=NULL;
       
    80 	sched=new(ELeave) CActiveScheduler;
       
    81 	CActiveScheduler::Install(sched);
       
    82 	CFloat_blrTestServer* server = NULL;
       
    83 	// Create the CTestServer derived server
       
    84 	TRAPD(err, server = CFloat_blrTestServer::NewL());
       
    85 	if(!err)
       
    86 		{
       
    87 		// Sync with the client and enter the active scheduler
       
    88 		RProcess::Rendezvous(KErrNone);
       
    89 		sched->Start();
       
    90 		}
       
    91 	delete server;
       
    92 	delete sched;
       
    93 	}
       
    94 
       
    95 /**
       
    96  * Server entry point
       
    97  * @return Standard Epoc error code on exit
       
    98  */
       
    99 TInt main()
       
   100 	{
       
   101 	__UHEAP_MARK;
       
   102 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
   103 	if(cleanup == NULL) 
       
   104 		{
       
   105 		return KErrNoMemory;  
       
   106 		}
       
   107 	TRAP_IGNORE(MainL());
       
   108 	delete cleanup;
       
   109 	__UHEAP_MARKEND;
       
   110 	
       
   111 	return KErrNone;
       
   112 	}
       
   113 	
       
   114 	
       
   115 CTestStep* CFloat_blrTestServer::CreateTestStep(const TDesC& aStepName)
       
   116 	{
       
   117 	CTestStep* testStep = NULL;
       
   118 
       
   119 	// This server creates just one step but create as many as you want
       
   120 	// They are created "just in time" when the worker thread is created
       
   121 	// install steps
       
   122 	
       
   123 	if(aStepName == Kcbrt_test)
       
   124 		{
       
   125 		testStep = new CTestFloat_blr(aStepName);
       
   126 		}
       
   127 	else if(aStepName == Kceil_test)
       
   128 		{
       
   129 		testStep = new CTestFloat_blr(aStepName);
       
   130 		}
       
   131 	else if(aStepName == Kerf_test)
       
   132 		{
       
   133 		testStep = new CTestFloat_blr(aStepName);
       
   134 		}
       
   135 	else if(aStepName == Kerfc_test)
       
   136 		{
       
   137 		testStep = new CTestFloat_blr(aStepName);
       
   138 		}
       
   139 	else if(aStepName == Kexp_test)
       
   140 		{
       
   141 		testStep = new CTestFloat_blr(aStepName);
       
   142 		}
       
   143 	else if(aStepName == Kexp2_test)
       
   144 		{
       
   145 		testStep = new CTestFloat_blr(aStepName);
       
   146 		}
       
   147 	else if(aStepName == Kexpm1_test)
       
   148 		{
       
   149 		testStep = new CTestFloat_blr(aStepName);
       
   150 		}
       
   151 	else if(aStepName == Kfabs_test)
       
   152 		{
       
   153 		testStep = new CTestFloat_blr(aStepName);
       
   154 		}
       
   155 	else if(aStepName == Kilogb_test)
       
   156 		{
       
   157 		testStep = new CTestFloat_blr(aStepName);
       
   158 		}
       
   159 	else if(aStepName == Kj0_test)
       
   160 		{
       
   161 		testStep = new CTestFloat_blr(aStepName);
       
   162 		}
       
   163 	else if(aStepName == Kj1_test)
       
   164 		{
       
   165 		testStep = new CTestFloat_blr(aStepName);
       
   166 		}
       
   167 	else if(aStepName == Klrint_test)
       
   168 		{
       
   169 		testStep = new CTestFloat_blr(aStepName);
       
   170 		}
       
   171 	else if(aStepName == Kllrint_test)
       
   172 		{
       
   173 		testStep = new CTestFloat_blr(aStepName);
       
   174 		}
       
   175 	else if(aStepName == Klog_test)
       
   176 		{
       
   177 		testStep = new CTestFloat_blr(aStepName);
       
   178 		}
       
   179 	else if(aStepName == Klog10_test)
       
   180 		{
       
   181 		testStep = new CTestFloat_blr(aStepName);
       
   182 		}
       
   183 	else if(aStepName == Klog1pf_test)
       
   184 		{
       
   185 		testStep = new CTestFloat_blr(aStepName);
       
   186 		}
       
   187 	else if(aStepName == Klogb_test)
       
   188 		{
       
   189 		testStep = new CTestFloat_blr(aStepName);
       
   190 		}
       
   191 	else if(aStepName == Klroundf_test)
       
   192 		{
       
   193 		testStep = new CTestFloat_blr(aStepName);
       
   194 		}
       
   195 	else if(aStepName == Kllroundf_test)
       
   196 		{
       
   197 		testStep = new CTestFloat_blr(aStepName);
       
   198 		}
       
   199 	else if(aStepName == Krintf_test)
       
   200 		{
       
   201 		testStep = new CTestFloat_blr(aStepName);
       
   202 		}
       
   203 	else if(aStepName == Klog_test)
       
   204 		{
       
   205 		testStep = new CTestFloat_blr(aStepName);
       
   206 		}
       
   207 	else if(aStepName == Ksqrtf_test)
       
   208 		{
       
   209 		testStep = new CTestFloat_blr(aStepName);
       
   210 		}
       
   211 	else if(aStepName == Ktruncf_test)
       
   212 		{
       
   213 		testStep = new CTestFloat_blr(aStepName);
       
   214 		}
       
   215 	else if(aStepName == Ky0f_test)
       
   216 		{
       
   217 		testStep = new CTestFloat_blr(aStepName);
       
   218 		}
       
   219 	else if(aStepName == Ky1f_test)
       
   220 		{
       
   221 		testStep = new CTestFloat_blr(aStepName);
       
   222 		}
       
   223 	else if(aStepName == Kfloorf_test)
       
   224 		{
       
   225 		testStep = new CTestFloat_blr(aStepName);
       
   226 		}
       
   227 	else if(aStepName == Ksignificandf_test)
       
   228 		{
       
   229 		testStep = new CTestFloat_blr(aStepName);
       
   230 		}
       
   231 	else if(aStepName == Knearbyintf_test)
       
   232 		{
       
   233 		testStep = new CTestFloat_blr(aStepName);
       
   234 		}
       
   235 	else if(aStepName == Kisinf_test)
       
   236 		{
       
   237 		testStep = new CTestFloat_blr(aStepName);
       
   238 		}
       
   239 	else if(aStepName == Kisnanf_test)
       
   240 		{
       
   241 		testStep = new CTestFloat_blr(aStepName);
       
   242 		}
       
   243 	else if(aStepName == Kfdimf_test)
       
   244 		{
       
   245 		testStep = new CTestFloat_blr(aStepName);
       
   246 		}
       
   247 	else if(aStepName == Kfmax_test)
       
   248 		{
       
   249 		testStep = new CTestFloat_blr(aStepName);
       
   250 		}
       
   251 	else if(aStepName == Kfmin_test)
       
   252 		{
       
   253 		testStep = new CTestFloat_blr(aStepName);
       
   254 		}
       
   255 	else if(aStepName == Kfmod_test)
       
   256 		{
       
   257 		testStep = new CTestFloat_blr(aStepName);
       
   258 		}
       
   259 	else if(aStepName == Khypot_test)
       
   260 		{
       
   261 		testStep = new CTestFloat_blr(aStepName);
       
   262 		}
       
   263 	else if(aStepName == Knexttoward_test)
       
   264 		{
       
   265 		testStep = new CTestFloat_blr(aStepName);
       
   266 		}
       
   267 	else if(aStepName == Knextafter_test)
       
   268 		{
       
   269 		testStep = new CTestFloat_blr(aStepName);
       
   270 		}
       
   271 	else if(aStepName == Kremainder_test)
       
   272 		{
       
   273 		testStep = new CTestFloat_blr(aStepName);
       
   274 		}
       
   275 	else if(aStepName == Kcopysign_test)
       
   276 		{
       
   277 		testStep = new CTestFloat_blr(aStepName);
       
   278 		}
       
   279 	else if(aStepName == Kfjn_test)
       
   280 		{
       
   281 		testStep = new CTestFloat_blr(aStepName);
       
   282 		}
       
   283 	else if(aStepName == Kfyn_test)
       
   284 		{
       
   285 		testStep = new CTestFloat_blr(aStepName);
       
   286 		}
       
   287 	else if(aStepName == Kscalbf_test)
       
   288 		{
       
   289 		testStep = new CTestFloat_blr(aStepName);
       
   290 		}
       
   291 	else if(aStepName == Kscalbnf_test)
       
   292 		{
       
   293 		testStep = new CTestFloat_blr(aStepName);
       
   294 		}
       
   295 	else if(aStepName == Kpow_test)
       
   296 		{
       
   297 		testStep = new CTestFloat_blr(aStepName);
       
   298 		}
       
   299 	else if(aStepName == Kacosf_test)
       
   300 		{
       
   301 		testStep = new CTestFloat_blr(aStepName);
       
   302 		}
       
   303 	else if(aStepName == Kacoshf_test)
       
   304 		{
       
   305 		testStep = new CTestFloat_blr(aStepName);
       
   306 		}
       
   307 	else if(aStepName == Kasinf_test)
       
   308 		{
       
   309 		testStep = new CTestFloat_blr(aStepName);
       
   310 		}
       
   311 	else if(aStepName == Kasinh_test)
       
   312 		{
       
   313 		testStep = new CTestFloat_blr(aStepName);
       
   314 		}
       
   315 	else if(aStepName == Katan_test)
       
   316 		{
       
   317 		testStep = new CTestFloat_blr(aStepName);
       
   318 		}
       
   319 	else if(aStepName == Katanh_test)
       
   320 		{
       
   321 		testStep = new CTestFloat_blr(aStepName);
       
   322 		}
       
   323 	else if(aStepName == KCosf_test)
       
   324 		{
       
   325 		testStep = new CTestFloat_blr(aStepName);
       
   326 		}
       
   327 	else if(aStepName == Kfpclassify_test)
       
   328 		{
       
   329 		testStep = new CTestFloat_blr(aStepName);
       
   330 		}
       
   331 	else if(aStepName == Kcosh_test)
       
   332 		{
       
   333 		testStep = new CTestFloat_blr(aStepName);
       
   334 		}
       
   335 	else if(aStepName == Ksinf_test)
       
   336 		{
       
   337 		testStep = new CTestFloat_blr(aStepName);
       
   338 		}
       
   339 	else if(aStepName == Ksinh_test)
       
   340 		{
       
   341 		testStep = new CTestFloat_blr(aStepName);
       
   342 		}
       
   343 	else if(aStepName == Ktan_test)
       
   344 		{
       
   345 		testStep = new CTestFloat_blr(aStepName);
       
   346 		}
       
   347 	else if(aStepName == Ktanh_test)
       
   348 		{
       
   349 		testStep = new CTestFloat_blr(aStepName);
       
   350 		}
       
   351 	else if(aStepName == Katan2_test)
       
   352 		{
       
   353 		testStep = new CTestFloat_blr(aStepName);
       
   354 		}
       
   355 	else if(aStepName == Kfma_test)
       
   356 		{
       
   357 		testStep = new CTestFloat_blr(aStepName);
       
   358 		}
       
   359 	else if(aStepName == Kisfinitef_test)
       
   360 		{
       
   361 		testStep = new CTestFloat_blr(aStepName);
       
   362 		}
       
   363 	else if(aStepName == Kisnormal_test)
       
   364 		{
       
   365 		testStep = new CTestFloat_blr(aStepName);
       
   366 		}
       
   367 	else if(aStepName == Ksignbit_test)
       
   368 		{
       
   369 		testStep = new CTestFloat_blr(aStepName);
       
   370 		}
       
   371 	else if(aStepName == Kscalbln_test)
       
   372 		{
       
   373 		testStep = new CTestFloat_blr(aStepName);
       
   374 		}
       
   375 	else if(aStepName == Kfinitef_test)
       
   376 		{
       
   377 		testStep = new CTestFloat_blr(aStepName);
       
   378 		}
       
   379 	else if(aStepName == Kmodf_test)
       
   380 		{
       
   381 		testStep = new CTestFloat_blr(aStepName);
       
   382 		}
       
   383 	else if(aStepName == Kroundf_test)
       
   384 		{
       
   385 		testStep = new CTestFloat_blr(aStepName);
       
   386 		}
       
   387 	else if(aStepName == Kldexpf_test)
       
   388 		{
       
   389 		testStep = new CTestFloat_blr(aStepName);
       
   390 		}
       
   391 	else if(aStepName == Kfrexp_test)
       
   392 		{
       
   393 		testStep = new CTestFloat_blr(aStepName);
       
   394 		}
       
   395 	else if(aStepName == Kremquo_test)
       
   396 		{
       
   397 		testStep = new CTestFloat_blr(aStepName);
       
   398 		}
       
   399 	else if(aStepName == Kremquo_remcheckf_test)
       
   400 		{
       
   401 		testStep = new CTestFloat_blr(aStepName);
       
   402 		}
       
   403 	else if(aStepName == Kgamma_test)
       
   404 		{
       
   405 		testStep = new CTestFloat_blr(aStepName);
       
   406 		}
       
   407 	else if(aStepName == Klgamma_test)
       
   408 		{
       
   409 		testStep = new CTestFloat_blr(aStepName);
       
   410 		}
       
   411 	return testStep;
       
   412 	}
       
   413