os/textandloc/fontservices/textshaperplugin/test/t_shapetestserver.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/textshaperplugin/test/t_shapetestserver.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,86 @@
     1.4 +/*
     1.5 +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +#include <test/testexecuteserverbase.h>
    1.22 +#include "t_shapeteststep.h"
    1.23 +
    1.24 +
    1.25 +class CShapeTestServer : public CTestServer
    1.26 +    {
    1.27 +public:
    1.28 +    static CShapeTestServer* NewL();
    1.29 +    virtual CTestStep* CreateTestStep(const TDesC& aStepName);
    1.30 +    };
    1.31 +
    1.32 +
    1.33 +_LIT(KServerName,"t_shapetestserver");
    1.34 +
    1.35 +CShapeTestServer *CShapeTestServer::NewL()
    1.36 +    {
    1.37 +    CShapeTestServer * server = new (ELeave) CShapeTestServer();
    1.38 +    CleanupStack::PushL(server);
    1.39 +    server->StartL(KServerName);
    1.40 +    CleanupStack::Pop(server);
    1.41 +    return server;
    1.42 +    }
    1.43 +
    1.44 +CTestStep *CShapeTestServer::CreateTestStep(const TDesC& aStepName)
    1.45 +    {
    1.46 +    return CShapeTestStep::CreateShapeTestStep(aStepName);
    1.47 +    }
    1.48 +
    1.49 +
    1.50 +LOCAL_C void MainL()
    1.51 +    {
    1.52 +#if (defined __DATA_CAGING__)
    1.53 +    RProcess().DataCaging(RProcess::EDataCagingOn);
    1.54 +    RProcess().SecureApi(RProcess::ESecureApiOn);
    1.55 +#endif
    1.56 +    CActiveScheduler* sched=NULL;
    1.57 +    sched=new(ELeave) CActiveScheduler;
    1.58 +    CActiveScheduler::Install(sched);
    1.59 +    CShapeTestServer *server = NULL;
    1.60 +    TRAPD(err,server = CShapeTestServer::NewL());
    1.61 +    if(!err)
    1.62 +        {
    1.63 +        // Sync with the client and enter the active scheduler
    1.64 +        RProcess::Rendezvous(KErrNone);
    1.65 +        sched->Start();
    1.66 +        }
    1.67 +    delete server;
    1.68 +    delete sched;
    1.69 +    }
    1.70 +
    1.71 +GLDEF_C TInt E32Main()
    1.72 +    {
    1.73 +    __UHEAP_MARK;
    1.74 +    CTrapCleanup* cleanup = CTrapCleanup::New();
    1.75 +    if(cleanup == NULL)
    1.76 +        {
    1.77 +        return KErrNoMemory;
    1.78 +        }
    1.79 +    TRAPD(err,MainL());
    1.80 +    // This if statement is here just to shut up RVCT, which would otherwise warn
    1.81 +    // that err was set but never used
    1.82 +    if (err)
    1.83 +        {
    1.84 +        err = KErrNone;
    1.85 +        }
    1.86 +    delete cleanup;    
    1.87 +    __UHEAP_MARKEND;
    1.88 +    return KErrNone;
    1.89 +    }