os/graphics/graphicstest/graphicstestharness/src/t_simloadapp1.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-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 */
    20 
    21 #include <e32base.h>
    22 #include <e32debug.h>
    23 #include "t_simloadutils.h"
    24 #include "t_simloadapp.h"
    25 
    26 GLDEF_C TInt E32Main()
    27 	{
    28 	RDebug::Print(_L("T_SimLoadApp1::E32Main - entry"));
    29 
    30 	CTrapCleanup* TheTrapCleanup = CTrapCleanup::New();
    31 
    32 	TRAPD(err, StartTestL());
    33 	if (err)
    34 		{
    35 		User::Panic(KTSimLoadAppPanic,err);
    36 		}
    37 
    38     delete TheTrapCleanup;
    39 
    40 	RDebug::Print(_L("T_SimLoadApp1::E32Main - exit"));
    41 	return KErrNone;
    42 	}
    43 
    44 LOCAL_C void StartTestL(void)
    45 	{
    46 	TInt mySimLoad = CTSimLoadAppUtils::SimLoadL();
    47 
    48 	// static simulated load
    49 	if (CTSimLoadAppUtils::IsStaticLoadL())
    50 		{
    51 		// when simulating the static load there are 3 simload
    52 		// apps executing at the same time. To harmonise the
    53 		// load a different number (seed value) is passed
    54 		// to the engine, hence 100000 in this case
    55 		CTSimLoadAppUtils::SimulateStaticLoadL(mySimLoad, 100000);
    56 		}
    57 	else
    58 		{
    59 		// spiked simulated load
    60 		CTSimLoadAppUtils::SimulateSpikedLoad();
    61 		}
    62 	}