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