os/graphics/windowing/windowserver/test/t_integ/src/t_wservintegstepdsa.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
 @internalComponent
sl@0
    20
*/
sl@0
    21
sl@0
    22
#include "t_wservintegstepdsa.h"
sl@0
    23
#include "t_wservconsts.h"
sl@0
    24
#include "t_inidata.h"
sl@0
    25
sl@0
    26
/*@{*/
sl@0
    27
//	Data objects
sl@0
    28
sl@0
    29
_LIT(KWServDsaApp,              "z:\\sys\\bin\\t_dsaapp.exe");
sl@0
    30
_LIT(KWServTApp1,               "z:\\sys\\bin\\t_app1.exe");
sl@0
    31
sl@0
    32
_LIT(KDsaAppData,				"dsaapp_data%d");
sl@0
    33
_LIT(KDsaAppDataName,			"dsaapp_data%d_name");
sl@0
    34
sl@0
    35
_LIT(KDsaAppResultData,			"dsaappresult_data%d");
sl@0
    36
_LIT(KDsaAppResultDataName,		"dsaappresult_data%d_name");
sl@0
    37
sl@0
    38
_LIT(KTApp1Data,				"tapp1_data%d");
sl@0
    39
_LIT(KTApp1DataName,			"tapp1_data%d_name");
sl@0
    40
sl@0
    41
/*@}*/
sl@0
    42
sl@0
    43
/**
sl@0
    44
 CT_WServIntegStepDsa constructor.
sl@0
    45
 @return N/A
sl@0
    46
 @pre None
sl@0
    47
 @post CT_WServIntegStepDsa 1st stage constructor
sl@0
    48
*/
sl@0
    49
CT_WServIntegStepDsa::CT_WServIntegStepDsa()
sl@0
    50
	{
sl@0
    51
	SetTestStepName(KT_WServIntegStepDsa);
sl@0
    52
	}
sl@0
    53
sl@0
    54
sl@0
    55
enum TVerdict CT_WServIntegStepDsa::doTestStepPostambleL()
sl@0
    56
	{
sl@0
    57
	CleanUp();
sl@0
    58
sl@0
    59
	__UHEAP_MARKEND;
sl@0
    60
	
sl@0
    61
	return TestStepResult();
sl@0
    62
	}
sl@0
    63
	
sl@0
    64
/**
sl@0
    65
Starts test step
sl@0
    66
@internalComponent
sl@0
    67
@return TVerdict pass / fail
sl@0
    68
@pre N/A
sl@0
    69
@post N/A
sl@0
    70
*/
sl@0
    71
enum TVerdict CT_WServIntegStepDsa::doTestStepL()
sl@0
    72
	{
sl@0
    73
	__UHEAP_MARK;
sl@0
    74
sl@0
    75
	GetConfigDataL(KDsaAppData(), KDsaAppDataName());
sl@0
    76
	PrintConfigDataL(KWServDsaAppConfigFile());
sl@0
    77
	TInt err = CreateTestProcessL(KWServDsaApp, EPriorityForeground);
sl@0
    78
	TEST(err==KErrNone);
sl@0
    79
	ClearConfigData();
sl@0
    80
	
sl@0
    81
	// wait for dsa app to create start file, to permit
sl@0
    82
	// creation of t_app1 process
sl@0
    83
	WaitForTestL(KWServDsaAppStartFile());
sl@0
    84
sl@0
    85
	GetConfigDataL(KTApp1Data(), KTApp1DataName());
sl@0
    86
	PrintConfigDataL(KWServTApp1ConfigFile());
sl@0
    87
	err = CreateTestProcessL(KWServTApp1, EPriorityForeground);
sl@0
    88
	TEST(err==KErrNone);
sl@0
    89
	ClearConfigData();
sl@0
    90
	
sl@0
    91
	// wait for dsa app to create finish file, to permit
sl@0
    92
	// results checking and clean up
sl@0
    93
	WaitForTestL(KWServDsaAppFinishFile());
sl@0
    94
sl@0
    95
	TRAP(err,CheckResultsL(KDsaAppResultData(), KDsaAppResultDataName(), KWServDsaAppResultFile()));
sl@0
    96
	if (err == KErrNone)
sl@0
    97
		{	
sl@0
    98
		PrintResultsL(KWServDsaAppResultFile());
sl@0
    99
sl@0
   100
		TInt expFrameRate = 0;
sl@0
   101
		READ_INT(KDsaAppMinFrameRate, KWServDsaAppConfigFile, expFrameRate);
sl@0
   102
sl@0
   103
		if (expFrameRate>0)
sl@0
   104
			{
sl@0
   105
			TInt actFrameRate = 0;
sl@0
   106
			READ_INT(KPerfDataFrameRate, KWServDsaAppResultFile, actFrameRate);
sl@0
   107
			
sl@0
   108
			// There is no need to test the measured frame rate for emulator
sl@0
   109
			#if defined __WINS__ || defined __WINSCW__
sl@0
   110
			INFO_PRINTF2(_L("Frame Rate: Measured: %d"), actFrameRate);
sl@0
   111
			#else
sl@0
   112
			INFO_PRINTF3(_L("Frame Rate: Target: %d, Measured: %d"), expFrameRate, actFrameRate);
sl@0
   113
			TEST(actFrameRate>expFrameRate);
sl@0
   114
			#endif
sl@0
   115
			}
sl@0
   116
		}
sl@0
   117
sl@0
   118
	return TestStepResult();
sl@0
   119
	}