traceservices/tracefw/ulogger/unit_test/te-server/uloggerservertest1step.cpp
branchRCL_3
changeset 44 26645d81f48d
parent 0 08ec8eefde2f
child 45 cc28652e0254
equal deleted inserted replaced
42:28839de615b4 44:26645d81f48d
    76 		  iErrors += Test13L();//CULoggerServer::SetOutputPluginSettings
    76 		  iErrors += Test13L();//CULoggerServer::SetOutputPluginSettings
    77 		  iErrors += Test14L();//CULoggerServer::GetActiveOutput
    77 		  iErrors += Test14L();//CULoggerServer::GetActiveOutput
    78 		  iErrors += Test15L();//CULoggerServer::GetInstalledPlugins
    78 		  iErrors += Test15L();//CULoggerServer::GetInstalledPlugins
    79 		  iMediaCount = 0;
    79 		  iMediaCount = 0;
    80 		  iErrors += Test16L();//CULoggerServer::GetOutputPluginSettingsL
    80 		  iErrors += Test16L();//CULoggerServer::GetOutputPluginSettingsL
    81 		  iErrors += Test18L();//CULoggerServer::SetBufferSize
    81 		  iErrors += Test18L();//CULoggerServer::SetBufferSizeL
    82 		  iErrors += Test19L();//CULoggerServer::SetDataNotificationSize
    82 		  iErrors += Test19L();//CULoggerServer::SetDataNotificationSizeL
    83 		  iErrors += Test20L();//CULoggerServer::GetBufferSize
    83 		  iErrors += Test20L();//CULoggerServer::GetBufferSize
    84 		  iErrors += Test21L();// CULoggerServer::GetDataNotificationSize
    84 		  iErrors += Test21L();// CULoggerServer::GetDataNotificationSize
    85 		  iErrors += Test22L();//CULoggerServer::SetGlobalSecondaryFilters
    85 		  iErrors += Test22L();//CULoggerServer::SetGlobalSecondaryFilters
    86 		  iErrors += Test23L();//CULoggerServer::ReadBufferL
    86 		  iErrors += Test23L();//CULoggerServer::ReadBufferL
    87 		  iErrors += Test25L();//CULoggerServer::SetBufferMode
    87 		  iErrors += Test25L();//CULoggerServer::SetBufferMode
   313 	    	aCategory.Append(3);
   313 	    	aCategory.Append(3);
   314 	    	aCategory.Append(14);
   314 	    	aCategory.Append(14);
   315 	    	aCategory.Append(194);
   315 	    	aCategory.Append(194);
   316 	    	
   316 	    	
   317 	    	TInt e = KErrNone;
   317 	    	TInt e = KErrNone;
   318 	    	e = server->SetActiveFilter(aCategory,EPrimaryFilter);
   318 	    	e = server->SetActiveFilterL(aCategory,EPrimaryFilter);
   319 	    	TBuf<128> buf;
   319 	    	TBuf<128> buf;
   320 	    	buf.AppendFormat(_L("Code returned from method - %d"), e);
   320 	    	buf.AppendFormat(_L("Code returned from method - %d"), e);
   321 	    	INFO_PRINTF1(buf);
   321 	    	INFO_PRINTF1(buf);
   322 	    	CleanupStack::PopAndDestroy(); //server
   322 	    	CleanupStack::PopAndDestroy(); //server
   323 	    }
   323 	    }
   338 	    }
   338 	    }
   339 	    else
   339 	    else
   340 	    {
   340 	    {
   341 	    	RArray<TUint32> array;
   341 	    	RArray<TUint32> array;
   342 	    	array.Append(34);
   342 	    	array.Append(34);
   343 	    	TInt e = server->SetActiveFilter(array,ESecondaryFilter);
   343 	    	TInt e = server->SetActiveFilterL(array,ESecondaryFilter);
   344 	    	TBuf<128> buf;
   344 	    	TBuf<128> buf;
   345 	    	buf.AppendFormat(_L("Code returned from method - %d"), e);
   345 	    	buf.AppendFormat(_L("Code returned from method - %d"), e);
   346 	    	INFO_PRINTF1(buf);
   346 	    	INFO_PRINTF1(buf);
   347 	    	CleanupStack::PopAndDestroy(); //server
   347 	    	CleanupStack::PopAndDestroy(); //server
   348 	    	array.Close();
   348 	    	array.Close();
   534  }
   534  }
   535 
   535 
   536 
   536 
   537 
   537 
   538 TInt CUloggerServerTest1Step::Test18L()
   538 TInt CUloggerServerTest1Step::Test18L()
   539 {//CULoggerServer::SetBufferSize
   539 {//CULoggerServer::SetBufferSizeL
   540 	TInt errors = 0;
   540 	TInt errors = 0;
   541 		INFO_PRINTF1(_L("Testing - CULoggerServer::SetBufferSize method"));
   541 		INFO_PRINTF1(_L("Testing - CULoggerServer::SetBufferSizeL method"));
   542 	CULoggerServer *server = NULL;
   542 	CULoggerServer *server = NULL;
   543 	server = CULoggerServer::NewLC(EPriorityBackground);
   543 	server = CULoggerServer::NewLC(EPriorityBackground);
   544 	if(server == NULL)
   544 	if(server == NULL)
   545 	    {
   545 	    {
   546 	    INFO_PRINTF1(_L("error"));
   546 	    INFO_PRINTF1(_L("error"));
   548 	    }
   548 	    }
   549 	    else
   549 	    else
   550 	    {
   550 	    {
   551 	    	TInt e;
   551 	    	TInt e;
   552 	    	INFO_PRINTF1(_L("testing value: -1"));
   552 	    	INFO_PRINTF1(_L("testing value: -1"));
   553 	    	e = server->SetBufferSize(-1);
   553 	    	e = server->SetBufferSizeL(-1);
   554 	    	TBuf<128> buf;
   554 	    	TBuf<128> buf;
   555     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   555     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   556     		INFO_PRINTF1(buf);
   556     		INFO_PRINTF1(buf);
   557     		buf.Zero();
   557     		buf.Zero();
   558 
   558 
   559 	    	INFO_PRINTF1(_L("testing value: 0"));
   559 	    	INFO_PRINTF1(_L("testing value: 0"));
   560 	    	e = server->SetBufferSize(0);
   560 	    	e = server->SetBufferSizeL(0);
   561     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   561     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   562     		INFO_PRINTF1(buf);
   562     		INFO_PRINTF1(buf);
   563     		buf.Zero();
   563     		buf.Zero();
   564 
   564 
   565 	    	INFO_PRINTF1(_L("testing value: 100"));
   565 	    	INFO_PRINTF1(_L("testing value: 100"));
   566 	    	e = server->SetBufferSize(100);
   566 	    	e = server->SetBufferSizeL(100);
   567     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   567     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   568     		INFO_PRINTF1(buf);
   568     		INFO_PRINTF1(buf);
   569     		buf.Zero();
   569     		buf.Zero();
   570 
   570 
   571 	    	INFO_PRINTF1(_L("testing value: 65535"));
   571 	    	INFO_PRINTF1(_L("testing value: 65535"));
   572 	    	e = server->SetBufferSize(65535);
   572 	    	e = server->SetBufferSizeL(65535);
   573     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   573     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   574     		INFO_PRINTF1(buf);
   574     		INFO_PRINTF1(buf);
   575     		buf.Zero();
   575     		buf.Zero();
   576 
   576 
   577 	    	INFO_PRINTF1(_L("testing value: 65536"));
   577 	    	INFO_PRINTF1(_L("testing value: 65536"));
   578 	    	e = server->SetBufferSize(65536);
   578 	    	e = server->SetBufferSizeL(65536);
   579     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   579     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   580     		INFO_PRINTF1(buf);
   580     		INFO_PRINTF1(buf);
   581     		buf.Zero();
   581     		buf.Zero();
   582     		
   582     		
   583     		INFO_PRINTF1(_L("testing value: 165537"));
   583     		INFO_PRINTF1(_L("testing value: 165537"));
   584 	    	e = server->SetBufferSize(165537);
   584 	    	e = server->SetBufferSizeL(165537);
   585     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   585     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   586     		INFO_PRINTF1(buf);
   586     		INFO_PRINTF1(buf);
   587     		buf.Zero();
   587     		buf.Zero();
   588     		CleanupStack::PopAndDestroy(); //server
   588     		CleanupStack::PopAndDestroy(); //server
   589 	    }
   589 	    }
   590 	return errors;
   590 	return errors;
   591  }
   591  }
   592 
   592 
   593 
   593 
   594 TInt CUloggerServerTest1Step::Test19L()
   594 TInt CUloggerServerTest1Step::Test19L()
   595 {//CULoggerServer::SetDataNotificationSize
   595 {//CULoggerServer::SetDataNotificationSizeL
   596 	TInt errors = 0;
   596 	TInt errors = 0;
   597 		INFO_PRINTF1(_L("Testing - CULoggerServer::SetDataNotificationSize method"));
   597 		INFO_PRINTF1(_L("Testing - CULoggerServer::SetDataNotificationSizeL method"));
   598 	CULoggerServer *server = NULL;
   598 	CULoggerServer *server = NULL;
   599 	server = CULoggerServer::NewLC(EPriorityBackground);
   599 	server = CULoggerServer::NewLC(EPriorityBackground);
   600 	if(server == NULL)
   600 	if(server == NULL)
   601 	    {
   601 	    {
   602 	    INFO_PRINTF1(_L("error"));
   602 	    INFO_PRINTF1(_L("error"));
   604 	    }
   604 	    }
   605 	    else
   605 	    else
   606 	    {
   606 	    {
   607 	    	TInt e;
   607 	    	TInt e;
   608 	    	INFO_PRINTF1(_L("testing value: -1"));
   608 	    	INFO_PRINTF1(_L("testing value: -1"));
   609 	    	e = server->SetDataNotificationSize(-1);
   609 	    	e = server->SetDataNotificationSizeL(-1);
   610 	    	TBuf<128> buf;
   610 	    	TBuf<128> buf;
   611     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   611     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   612     		INFO_PRINTF1(buf);
   612     		INFO_PRINTF1(buf);
   613     		buf.Zero();
   613     		buf.Zero();
   614 
   614 
   615 	    	INFO_PRINTF1(_L("testing value: 0"));
   615 	    	INFO_PRINTF1(_L("testing value: 0"));
   616 	    	e = server->SetDataNotificationSize(0);
   616 	    	e = server->SetDataNotificationSizeL(0);
   617     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   617     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   618     		INFO_PRINTF1(buf);
   618     		INFO_PRINTF1(buf);
   619     		buf.Zero();
   619     		buf.Zero();
   620 
   620 
   621 	    	INFO_PRINTF1(_L("testing value: 100"));
   621 	    	INFO_PRINTF1(_L("testing value: 100"));
   622 	    	e = server->SetDataNotificationSize(100);
   622 	    	e = server->SetDataNotificationSizeL(100);
   623     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   623     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   624     		INFO_PRINTF1(buf);
   624     		INFO_PRINTF1(buf);
   625     		buf.Zero();
   625     		buf.Zero();
   626 
   626 
   627 	    	INFO_PRINTF1(_L("testing value: 65535"));
   627 	    	INFO_PRINTF1(_L("testing value: 65535"));
   628 	    	e = server->SetDataNotificationSize(65535);
   628 	    	e = server->SetDataNotificationSizeL(65535);
   629     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   629     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   630     		INFO_PRINTF1(buf);
   630     		INFO_PRINTF1(buf);
   631     		buf.Zero();
   631     		buf.Zero();
   632 
   632 
   633 	    	INFO_PRINTF1(_L("testing value: 65536"));
   633 	    	INFO_PRINTF1(_L("testing value: 65536"));
   634 	    	e = server->SetDataNotificationSize(65536);
   634 	    	e = server->SetDataNotificationSizeL(65536);
   635     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   635     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   636     		INFO_PRINTF1(buf);
   636     		INFO_PRINTF1(buf);
   637     		buf.Zero();
   637     		buf.Zero();
   638     		
   638     		
   639     		INFO_PRINTF1(_L("testing value: 85536"));
   639     		INFO_PRINTF1(_L("testing value: 85536"));
   640 	    	e = server->SetDataNotificationSize(85536);
   640 	    	e = server->SetDataNotificationSizeL(85536);
   641     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   641     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   642     		INFO_PRINTF1(buf);
   642     		INFO_PRINTF1(buf);
   643     		buf.Zero();
   643     		buf.Zero();
   644     		
   644     		
   645     		INFO_PRINTF1(_L("testing value: 165538"));
   645     		INFO_PRINTF1(_L("testing value: 165538"));
   646 	    	e = server->SetDataNotificationSize(165538);
   646 	    	e = server->SetDataNotificationSizeL(165538);
   647     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   647     		buf.AppendFormat(_L("Code returned from method - %d"), e);
   648     		INFO_PRINTF1(buf);
   648     		INFO_PRINTF1(buf);
   649     		buf.Zero();
   649     		buf.Zero();
   650     		CleanupStack::PopAndDestroy(); //server
   650     		CleanupStack::PopAndDestroy(); //server
   651 	    }
   651 	    }
   912 		}
   912 		}
   913 	return errors;
   913 	return errors;
   914 	}
   914 	}
   915 	
   915 	
   916 
   916 
   917 TInt CUloggerServerTest1Step::Test29L()//CULoggerServer::GetInstalledInputPlugins
   917 TInt CUloggerServerTest1Step::Test29L()//CULoggerServer::GetInstalledInputPluginsL
   918 	{
   918 	{
   919 	TInt errors = 0;
   919 	TInt errors = 0;
   920 	INFO_PRINTF1(_L("Testing - CULoggerServer::GetInstalledInputPlugins method"));
   920 	INFO_PRINTF1(_L("Testing - CULoggerServer::GetInstalledInputPluginsL method"));
   921 	CULoggerServer *server = NULL;
   921 	CULoggerServer *server = NULL;
   922 	server = CULoggerServer::NewLC(EPriorityBackground);
   922 	server = CULoggerServer::NewLC(EPriorityBackground);
   923 	if(server == NULL)
   923 	if(server == NULL)
   924 		{
   924 		{
   925 		INFO_PRINTF1(_L("error"));
   925 		INFO_PRINTF1(_L("error"));
   926 		++errors;
   926 		++errors;
   927 		}
   927 		}
   928 	else
   928 	else
   929 		{
   929 		{
   930 		RArray<TPtrC8> list;
   930 		RArray<TPtrC8> list;
   931     	server->GetInstalledInputPlugins(list);
   931     	server->GetInstalledInputPluginsL(list);
   932     	list.Close();
   932     	list.Close();
   933     	CleanupStack::PopAndDestroy(); //server
   933     	CleanupStack::PopAndDestroy(); //server
   934 		}
   934 		}
   935 	return errors;
   935 	return errors;
   936 	}
   936 	}