graphicstest/graphicstestharness/src/ServerMain.cpp
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2005-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 "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 /**
       
    17  @file
       
    18  @test
       
    19  @internalComponent - Internal Symbian test code 
       
    20 */
       
    21 
       
    22 #include "GraphicsTestUtilsServer.h"
       
    23 #include "GraphicsTestUtils.h"
       
    24 
       
    25 static void RunServerL()
       
    26 //
       
    27 // Perform all server initialisation, in particular creation of the
       
    28 // scheduler and server and then run the scheduler
       
    29 //
       
    30 	{
       
    31 	// create and install the active scheduler we need
       
    32 	CActiveScheduler* s=new(ELeave) CActiveScheduler;
       
    33 	CleanupStack::PushL(s);
       
    34 	CActiveScheduler::Install(s);
       
    35 	//
       
    36 	// create the server (leave it on the cleanup stack)
       
    37 	CSmlTestUtilsServer::NewLC();
       
    38 	//
       
    39 	// naming the server thread after the server helps to debug panics
       
    40 //	User::LeaveIfError(RThread::RenameMe(KTestServerName)); //DEPRECATED
       
    41 	User::LeaveIfError(User::RenameThread(KTestServerName));
       
    42 	//
       
    43 	// Initialisation complete, now signal the client
       
    44 	RProcess::Rendezvous(KErrNone);
       
    45 	//
       
    46 	// Ready to run
       
    47 	CActiveScheduler::Start();
       
    48 
       
    49 	// Ready to exit.
       
    50 	// Cleanup the server and scheduler
       
    51 	CleanupStack::PopAndDestroy(2);
       
    52 	}
       
    53 
       
    54 static TInt RunSmlTestServer()
       
    55 //
       
    56 // Main entry-point for the server thread
       
    57 //
       
    58 	{
       
    59 	__UHEAP_MARK;
       
    60 	//
       
    61 	CTrapCleanup* cleanup=CTrapCleanup::New();
       
    62 	TInt r=KErrNoMemory;
       
    63 	if (cleanup)
       
    64 		{
       
    65 		TRAP(r,RunServerL());
       
    66 		delete cleanup;
       
    67 		}
       
    68 	//
       
    69 	__UHEAP_MARKEND;
       
    70 	return r;
       
    71 	}
       
    72 
       
    73 
       
    74 
       
    75 TInt E32Main()
       
    76 // EXE entry point function.
       
    77 	{
       
    78 	return RunSmlTestServer();
       
    79 	}
       
    80 
       
    81 
       
    82 
       
    83 //
       
    84 //
       
    85 //