os/textandloc/fontservices/textshaperplugin/test/t_shapetestserver.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2010 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 #include <test/testexecuteserverbase.h>
    19 #include "t_shapeteststep.h"
    20 
    21 
    22 class CShapeTestServer : public CTestServer
    23     {
    24 public:
    25     static CShapeTestServer* NewL();
    26     virtual CTestStep* CreateTestStep(const TDesC& aStepName);
    27     };
    28 
    29 
    30 _LIT(KServerName,"t_shapetestserver");
    31 
    32 CShapeTestServer *CShapeTestServer::NewL()
    33     {
    34     CShapeTestServer * server = new (ELeave) CShapeTestServer();
    35     CleanupStack::PushL(server);
    36     server->StartL(KServerName);
    37     CleanupStack::Pop(server);
    38     return server;
    39     }
    40 
    41 CTestStep *CShapeTestServer::CreateTestStep(const TDesC& aStepName)
    42     {
    43     return CShapeTestStep::CreateShapeTestStep(aStepName);
    44     }
    45 
    46 
    47 LOCAL_C void MainL()
    48     {
    49 #if (defined __DATA_CAGING__)
    50     RProcess().DataCaging(RProcess::EDataCagingOn);
    51     RProcess().SecureApi(RProcess::ESecureApiOn);
    52 #endif
    53     CActiveScheduler* sched=NULL;
    54     sched=new(ELeave) CActiveScheduler;
    55     CActiveScheduler::Install(sched);
    56     CShapeTestServer *server = NULL;
    57     TRAPD(err,server = CShapeTestServer::NewL());
    58     if(!err)
    59         {
    60         // Sync with the client and enter the active scheduler
    61         RProcess::Rendezvous(KErrNone);
    62         sched->Start();
    63         }
    64     delete server;
    65     delete sched;
    66     }
    67 
    68 GLDEF_C TInt E32Main()
    69     {
    70     __UHEAP_MARK;
    71     CTrapCleanup* cleanup = CTrapCleanup::New();
    72     if(cleanup == NULL)
    73         {
    74         return KErrNoMemory;
    75         }
    76     TRAPD(err,MainL());
    77     // This if statement is here just to shut up RVCT, which would otherwise warn
    78     // that err was set but never used
    79     if (err)
    80         {
    81         err = KErrNone;
    82         }
    83     delete cleanup;    
    84     __UHEAP_MARKEND;
    85     return KErrNone;
    86     }