os/graphics/graphicstest/graphicstestharness/src/t_simloadapp3.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
*/
sl@0
    20
sl@0
    21
#include <e32base.h>
sl@0
    22
#include <e32debug.h>
sl@0
    23
#include "t_simloadutils.h"
sl@0
    24
#include "t_simloadapp.h"
sl@0
    25
sl@0
    26
GLDEF_C TInt E32Main()
sl@0
    27
	{
sl@0
    28
	RDebug::Print(_L("T_SimLoadApp3::E32Main - entry"));
sl@0
    29
sl@0
    30
	CTrapCleanup* TheTrapCleanup = CTrapCleanup::New();
sl@0
    31
sl@0
    32
	TRAPD(err, StartTestL());
sl@0
    33
	if (err)
sl@0
    34
		{
sl@0
    35
		User::Panic(KTSimLoadAppPanic,err);
sl@0
    36
		}
sl@0
    37
sl@0
    38
    delete TheTrapCleanup;
sl@0
    39
sl@0
    40
	RDebug::Print(_L("T_SimLoadApp3::E32Main - exit"));
sl@0
    41
	return KErrNone;
sl@0
    42
	}
sl@0
    43
sl@0
    44
LOCAL_C void StartTestL(void)
sl@0
    45
	{
sl@0
    46
	TInt mySimLoad = CTSimLoadAppUtils::SimLoadL();
sl@0
    47
sl@0
    48
	// static simulated load
sl@0
    49
	if (CTSimLoadAppUtils::IsStaticLoadL())
sl@0
    50
		{
sl@0
    51
		// when simulating the static load there are 3 simload
sl@0
    52
		// apps executing at the same time. To harmonise the
sl@0
    53
		// load a different number (seed value) is passed
sl@0
    54
		// to the engine, hence 200000 in this case
sl@0
    55
		CTSimLoadAppUtils::SimulateStaticLoadL(mySimLoad, 200000);
sl@0
    56
		}
sl@0
    57
	else
sl@0
    58
		{
sl@0
    59
		// spiked simulated load
sl@0
    60
		// in a spiked load situation only simload1
sl@0
    61
		// executes a spiked load pattern, whilst simload2
sl@0
    62
		// and simload3 run in the background
sl@0
    63
		CTSimLoadAppUtils::SimulateStaticLoadL(0, 200000);
sl@0
    64
		}
sl@0
    65
	}