1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicstest/graphicstestharness/src/t_simloadapp3.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,65 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @test
1.22 +*/
1.23 +
1.24 +#include <e32base.h>
1.25 +#include <e32debug.h>
1.26 +#include "t_simloadutils.h"
1.27 +#include "t_simloadapp.h"
1.28 +
1.29 +GLDEF_C TInt E32Main()
1.30 + {
1.31 + RDebug::Print(_L("T_SimLoadApp3::E32Main - entry"));
1.32 +
1.33 + CTrapCleanup* TheTrapCleanup = CTrapCleanup::New();
1.34 +
1.35 + TRAPD(err, StartTestL());
1.36 + if (err)
1.37 + {
1.38 + User::Panic(KTSimLoadAppPanic,err);
1.39 + }
1.40 +
1.41 + delete TheTrapCleanup;
1.42 +
1.43 + RDebug::Print(_L("T_SimLoadApp3::E32Main - exit"));
1.44 + return KErrNone;
1.45 + }
1.46 +
1.47 +LOCAL_C void StartTestL(void)
1.48 + {
1.49 + TInt mySimLoad = CTSimLoadAppUtils::SimLoadL();
1.50 +
1.51 + // static simulated load
1.52 + if (CTSimLoadAppUtils::IsStaticLoadL())
1.53 + {
1.54 + // when simulating the static load there are 3 simload
1.55 + // apps executing at the same time. To harmonise the
1.56 + // load a different number (seed value) is passed
1.57 + // to the engine, hence 200000 in this case
1.58 + CTSimLoadAppUtils::SimulateStaticLoadL(mySimLoad, 200000);
1.59 + }
1.60 + else
1.61 + {
1.62 + // spiked simulated load
1.63 + // in a spiked load situation only simload1
1.64 + // executes a spiked load pattern, whilst simload2
1.65 + // and simload3 run in the background
1.66 + CTSimLoadAppUtils::SimulateStaticLoadL(0, 200000);
1.67 + }
1.68 + }