本文整理汇总了C++中TestStepResult函数的典型用法代码示例。如果您正苦于以下问题:C++ TestStepResult函数的具体用法?C++ TestStepResult怎么用?C++ TestStepResult使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TestStepResult函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: INFO_PRINTF1
TVerdict CTestLtsySmsDeleteInvalidIndex::doTestStepPostambleL()
{
INFO_PRINTF1(_L("CTestLtsySmsDeleteInvalidIndex::doTestStepPostambleL called"));
return TestStepResult();
}
示例2: _LIT
TVerdict CProcessLaunchTest0Step::doTestStepL()
/**
* @return - TVerdict code
* Override of base class pure virtual
* Our implementation only gets called if the base class doTestStepPreambleL() did
* not leave. That being the case, the current test result value will be EPass.
*/
{
_LIT(KThreadName, "*lbsgpslocmanager*");
TProcessStartParams processParams;
_LIT(KDummyFileName, "\\sys\\bin\\lbsgpslocmanager.exe");
_LIT(KDummyProcessName, "DummyAgpsManager");
processParams.SetProcessFileName(KDummyFileName);
processParams.SetProcessName(KDummyProcessName);
processParams.SetRendezvousRequired(EFalse);
if (TestStepResult()==EPass)
{
CProcessLaunch::ProcessLaunch(processParams);
// now we have to look for this thread.
TFindThread threadFinder(KThreadName);
TFullName matchedThreadName;
// see how many instances we have of the thread
TInt matchCount = 0;
while(threadFinder.Next(matchedThreadName) == KErrNone)
{
++matchCount;
}
// match count must be one at this point
if(matchCount!=1)
{
// fail the test, its all gone very wrong - there are 2 processes
SetTestStepResult(EFail);
}
// now we want to grab the ThreadID (we can just use thead id's, don't need handles)
RThread processThread;
User::LeaveIfError(processThread.Open(matchedThreadName));
TThreadId tid = processThread.Id();
// now try and break things, by starting a 2nd copy of the process.
CProcessLaunch::ProcessLaunch(processParams); // NB we use the same process params
matchCount = 0;
threadFinder.Find(KThreadName);
while(threadFinder.Next(matchedThreadName)==KErrNone)
{
++matchCount;
}
// match count must be one at this point
if(matchCount!=1)
{
// fail the test, its all gone very wrong - there are 2 processes
// this is were we will fail with the current code.
SetTestStepResult(EFail);
}
// check the thread ID's
RThread newProcessThread;
User::LeaveIfError(newProcessThread.Open(matchedThreadName));
TThreadId newTid = newProcessThread.Id();
if(newTid.Id() != tid.Id())
{
// fail the test these are different thread id's
// This is to be expected in the current code base
SetTestStepResult(EFail);
}
else
{
// test passes - there is only one instance of the process
SetTestStepResult(EPass);
}
}
// now kill the process we started
_LIT(KStar, "*");
TFullName wildCardPattern;
wildCardPattern.Append(KStar);
wildCardPattern.Append(KThreadName);
wildCardPattern.Append(KStar);
TFindProcess pf(wildCardPattern);
TFullName name;
TInt findError = pf.Next(name);
RProcess p;
TInt pErr = 0;
pErr = p.Open(name);
User::LeaveIfError(pErr);
// nuke it
p.Kill(0);
p.Close();
return TestStepResult();
}
示例3: INFO_PRINTF1
/**
Override of base class virtual
@return - TVerdict code
*/
TVerdict CTDirectGdiDriver::doTestStepPreambleL()
{
CTDirectGdiStepBase::doTestStepPreambleL();
INFO_PRINTF1(_L("DirectGdi Driver pre-test setup"));
return TestStepResult();
}
示例4: INFO_PRINTF1
TVerdict CTestIfioctls::doTestStepL()
{
int err;
if(TestStepName() == KExampleL)
{
INFO_PRINTF1(_L("ExampleL():"));
err = ExampleL();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KListInterfaces)
{
INFO_PRINTF1(_L("ListInterfaces():"));
err = ListInterfaces();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KCreateManyActiveInterfaces)
{
INFO_PRINTF1(_L("CreateManyActiveInterfaces():"));
err = CreateManyActiveInterfaces();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KChooseInterface)
{
INFO_PRINTF1(_L("ChooseInterface():"));
err = ChooseInterface();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KChooseActiveInterface)
{
INFO_PRINTF1(_L("ChooseActiveInterface():"));
err = ChooseActiveInterface();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KTestIfNameIndex)
{
INFO_PRINTF1(_L("TestIfNameIndex():"));
err = TestIfNameIndex();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KTestIfIndexToName)
{
INFO_PRINTF1(_L("TestIfIndexToName():"));
err = TestIfIndexToName();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KTestIfNameToIndex)
{
INFO_PRINTF1(_L("TestIfNameToIndex():"));
err = TestIfNameToIndex();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KTestSiocGIfIndex)
{
INFO_PRINTF1(_L("TestSiocGIfIndex():"));
err = TestSiocGIfIndex();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KConnectToIpUsingConnection)
{
INFO_PRINTF1(_L("ConnectToIpUsingConnection():"));
err = ConnectToIpUsingConnection();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KSendtoIpUsingConnection )
{
INFO_PRINTF1(_L("SendtoIpUsingConnection():"));
err = SendtoIpUsingConnection();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KConnectToUrlUsingConnection )
{
INFO_PRINTF1(_L("ConnectToUrlUsingConnection():"));
err = ConnectToUrlUsingConnection();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == Kioctltest)
{
INFO_PRINTF1(_L("ioctltest():"));
err = ioctltest();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == Kreadtest)
{
INFO_PRINTF1(_L("readtest():"));
err = readtest();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KTestAddDelRoute)
{
INFO_PRINTF1(_L("TestAddDelRoute():"));
err = TestAddDelRoute();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
else if(TestStepName() == KTestAddDelRouteNegative1)
{
INFO_PRINTF1(_L("TestAddDelRouteNegative1():"));
err = TestAddDelRouteNegative1();
SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
}
//.........这里部分代码省略.........
示例5: INFO_PRINTF1
//.........这里部分代码省略.........
TRequestStatus reqStatus0;
callParams.iSpeakerControl=RCall::EMonitorSpeakerControlAlwaysOn;
callParams.iSpeakerVolume=RCall::EMonitorSpeakerVolumeHigh;
callParams.iWaitForDialTone=RCall::EDialToneWait;
callParams.iInterval=1234;
callParams.iWantedAiur=RMobileCall::EAiurBps9600;
callParams.iWantedRxTimeSlots=5;
callParams.iMaxTimeSlots=30;
callParams.iCodings=RMobileCall::ETchCoding48;
iCall.Dial(reqStatus0,callParamsPckg,KTelephoneNumber);
User::WaitForRequest(reqStatus0); // Wait for the Call Status Change notification
TESTL(reqStatus0==KErrNone);
INFO_PRINTF2(_L("Result: %d"),reqStatus0.Int());
CHECKPOINTL(reqStatus0,KErrNone,CHP_DATA_CASE("B.1"));
INFO_PRINTF1(_L("Get Bearer Information again..."));
TESTL(iCall.GetBearerServiceInfo(bearerServiceInfo)==KErrNone);
TESTL(bearerServiceInfo.iBearerCaps==RCall::KBearerCapsCompressionV42bis);
TESTL(bearerServiceInfo.iBearerSpeed==RCall::EBearerData19200);
INFO_PRINTF1(_L("Check call state..."));
RMobileCall::TMobileCallStatus state;
TESTL(iCall.GetMobileCallStatus(state)==KErrNone);
TESTL(state==RMobileCall::EStatusConnected);
INFO_PRINTF1(_L("Check call params..."));
TESTL(iCall.GetCallParams(callParamsPckg)==KErrNone);
TESTL(callParams.iSpeakerControl==RCall::EMonitorSpeakerControlAlwaysOn);
TESTL(callParams.iSpeakerVolume==RCall::EMonitorSpeakerVolumeHigh);
TESTL(callParams.iWaitForDialTone==RCall::EDialToneWait);
TESTL(callParams.iInterval==1234);
INFO_PRINTF1(_L("Notification for Hscsd info changes"));
TRequestStatus reqStatus1;
iCall.NotifyHscsdInfoChange(reqStatus1,infoPckg);
INFO_PRINTF1(_L("Set DataCall Hscsd Dynamic Parameters"));
iCall.SetDynamicHscsdParams(reqStatus0,RMobileCall::EAiurBps57600, 15);
User::WaitForRequest(reqStatus0);
CHECKPOINTL(reqStatus0,KErrNone,CHP_DATA_CASE("B.8"));
User::WaitForRequest(reqStatus1);
CHECKPOINTL(reqStatus1,KErrNone,CHP_DATA_CASE("B.10"));
INFO_PRINTF1(_L("Completed notification..."));
INFO_PRINTF1(_L("Hanging up call"));
TESTL(iCall.HangUp()==KErrNone);
INFO_PRINTF1(_L("Check call state..."));
TESTL(iCall.GetMobileCallStatus(state)==KErrNone);
TESTL(state==RMobileCall::EStatusIdle);
// Start another session, this time using Multimode Call Params, so re-start the
// NTRasSimulator
StartNTRasSimulation();
INFO_PRINTF2(_L("Dialling %S "),&KTelephoneNumber);
RMobileCall::TMobileCallParamsV1 mobileCallParams;
RMobileCall::TMobileCallParamsV1Pckg mobileCallParamsPckg(mobileCallParams);
mobileCallParams.iSpeakerControl=RCall::EMonitorSpeakerControlOnExceptDuringDialling;
mobileCallParams.iSpeakerVolume=RCall::EMonitorSpeakerVolumeUnknown;
mobileCallParams.iWaitForDialTone=RCall::EDialToneNoWait;
mobileCallParams.iInterval=5678;
mobileCallParams.iAutoRedial=ETrue;
mobileCallParams.iCug.iCugIndex=99;
mobileCallParams.iIdRestrict=RMobileCall::ESendMyId;
iCall.Dial(reqStatus0,mobileCallParamsPckg,KTelephoneNumber);
User::WaitForRequest(reqStatus0); // Wait for the Call Status Change notification
TESTL(reqStatus0==KErrNone);
CHECKPOINTL(reqStatus0,KErrNone,CHP_DATA_CASE("B.2"));
INFO_PRINTF1(_L("Check call state..."));
TESTL(iCall.GetMobileCallStatus(state)==KErrNone);
TESTL(state==RMobileCall::EStatusConnected);
INFO_PRINTF1(_L("Check call params..."));
TESTL(iCall.GetCallParams(mobileCallParamsPckg)==KErrNone);
TESTL(mobileCallParams.iSpeakerControl==RCall::EMonitorSpeakerControlOnExceptDuringDialling);
TESTL(mobileCallParams.iSpeakerVolume==RCall::EMonitorSpeakerVolumeUnknown);
TESTL(mobileCallParams.iWaitForDialTone==RCall::EDialToneNoWait);
TESTL(mobileCallParams.iInterval==5678);
TESTL(mobileCallParams.iAutoRedial/*==ETrue*/);
TESTL(mobileCallParams.iCug.iCugIndex==99);
TESTL(mobileCallParams.iIdRestrict==RMobileCall::ESendMyId);
TESTL(iCall.HangUp()==KErrNone);
INFO_PRINTF1(_L("Check call state..."));
TESTL(iCall.GetMobileCallStatus(state)==KErrNone);
TESTL(state==RMobileCall::EStatusIdle);
CHECKPOINTL(state,RMobileCall::EStatusIdle,CHP_DATA_CASE("B.3"));
iCall.Close();
iLine.Close();
iPhone.Close();
ASSERT(RThread().RequestCount()==0);
return TestStepResult();
}
示例6: fStepRepeat
//.........这里部分代码省略.........
// leave Evaluator is optional.
if(GetBoolFromConfig(ConfigSection(),fLeaveEvaluator,leaveEvaluator))
{
newSerReq.iLeaveEvaluator = leaveEvaluator;
}
// Cancel ups request is optional.
if(GetBoolFromConfig(ConfigSection(),fCancelUpsRequest,cancelUpsRequest))
{
newSerReq.iCancelUpsRequest = cancelUpsRequest;
}
// plat sec pass is optional.
if(GetBoolFromConfig(ConfigSection(),fPlatSecPass,platSecPass))
{
newSerReq.iPlatSecPass = platSecPass;
}
// Force prompt is optional.
if(GetBoolFromConfig(ConfigSection(),fForcePrompt,forcePrompt))
{
newSerReq.iForcePrompt = forcePrompt;
}
// use of policy evaluator is optional.
if(GetIntFromConfig(ConfigSection(),fExpectedEvaInfo,expectedEvaInfo))
{
newSerReq.iExpectedEvaluatorInfo = expectedEvaInfo;
}
// Fingerprint selection is optional.
if(GetIntFromConfig(ConfigSection(),fSelectFingerprint,selectFingerprint))
{
newSerReq.iSelectFingerprint = selectFingerprint;
}
// iRepeatUntilFileAppears is optional.
if(GetStringFromConfig(ConfigSection(),fWaitUntilFileAppears,waitUntilFileAppears))
{
newSerReq.iWaitUntilFileAppears = waitUntilFileAppears;
}
// Add the new service to be requested to array.
iArraySersToRequest.Append(newSerReq);
index++;
fUseServiceUID.Format(_L("UseServiceUID_%d"),index);
fUseServerName.Format(_L("UseServerName_%d"),index);
fDestination.Format(_L("Destination_%d"),index);
fExpectedError.Format(_L("ExpectedError_%d"),index);
fUseOpaqueData.Format(_L("UseOpaqueData_%d"),index);
fSelectDialogOption.Format(_L("SelectDialogOption_%d"),index);
fButtonsDisplayed.Format(_L("ButtonsDisplayed_%d"),index);
fDialogCreatorInvoked.Format(_L("DialogCreatorInvoked_%d"),index);
fPolicyEvaluatorInvoked.Format(_L("PolicyEvaluatorInvoked_%d"),index);
fAccessGranted.Format(_L("AccessGranted_%d"), index);
fCloseSession.Format(_L("CloseSession_%d"), index);
fHoldEvaluatorOpen.Format(_L("HoldEvaluatorOpen_%d"), index);
fHoldPrepareDialogOpen.Format(_L("HoldPrepareDialogOpen_%d"), index);
fHoldDisplayDialogOpen.Format(_L("HoldDisplayDialogOpen_%d"), index);
fRequestDurationThreshold.Format(_L("RequestDurationThreshold_%d"), index);
fLeaveDialog.Format(_L("LeaveDialog_%d"), index);
fLeaveEvaluator.Format(_L("LeaveEvaluator_%d"), index);
fCancelUpsRequest.Format(_L("CancelUpsRequest_%d"), index);
fPlatSecPass.Format(_L("PlatSecPass_%d"), index);
fForcePrompt.Format(_L("ForcePrompt_%d"), index);
fExpectedEvaInfo.Format(_L("ExpectedEvaluatorInfo_%d"), index);
fSelectFingerprint.Format(_L("SelectFingerprint_%d"), index);
fWaitUntilFileAppears.Format(_L("WaitUntilFileAppears_%d"), index);
}
// now try for some clientStep specific stuff
// this ini file entry specifies the property key value for the hold flag
// If the hold flag property is true then monitor it until it becomes false
// then continue
TInt holdKey;
if(GetIntFromConfig(ConfigSection(),_L("HoldClientStepKey"), holdKey))
{
iHoldClientStepKey = holdKey;
// as this property is present then set it to true using a direct call to p&s api because
// the ups p&s api only handles policy evaluators and dialog creators and not test steps
User::LeaveIfError(RProperty::Set(KPropertyCreatorUid, iHoldClientStepKey, 2));
}
// Instantiates property reader and seter
iPropertyReader= CUpsProperty::NewL(KPropertyCreatorUid);
// reads client name and SID
TParse clientFullName;
RThread client;
clientFullName.Set(client.FullName(),NULL, NULL);
iTEFServerName=clientFullName.Name();
iExpectedClientSid = client.SecureId() ;
client.Close();
SetTestStepResult(EPass);
return TestStepResult();
}
示例7: SetTestStepResult
TVerdict CTestIfioctls::doTestStepPreambleL()
{
__UHEAP_MARK;
SetTestStepResult(EPass);
return TestStepResult();
}
示例8: StandardPrepareL
//.........这里部分代码省略.........
ConfigPsyL(positioner2, KIntGpsPsy1, 1,
KConfigLRNoError10s //KErrGeneral 1s
);
ConfigPsyL(positioner2, KNetworkPsy2, 1,
KConfigLRNoError1s //KErrNoMemory 1s
);
InitPsyListInDefaultProxyL();
User::After(KSecond * 7); //Delay after configuration
SET_TIME
PositionRequestWithCheck(posInfo, KErrNone, KNetworkPsy2);
INFO_PRINTF1(_L("1 3"));
CHECK_TIME(3)
//LR from second PSY
positioner2.NotifyPositionUpdate(posInfo2, status2);
User::WaitForRequest(status2);
INFO_PRINTF1(_L("2 1"));
CHECK_TIME(1) //PSY1 and PSY2 fallback imediately, LR completed from PSY3 in 1s
CheckExpectedResult(status2.Int(), KErrNone, KWrongRequestResult);
CheckExpectedResult(posInfo2.ModuleId(), KNetworkPsy2, KWrongModuleIdReturned);
//4. PSY state change beause of LR for client1 shall affect LR for client2 as well
//
ConfigPsyL(KExtGpsPsy1, 1,
KConfigLRErrNoMemory //KErrNoMemory 1s
);
ConfigPsyL(positioner2, KExtGpsPsy1, 1,
KConfigLRNoError10s //No error in 10s
);
InitPsyListInDefaultProxyL();
User::After(KSecond * 7); //Delay after configuration
SET_TIME
positioner2.NotifyPositionUpdate(posInfo2, status2);
PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1);
INFO_PRINTF1(_L("3 1"));
CHECK_TIME(1);
User::WaitForRequest(status2);
CheckExpectedResult(status2.Int(), KErrNone, KWrongRequestResult);
CheckExpectedResult(posInfo2.ModuleId(), KIntGpsPsy1, KWrongModuleIdReturned);
INFO_PRINTF1(_L("4 0"));
CHECK_TIME(0);
//5. Dynamic list change caused by PSY1 shall not affect PSY list orders of client2
//if location request is already made.
ConfigPsyL(KExtGpsPsy1, 1,
KConfigLRErrNoMemory //KErrNoMemory 1s
);
ConfigPsyL(KIntGpsPsy1, 2,
KConfigLRNoError1s, //No error in 10s
KConfigLRErrNoMemory //KErrNoMemory 1s
);
ConfigPsyL(positioner2, KIntGpsPsy1, 2,
KConfigLRNoError1s, //No error in 10s
KConfigLRNoError20s //No error in 10s
);
ConfigPsyL(positioner2, KExtGpsPsy1, 1,
KConfigLRNoError45s //No error in 45s
);
InitPsyListInDefaultProxyL();
User::After(KSecond * 7); //Delay after configuration
PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1);
//Location request from client 2 shall be completed imediatelly, since
//IntGpsPsy shall be the first on the dynamic list
SET_TIME
positioner2.NotifyPositionUpdate(posInfo2, status2);
User::WaitForRequest(status2);
CheckExpectedResult(status2.Int(), KErrNone, KWrongRequestResult);
CheckExpectedResult(posInfo2.ModuleId(), KIntGpsPsy1, KWrongModuleIdReturned);
INFO_PRINTF1(_L("5 1"));
CHECK_TIME(1);
//Make location request from client 2
positioner2.NotifyPositionUpdate(posInfo2, status2);
SET_TIME
PositionRequestWithCheck(posInfo, KErrNone, KExtGpsPsy1);
INFO_PRINTF1(_L("6 1"));
CHECK_TIME(1)
User::WaitForRequest(status2);
CheckExpectedResult(status2.Int(), KErrNone, KWrongRequestResult);
CheckExpectedResult(posInfo2.ModuleId(), KNetworkPsy2, KWrongModuleIdReturned);
INFO_PRINTF1(_L("7 0"));
CHECK_TIME(0)
CleanupStack::PopAndDestroy(&positioner2);
//Cleanup
StandardCleanup();
return TestStepResult();
}
示例9: TestStepResult
TVerdict CTPKCS7ValidTest::doTestStepL()
{
if (TestStepResult() != EPass)
{
return TestStepResult();
}
__UHEAP_MARK;
TBool expectedValid;
if (GetBoolFromConfig(ConfigSection(),_L("IsValid"), expectedValid) == EFalse)
{
expectedValid = ETrue;
}
TInt err;
CPKCS7ContentInfo * contentInfo = NULL;
TRAP (err, contentInfo = CPKCS7ContentInfo::NewL(iRawData->Des()));
if(err == KErrNone)
{
CPKCS7SignedObject * p7 = NULL;
if( contentInfo->ContentType() == KPkcs7SignedData)
{
TRAP (err, p7 = CPKCS7SignedObject::NewL(*contentInfo));
//expired, and the case where certificate chain root is not on the device
if (!expectedValid)
{
if (err != KErrNone)
{
SetTestStepResult(EPass);
INFO_PRINTF2(_L("Got %d building PKCS7 object"), err);
return TestStepResult();
}
}
if (err != KErrNone)
{
SetTestStepResult(EFail);
INFO_PRINTF2(_L("Got %d building PKCS7 object"), err);
}
else
{
CleanupStack::PushL (p7);
const RPointerArray<CPKCS7SignerInfo>& signers = p7->SignerInfo();
TBool isValid = EFalse;
HBufC8* certificateEncoding = NULL;
if(!p7->ValidateSignerL(*signers[0], certificateEncoding))
{
INFO_PRINTF1(_L("Couldn't validate signer"));
}
else
{
CActiveScheduler* sched = NULL;
if (CActiveScheduler::Current() == NULL)
{
INFO_PRINTF1(_L("Installing scheduler"));
sched = new (ELeave) CActiveScheduler();
CleanupStack::PushL (sched);
__UHEAP_MARK;
CActiveScheduler::Install (sched);
}
RPointerArray<CX509Certificate> roots (&iRootCertificate, 1);
CPKIXCertChain * chain = CPKIXCertChain::NewLC(iFs, *certificateEncoding, roots);
TTime tm;
_LIT(KDateCorrect1,"20040801:");
TBuf <24> theDate(KDateCorrect1);
TInt err=tm.Set(theDate);
if(err)
{
tm.HomeTime();
}
CPKIXValidationResult* result = CPKIXValidationResult::NewLC();
CTPKCS7Validator* validator = new (ELeave) CTPKCS7Validator (chain, result, &tm);
CleanupStack::PushL (validator);
validator->doValidate ();
sched->Start ();
if (result->Error().iReason == EValidatedOK)
{
isValid = ETrue;
INFO_PRINTF1(_L("Validation success"));
}
else
{
INFO_PRINTF2(_L("Validation failed: %d"), result->Error().iReason);
}
CleanupStack::PopAndDestroy(validator);
CleanupStack::PopAndDestroy(result);
CleanupStack::PopAndDestroy(chain);
if (sched)
{
CActiveScheduler::Install (NULL);
CleanupStack::PopAndDestroy (sched);
}
}
if (certificateEncoding)
{
CleanupStack::PopAndDestroy(certificateEncoding);
//.........这里部分代码省略.........
示例10: sequence
/** Perform CMoLrStep1 test step.
This test verifies that the SUPL Protocol Module correctly handles
an MO-LR Self Locate Terminal Based sequence (assistance data
delivered via an RRLP payload).
@return TVerdict test result code
*/
TVerdict Cmolr1Step::doTestStepL()
{
INFO_PRINTF1(_L("\t********************************************************************"));
INFO_PRINTF1(_L("\tMOLR basic procedure followed - Assistance Data in RRLP message"));
INFO_PRINTF1(_L("\t********************************************************************"));
INFO_PRINTF1(_L("- START -"));
// Initiate MO-LR
TLbsNetSessionId sessionId1(TUid::Uid(0x87654321), 0x1111);
TLbsNetPosRequestOptionsAssistance options1;
options1.SetNewClientConnected(ETrue);
TLbsNetPosRequestQuality quality1;
options1.SetRequestQuality(quality1);
TLbsAsistanceDataGroup dataRequestMask1 = EAssistanceDataBadSatList;
options1.SetDataRequestMask(dataRequestMask1);
INFO_PRINTF1(_L("\tLBS -> RequestSelfLocation"));
iModule->RequestSelfLocation(sessionId1, options1);
// Check Connection Manager receives a request for connecting
if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EConnectReq))
{
SetTestStepResult(EFail);
return TestStepResult();
}
INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t ConnectionRequest -> NET"));
// Simulate the connection is up (inject that event)
INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t Connected <- NET"));
iNetworkObserver->InjectConnectedIndication(iNetworkObserver->SessionId());
// Check Connection Manager receives a request to send a SUPL START
if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESuplStartSendReq))
{
SetTestStepResult(EFail);
return TestStepResult();
}
INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL START -> NET"));
// Inject a SUPL RESPONSE
INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL RESPONSE <- NET"));
CSuplMessageBase* resp = BuildSuplResponseL(TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted);
iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), resp);
// Check gateway receives Location Request
INFO_PRINTF1(_L("\tLBS <- ProcessLocationRequest()"));
if (EFail == CheckGatewayCallbackL(
CSuplGatewayObserver::EProcessLocationRequest) ||
MLbsNetworkProtocolObserver::EServiceSelfLocation != iGatewayObserver->LocType())
{
SetTestStepResult(EFail);
return TestStepResult();
}
// LBS Requests assistance data
INFO_PRINTF1(_L("\tLBS -> RequestAssistanceData ()"));
TLbsNetSessionIdArray dummyIdArray;
iModule->RequestAssistanceData(dataRequestMask1, dummyIdArray);
// Check Connection Manager receives a request to send a SUPL POS INIT
// with the assistance data mask requested by the gateway
if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESendSuplPosInitSendReq))
{
SetTestStepResult(EFail);
return TestStepResult();
}
INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL POS INIT -> NET"));
// Inject a SUPL POS with some of the Assistance data requested
INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL POS - RRLP Assitance Data <- NET"));
CSuplMessageBase* suplPos = BuildSuplPosAssitDataL(EAssistanceDataAquisitionAssistance|EAssistanceDataBadSatList, EFalse);
iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), suplPos);
// Check gateway receives the assistance data types requested.
INFO_PRINTF1(_L("\tLBS <- ProcessAssistanceData()"));
if (EFail == CheckGatewayCallbackL(
CSuplGatewayObserver::EProcessAssistanceData) ||
(dataRequestMask1 & iGatewayObserver->AssistanceDataSetMask() != dataRequestMask1))
{
SetTestStepResult(EFail);
return TestStepResult();
}
// Check the Connection Manager receives a request to send a SUPL POS (ack to assistance data)
if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESendSuplPosSendReq))
{
SetTestStepResult(EFail);
//.........这里部分代码省略.........
示例11: INFO_PRINTF1
TVerdict CTestLtsySmsReceive::doTestStepPreambleL()
{
INFO_PRINTF1(_L("CTestLtsySmsReceive::doTestStepPreambleL called"));
SetTestStepResult(EPass);
return TestStepResult();
}
示例12: INFO_PRINTF1
/**
Function : doTestStepL
Description : Sets the priority of an email message via the IMAP \Flagged flag
@return : TVerdict - Test step result
*/
TVerdict CT_MsgSetImap4EmailPriority::doTestStepL()
{
INFO_PRINTF1( _L("Test Step : SetSmtpEmailPriority") );
if (ReadIni())
{
TMsvId parentFolderId;
// Local parent folder location...
if(iLocation.Compare(_L("LOCAL"))==0)
{
// Retrieves the folder Id based on the local folder name read from the ini file
parentFolderId = CT_MsgUtilsEnumConverter::FindFolderIdByName(iParentFolderName);
if(parentFolderId == KErrNotFound)
{
ERR_PRINTF1(_L("Invalid local parent folder name specified"));
SetTestStepResult(EFail);
return TestStepResult();
}
INFO_PRINTF2(_L("The local parent folder Id is %d"),parentFolderId);
}
// Remote parent folder location...
else if(iLocation.Compare(_L("REMOTE"))==0)
{
TRAPD(err,parentFolderId = CT_MsgUtils::GetRemoteFolderIdByNameL(iSharedDataIMAP.iSession, iImapAccountName, iParentFolderName));
if(err == KErrNotFound)
{
ERR_PRINTF1(_L("Invalid remote parent folder name specified"));
SetTestStepResult(EFail);
return TestStepResult();
}
INFO_PRINTF2(_L(" The remote parent folder Id is %d"),parentFolderId);
}
// Location Local or Remote not specified...
else
{
ERR_PRINTF1(_L("Invalid parent folder location"));
SetTestStepResult(EFail);
return TestStepResult();
}
// Retrieves the message Id based on the message subject of the email under the given parent folder
TMsvId messageId;
TRAPD(err,messageId = CT_MsgUtils::SearchMessageBySubjectL(iSharedDataIMAP.iSession, parentFolderId, iEmailSubject));
if(err == KErrNotFound)
{
ERR_PRINTF1(_L("The given message is not found"));
SetTestStepResult(EFail);
}
// Message found
else
{
INFO_PRINTF2(_L("The Message Id is %d"),messageId);
// Retrieve the default Smtp service Id
TMsvId smtpServiceId(0);
TRAPD(err, smtpServiceId = CT_MsgUtilsCentralRepository::GetDefaultSmtpServiceIdL());
if(err != KErrNone)
{
ERR_PRINTF2(_L("Failure while getting the default SMTP Service Id. Error = %d"),err);
SetTestStepResult(EFail);
}
else
{
INFO_PRINTF2(_L("The Default Smtp Service Id is %d"),smtpServiceId);
CT_MsgActive& active = Active();
delete iOperation;
iOperation=NULL;
// Setting the current context to the parent of the mesage
CMsvEntry* entry = CMsvEntry::NewL(*iSharedDataIMAP.iSession, messageId, TMsvSelectionOrdering());
CleanupStack::PushL(entry);
TMsvEmailEntry emailEntry(entry->Entry());
if(iEmailPriority==1)
{
emailEntry.SetFlaggedIMAP4Flag(ETrue);
iOperation = entry->ChangeL(emailEntry,active.iStatus);
active.Activate();
CActiveScheduler::Start();
User::LeaveIfError(active.Result());
INFO_PRINTF1(_L("The state of the Flagged IMAP4 flag of the email is set for urgent/special attention"));
}
else if (iEmailPriority==0)
{
emailEntry.SetFlaggedIMAP4Flag(EFalse);
iOperation = entry->ChangeL(emailEntry,active.iStatus);
active.Activate();
CActiveScheduler::Start();
User::LeaveIfError(active.Result());
INFO_PRINTF1(_L("The state of the Flagged IMAP4 flag of the email is NOT set for urgent/special attention"));
}
else
{
ERR_PRINTF1(_L("Error in setting the Flagged IMAP4 flag! Usage: 1=ETrue and 0=EFalse"));
//.........这里部分代码省略.........
示例13: InitializeL
TVerdict CEntryStatusStep::doTestStepPreambleL()
{
InitializeL();
SetTestStepResult(EPass);
_LIT(KRequestChangeNotify, "requestchangenotify");
_LIT(KCertEntryState, "state");
_LIT(KNewEntryString, "ENewEntry");
_LIT(KEntryAwaitingApprovalString, "EEntryAwaitingApproval");
_LIT(KEntryDeniedString, "EEntryDenied");
_LIT(KEntryApprovedString, "EEntryApproved");
_LIT(KCancelPoint, "cancelpoint");
_LIT(KOpen, "Open");
_LIT(KGetState, "GetStateL");
_LIT(KChangeNotify, "ChangeNotify");
TPtrC cancelPoint;
_LIT(KCancelMessageFmt, "This test step will call Cancel() on the cert cache session after %S()");
if (!GetStringFromConfig(ConfigSection(), KCancelPoint, cancelPoint))
{
iCancelPoint = ENoCancel;
}
else if (cancelPoint.CompareF(KOpen) == 0)
{
iCancelPoint = EAfterOpen;
Logger().WriteFormat(KCancelMessageFmt, &KOpen);
}
else if (cancelPoint.CompareF(KGetState) == 0)
{
iCancelPoint = EAfterGetState;
Logger().WriteFormat(KCancelMessageFmt, &KGetState);
}
else if (cancelPoint.CompareF(KChangeNotify) == 0)
{
iCancelPoint = EAfterChangeNotify;
Logger().WriteFormat(KCancelMessageFmt, &KChangeNotify);
}
// Check if this step should wait for change notification.
if (!GetBoolFromConfig(ConfigSection(), KRequestChangeNotify, iRequestChangeNotify))
{
iRequestChangeNotify = EFalse;
}
else if (iRequestChangeNotify)
{
if (iCancelPoint == ENoCancel)
{
_LIT(KMessage, "This test step will wait for change notification.");
Logger().Write(KMessage);
}
else if (iCancelPoint != EAfterChangeNotify)
{
_LIT(KErrorMessage, "Invalid test config, requesting notification but cancelling earlier.");
Logger().Write(KErrorMessage);
SetTestStepResult(EAbort);
return EAbort;
}
_LIT(KRequirePendingApproval, "requirependingapproval");
if (!GetBoolFromConfig(ConfigSection(), KRequirePendingApproval, iRequirePendingApproval))
{
iRequirePendingApproval = ETrue;
}
if (iRequirePendingApproval)
{
_LIT(KMessage2, "This step will fail if the state is not initially EEntryAwaitingApproval.");
Logger().Write(KMessage2);
}
else
{
_LIT(KMessage2, "Notification will be requested even if the state is not initially EEntryAwaitingApproval.");
Logger().Write(KMessage2);
}
}
TPtrC expectedState;
if (!GetStringFromConfig(ConfigSection(), KCertEntryState, expectedState))
{
_LIT(KMessage, "Could not read expected certificate approval state from INI, abort.");
Logger().Write(KMessage);
SetTestStepResult(EAbort);
}
else
{
_LIT(KMessageFmt, "Certificate state is expected to be %S.");
if (expectedState.CompareF(KNewEntryString) == 0)
{
iExpectedState = ENewEntry;
Logger().WriteFormat(KMessageFmt, &KNewEntryString);
}
else if (expectedState.CompareF(KEntryAwaitingApprovalString) == 0)
{
iExpectedState = EEntryAwaitingApproval;
Logger().WriteFormat(KMessageFmt, &KEntryAwaitingApprovalString);
}
else if (expectedState.CompareF(KEntryApprovedString) == 0)
{
iExpectedState = EEntryApproved;
//.........这里部分代码省略.........
示例14: TestStepResult
TVerdict CEntryStatusStep::doTestStepL()
{
// don't continue if previous phases have aborted
if (TestStepResult() != EPass)
{
return TestStepResult();
}
// Delay briefly to ensure that any update entry steps in concurrent tests can
// check first (which sets the state to EAwaitingApproval.)
User::After(KStateCheckDelay);
_LIT(KCancelMessage, "Cancelling...");
// Cancel if set to do so before checking state.
if (iCancelPoint == EAfterOpen)
{
Logger().Write(KCancelMessage);
Session().Cancel();
}
iState = Session().GetStateL();
// log the action
_LIT(KMessageFmt, "State of cache entry for certificate '%S' is %d.");
Logger().WriteFormat(KMessageFmt, SubjectLC(), iState);
CleanupStack::PopAndDestroy(1); // subject
if (iCancelPoint == EAfterGetState)
{
Logger().Write(KCancelMessage);
Session().Cancel();
iState = Session().GetStateL();
Logger().WriteFormat(KMessageFmt, SubjectLC(), iState);
CleanupStack::PopAndDestroy(1); // subject
}
else if (iRequestChangeNotify)
{
if (iState == EEntryAwaitingApproval || !iRequirePendingApproval)
{
TRequestStatus status;
Session().RequestNotify(status);
if (iCancelPoint == EAfterChangeNotify)
{
Logger().Write(KCancelMessage);
Session().Cancel();
}
User::WaitForRequest(status);
User::LeaveIfError(status.Int());
iState = Session().GetStateL();
// log the action
_LIT(KMessageFormat, "Got cache change notify for certificate '%S', state = %d.");
Logger().WriteFormat(KMessageFormat, SubjectLC(), iState);
CleanupStack::PopAndDestroy(1); // certificate status
}
else
{
// log the action
_LIT(KMessageFormat, "Cannot wait for change notify, entry state is not %d (EEntryAwaitingApproval.)");
Logger().WriteFormat(KMessageFormat, EEntryAwaitingApproval);
SetTestStepResult(EFail) ;
}
}
return TestStepResult();
}
示例15: TestStepResult
TVerdict CTestCalIndexFileModifyEntryStep::doTestStepPostambleL()
{
return TestStepResult();
}