traceservices/tracefw/integ_test/ost/TEF/te_ostv2integsuite_performance/src/te_perf.cpp
branchRCL_3
changeset 24 cc28652e0254
parent 23 26645d81f48d
equal deleted inserted replaced
23:26645d81f48d 24:cc28652e0254
    69 /**
    69 /**
    70  * Constructor
    70  * Constructor
    71  */
    71  */
    72 	{
    72 	{
    73 	TRunConfigurer::Init(iApiRunConfig);
    73 	TRunConfigurer::Init(iApiRunConfig);
       
    74 	iPluginRunConfig = new(ELeave) CPluginRunConfig;
    74 	}
    75 	}
    75 
    76 
    76 
    77 
    77 CTCMPerformanceWrapper* CTCMPerformanceWrapper::NewLC()
    78 CTCMPerformanceWrapper* CTCMPerformanceWrapper::NewLC()
    78 	{
    79 	{
    89 	return self;
    90 	return self;
    90 	}
    91 	}
    91 
    92 
    92 void CTCMPerformanceWrapper::ConstructL()
    93 void CTCMPerformanceWrapper::ConstructL()
    93 	{
    94 	{
    94 	iPluginRunConfig = new(ELeave) CPluginRunConfig;
       
    95 	}
    95 	}
    96 
    96 
    97 TAny* CTCMPerformanceWrapper::GetObject()
    97 TAny* CTCMPerformanceWrapper::GetObject()
    98 	{
    98 	{
    99 	return NULL;
    99 	return NULL;
   123 			dobuffermodetests=ETrue;
   123 			dobuffermodetests=ETrue;
   124 
   124 
   125 		TInt pluginOnlyTests=0;
   125 		TInt pluginOnlyTests=0;
   126 	  	//run api tests
   126 	  	//run api tests
   127 		if(doapicalltests)
   127 		if(doapicalltests)
   128 			SetBlockResult(DoApiTestsL(aSection));
   128 			SetBlockResult(DoApiTests(aSection));
   129 
   129 
   130 		if(dooutputplugintests)
   130 		if(dooutputplugintests)
   131 			{
   131 			{
   132 			pluginOnlyTests=1;
   132 			pluginOnlyTests=1;
   133 			SetBlockResult(DoPluginTestsL(pluginOnlyTests, aSection));
   133 			SetBlockResult(DoPluginTests(pluginOnlyTests, aSection));
   134 			}
   134 			}
   135 		
   135 		
   136 		if(dothroughputtests)
   136 		if(dothroughputtests)
   137 			{
   137 			{
   138 			pluginOnlyTests=2;
   138 			pluginOnlyTests=2;
   139 			SetBlockResult(DoPluginTestsL(pluginOnlyTests, aSection));
   139 			SetBlockResult(DoPluginTests(pluginOnlyTests, aSection));
   140 			}
   140 			}
   141 
   141 
   142 		/*
   142 		/*
   143 		 * Implement these in the next iteration
   143 		 * Implement these in the next iteration
   144 		 *
   144 		 *
   153 
   153 
   154 	  	}
   154 	  	}
   155 	 	return ETrue;
   155 	 	return ETrue;
   156 	}
   156 	}
   157 
   157 
   158 TVerdict CTCMPerformanceWrapper::DoApiTestsL(const TTEFSectionName& aSection)
   158 TVerdict CTCMPerformanceWrapper::DoApiTests(const TTEFSectionName& aSection)
   159 	{
   159 	{
   160 	//initialize and create test run parameters
   160 	//initialize and create test run parameters
   161   	//*******this is quite ugly and could be tidied up into a new routine so isnt in main test step
   161   	//*******this is quite ugly and could be tidied up into a new routine so isnt in main test step
   162   	TInt minapiidvalue=0;
   162   	TInt minapiidvalue=0;
   163   	TInt maxapiidvalue=0;
   163   	TInt maxapiidvalue=0;
   325                     break;
   325                     break;
   326                     }
   326                     }
   327                 }
   327                 }
   328             }
   328             }
   329 		CClearConfig configIni;
   329 		CClearConfig configIni;
   330 		configIni.ClearL(logger);
   330 		configIni.Clear(logger);
   331 	
   331 	
   332 		//put in test over API CALLS
   332 		//put in test over API CALLS
   333 		testtype=0;
   333 		testtype=0;
   334 		
   334 		
   335 		if(usesampleevp==0)
   335 		if(usesampleevp==0)
   371 									apitestresult.iRunConfigs = iApiRunConfig; //shallow opy should suffice as we use it between kernel and user side as well.
   371 									apitestresult.iRunConfigs = iApiRunConfig; //shallow opy should suffice as we use it between kernel and user side as well.
   372 									apitestresult.iRunResults.iTraceEnabled = traceenabledvalue;
   372 									apitestresult.iRunResults.iTraceEnabled = traceenabledvalue;
   373 		
   373 		
   374 									//do the test
   374 									//do the test
   375 									INFO_PRINTF2(_L("Testing API %d"), iApiRunConfig.iApiId);
   375 									INFO_PRINTF2(_L("Testing API %d"), iApiRunConfig.iApiId);
   376 									error = apitest.CachedTraceTimeL(iApiRunConfig, apitestresult);
   376 									error = apitest.CachedTraceTime(iApiRunConfig, apitestresult);
   377 									if(error)
   377 									if(error)
   378 										{
   378 										{
   379 										INFO_PRINTF2(_L("ERROR: CachedTraceTimeL failed, error %d"), error);
   379 										INFO_PRINTF2(_L("ERROR: CachedTraceTime failed, error %d"), error);
   380 										SetBlockResult(EFail);
   380 										SetBlockResult(EFail);
   381 										}
   381 										}
   382 									error = apitest.NonCachedTraceTimeL(iApiRunConfig, apitestresult);
   382 									error = apitest.NonCachedTraceTime(iApiRunConfig, apitestresult);
   383 									if(error)
   383 									if(error)
   384 										{
   384 										{
   385 										INFO_PRINTF2(_L("ERROR: NonCachedTraceTimeL failed, error %d"), error);
   385 										INFO_PRINTF2(_L("ERROR: NonCachedTraceTime failed, error %d"), error);
   386 										SetBlockResult(EFail);
   386 										SetBlockResult(EFail);
   387 										}
   387 										}
   388 									error = apitest.StackUsageL(iApiRunConfig, apitestresult);							
   388 									error = apitest.StackUsage(iApiRunConfig, apitestresult);							
   389 									if(error)
   389 									if(error)
   390 										{
   390 										{
   391 										INFO_PRINTF2(_L("ERROR: StackUsageL failed, error %d"), error);
   391 										INFO_PRINTF2(_L("ERROR: StackUsage failed, error %d"), error);
   392 										SetBlockResult(EFail);
   392 										SetBlockResult(EFail);
   393 										}
   393 										}
   394 									
   394 									
   395 									//(apitest.DoTestL(*iApiRunConfig))->Copy(apitestresult);
   395 									//(apitest.DoTestL(*iApiRunConfig))->Copy(apitestresult);
   396 									//stop the ULogger session
   396 									//stop the ULogger session
   435                     {
   435                     {
   436                     break;
   436                     break;
   437                     }
   437                     }
   438                 }
   438                 }
   439             }
   439             }
   440 		configIni.ClearL(logger);
   440 		configIni.Clear(logger);
   441 		}
   441 		}
   442 	//put in all the error returns
   442 	//put in all the error returns
   443 	//put in test step result returns
   443 	//put in test step result returns
   444 	INFO_PRINTF1(_L("End of test run"));
   444 	INFO_PRINTF1(_L("End of test run"));
   445 	return BlockResult();
   445 	return BlockResult();
   446 	}
   446 	}
   447 
   447 
   448 TVerdict CTCMPerformanceWrapper::DoPluginTestsL(const TInt& aPluginOnly, const TTEFSectionName& aSection)
   448 TVerdict CTCMPerformanceWrapper::DoPluginTests(const TInt& aPluginOnly, const TTEFSectionName& aSection)
   449 	{
   449 	{
   450 	//define default plugin configurations
   450 	//define default plugin configurations
   451 	_LIT(KDefaultPlugin,"uloggerfileplugin");
   451 	_LIT(KDefaultPlugin,"uloggerfileplugin");
   452 	_LIT(KOutputPath, "output_path");
   452 	_LIT(KOutputPath, "output_path");
   453 	_LIT(KLogDefaultFileName, "C:\\logs\\defaultplugin.utf");
   453 	_LIT(KLogDefaultFileName, "C:\\logs\\defaultplugin.utf");