1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/t_integ/src/t_wservintegstepdsa.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,119 @@
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 + @internalComponent
1.23 +*/
1.24 +
1.25 +#include "t_wservintegstepdsa.h"
1.26 +#include "t_wservconsts.h"
1.27 +#include "t_inidata.h"
1.28 +
1.29 +/*@{*/
1.30 +// Data objects
1.31 +
1.32 +_LIT(KWServDsaApp, "z:\\sys\\bin\\t_dsaapp.exe");
1.33 +_LIT(KWServTApp1, "z:\\sys\\bin\\t_app1.exe");
1.34 +
1.35 +_LIT(KDsaAppData, "dsaapp_data%d");
1.36 +_LIT(KDsaAppDataName, "dsaapp_data%d_name");
1.37 +
1.38 +_LIT(KDsaAppResultData, "dsaappresult_data%d");
1.39 +_LIT(KDsaAppResultDataName, "dsaappresult_data%d_name");
1.40 +
1.41 +_LIT(KTApp1Data, "tapp1_data%d");
1.42 +_LIT(KTApp1DataName, "tapp1_data%d_name");
1.43 +
1.44 +/*@}*/
1.45 +
1.46 +/**
1.47 + CT_WServIntegStepDsa constructor.
1.48 + @return N/A
1.49 + @pre None
1.50 + @post CT_WServIntegStepDsa 1st stage constructor
1.51 +*/
1.52 +CT_WServIntegStepDsa::CT_WServIntegStepDsa()
1.53 + {
1.54 + SetTestStepName(KT_WServIntegStepDsa);
1.55 + }
1.56 +
1.57 +
1.58 +enum TVerdict CT_WServIntegStepDsa::doTestStepPostambleL()
1.59 + {
1.60 + CleanUp();
1.61 +
1.62 + __UHEAP_MARKEND;
1.63 +
1.64 + return TestStepResult();
1.65 + }
1.66 +
1.67 +/**
1.68 +Starts test step
1.69 +@internalComponent
1.70 +@return TVerdict pass / fail
1.71 +@pre N/A
1.72 +@post N/A
1.73 +*/
1.74 +enum TVerdict CT_WServIntegStepDsa::doTestStepL()
1.75 + {
1.76 + __UHEAP_MARK;
1.77 +
1.78 + GetConfigDataL(KDsaAppData(), KDsaAppDataName());
1.79 + PrintConfigDataL(KWServDsaAppConfigFile());
1.80 + TInt err = CreateTestProcessL(KWServDsaApp, EPriorityForeground);
1.81 + TEST(err==KErrNone);
1.82 + ClearConfigData();
1.83 +
1.84 + // wait for dsa app to create start file, to permit
1.85 + // creation of t_app1 process
1.86 + WaitForTestL(KWServDsaAppStartFile());
1.87 +
1.88 + GetConfigDataL(KTApp1Data(), KTApp1DataName());
1.89 + PrintConfigDataL(KWServTApp1ConfigFile());
1.90 + err = CreateTestProcessL(KWServTApp1, EPriorityForeground);
1.91 + TEST(err==KErrNone);
1.92 + ClearConfigData();
1.93 +
1.94 + // wait for dsa app to create finish file, to permit
1.95 + // results checking and clean up
1.96 + WaitForTestL(KWServDsaAppFinishFile());
1.97 +
1.98 + TRAP(err,CheckResultsL(KDsaAppResultData(), KDsaAppResultDataName(), KWServDsaAppResultFile()));
1.99 + if (err == KErrNone)
1.100 + {
1.101 + PrintResultsL(KWServDsaAppResultFile());
1.102 +
1.103 + TInt expFrameRate = 0;
1.104 + READ_INT(KDsaAppMinFrameRate, KWServDsaAppConfigFile, expFrameRate);
1.105 +
1.106 + if (expFrameRate>0)
1.107 + {
1.108 + TInt actFrameRate = 0;
1.109 + READ_INT(KPerfDataFrameRate, KWServDsaAppResultFile, actFrameRate);
1.110 +
1.111 + // There is no need to test the measured frame rate for emulator
1.112 + #if defined __WINS__ || defined __WINSCW__
1.113 + INFO_PRINTF2(_L("Frame Rate: Measured: %d"), actFrameRate);
1.114 + #else
1.115 + INFO_PRINTF3(_L("Frame Rate: Target: %d, Measured: %d"), expFrameRate, actFrameRate);
1.116 + TEST(actFrameRate>expFrameRate);
1.117 + #endif
1.118 + }
1.119 + }
1.120 +
1.121 + return TestStepResult();
1.122 + }