Attempting to remove the dependency on TestConfigFileParser Symbian3
authorBrendan Donegan <brendand@symbian.org>
Fri, 30 Apr 2010 08:49:16 +0100
branchSymbian3
changeset 30 75e1ed3456bb
parent 27 0f8889c8de11
child 31 039cd4d3d33c
Attempting to remove the dependency on TestConfigFileParser
Utils/Src/TestStepSmokeTest.cpp
Utils/group/SmokeTest_Utils.mmp
--- a/Utils/Src/TestStepSmokeTest.cpp	Wed Apr 28 13:16:16 2010 +0100
+++ b/Utils/Src/TestStepSmokeTest.cpp	Fri Apr 30 08:49:16 2010 +0100
@@ -19,7 +19,6 @@
 #include "TestStepSmokeTest.h"
 
 //Epoc include
-#include <testconfigfileparser.h>
 #include <f32file.h>
 #include <e32std.h>
 
@@ -110,108 +109,6 @@
 
 EXPORT_C TVerdict CTestStepSmokeTest::doTestStepPostambleL()
 	{
-
-	//Read whether to do capability testing..
-	TPtrC captest(KNo);
-	GetStringFromConfig(KDefault, KCapTest, captest);
-	if( captest.Compare(_L("YES")) == 0)
-		{
-		INFO_PRINTF1(_L("---Capability Testing---"));
-		//Gets the capabilities config file
-		TBuf<KMaxTestExecuteCommandLength> scriptFile;
-		scriptFile.Copy(KConfigFile);
-		INFO_PRINTF2(_L("The config file %S"), &scriptFile);
-	
-		TBuf8<KMaxTestExecuteCommandLength> scriptSection;
-		scriptSection.Copy(_L("Capabilities"));
-			
-		TPtrC serverName = GetServerName();
-		INFO_PRINTF2(_L("The server name is  %S"), &serverName);
-		HBufC8 *scriptItem = HBufC8::NewLC(serverName.Length());
-		scriptItem->Des().Copy(serverName);
-		 
-		//Get the file server session object
-		RFs		rFs;
-		TInt	err=rFs.Connect();
-		if(err != KErrNone)
-			{
-			ERR_PRINTF1(_L("Failed to connect with File server"));
-			SetTestStepResult(EFail);
-			}
-		else
-			{
-			CleanupClosePushL(rFs);
-			//Get the config file
-			CTestConfig* configFile = CTestConfig::NewLC(rFs, KNullDesC, scriptFile);
-			if( configFile == NULL)
-				{
-				WARN_PRINTF1(_L("NO Config file found -- Plattest_capabilites.config"));
-				}
-			else
-				{
-				//Get the item value from config file
-				TBuf8<KMaxTestExecuteCommandLength> itemValue;
-				itemValue = configFile->Section(scriptSection)->Item(scriptItem->Des())->Value();
-				TLex8 capabilityParser(itemValue);
-				TBool capCheckResult= ETrue;
-				
-				while(!capabilityParser.Eos())
-					{
-					//Parse the capabilities
-					TPtrC8 capability(capabilityParser.NextToken());
-								
-					HBufC* capabilityRead = HBufC::NewLC(capability.Length());
-					capabilityRead->Des().Copy(capability);
-					INFO_PRINTF2(_L("Capability Read is %S"), capabilityRead);
-					
-					//Get the capability value
-					TCapability capabilityValue;
-					TPtrC ptrCapabilty(capabilityRead->Des());
-					TInt err = GetCapability(ptrCapabilty, capabilityValue);
-					if( err != KErrNone)
-						{
-						WARN_PRINTF1(_L("The capability is not found"));
-						}
-					else
-						{
-						//Check if the current process posses the required capability
-						if( !RProcess().HasCapability(capabilityValue) )
-							{
-							INFO_PRINTF2(_L("The capability %S is not possesed."), capabilityRead);
-							capCheckResult=EFalse;
-							}
-						else
-							{
-							INFO_PRINTF2(_L("The capability %S is possesed."), capabilityRead);
-							}
-						}
-					CleanupStack::PopAndDestroy(capabilityRead);
-					}
-					
-				//read the expected capability check result
-				TBool expectedCapCheckResult = ETrue;
-				GetBoolFromConfig(ConfigSection(), KExpectedCapCheckResult, expectedCapCheckResult);
-				INFO_PRINTF2(_L("The expected cap check result is %D"), expectedCapCheckResult);
-				INFO_PRINTF2(_L("The cap check result is %D"), capCheckResult);
-
-				if(expectedCapCheckResult == capCheckResult)
-					{
-					SetTestStepResult(EPass);
-					}
-				else
-					{
-					SetTestStepResult(EFail);
-					}
-				}
-			CleanupStack::PopAndDestroy(2, &rFs);
-			}
-		CleanupStack::PopAndDestroy(scriptItem);
-		if(TestStepError() == KErrPermissionDenied)
-			{
-			INFO_PRINTF1(_L(" The failure is due to Platform Security"));
-			}
-		}
-
 	TVerdict ret = CTestStep::doTestStepPostambleL();
 	return ret;
 	}
--- a/Utils/group/SmokeTest_Utils.mmp	Wed Apr 28 13:16:16 2010 +0100
+++ b/Utils/group/SmokeTest_Utils.mmp	Fri Apr 30 08:49:16 2010 +0100
@@ -46,7 +46,6 @@
 LIBRARY			efsrv.lib
 LIBRARY			TestExecuteUtils.lib 
 LIBRARY			TestExecuteLogClient.lib
-LIBRARY			TestConfigFileParser.lib
 
 // We're quite heavy on the stack... 4k in WinS isn't enough...
 EPOCSTACKSIZE	0x6000