# HG changeset patch # User Brendan Donegan # Date 1272613756 -3600 # Node ID 75e1ed3456bb0b55a1e968e985b80e4707449b51 # Parent 0f8889c8de110e7c24bc7e1a9795fd52a0920cff Attempting to remove the dependency on TestConfigFileParser diff -r 0f8889c8de11 -r 75e1ed3456bb Utils/Src/TestStepSmokeTest.cpp --- 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 #include #include @@ -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 scriptFile; - scriptFile.Copy(KConfigFile); - INFO_PRINTF2(_L("The config file %S"), &scriptFile); - - TBuf8 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 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; } diff -r 0f8889c8de11 -r 75e1ed3456bb Utils/group/SmokeTest_Utils.mmp --- 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