enum TVerdict CTestSetPrClientV2MulCallFrSameSes::doTestStepL() // // Test connecting Multiple call of setpriorityclientV2 API from the same session // { INFO_PRINTF1(_L("Test connecting Multiple call of setpriorityclientV2 API from the same session")); RTelServer first; TInt ret=first.Connect(); INFO_PRINTF2(_L("RTelServer::Connect returned %d."),ret); TESTCHECK(ret, KErrNone); INFO_PRINTF1(_L("Multiple call of setpriorityclientV2 API on the same session")); ret=first.SetPriorityClientV2(); TESTCHECK(ret, KErrNone); INFO_PRINTF2(_L("first call of RTelServer::SetPriorityClientV2 in same session %d."),ret); ret=first.SetPriorityClientV2(); TESTCHECK(ret, KErrAlreadyExists); INFO_PRINTF2(_L("Second call of RTelServer::SetPriorityClientV2 in same session %d."),ret); first.Close(); return TestStepResult(); }
enum TVerdict CTestSetPrClientV2CapNsidNegCheck::doTestStepL() // // Test connecting Negative check of Capability and SID check for SetPriorityClientV2 API // { INFO_PRINTF1(_L("Test connecting Capability and SID check for SetPriorityClientV2 API")); RTelServer first; TInt ret=first.Connect(); INFO_PRINTF2(_L("RTelServer::Connect returned %d."),ret); TESTCHECK(ret, KErrNone); INFO_PRINTF1(_L("Capability and SID check of setpriorityclientV2 API")); ret=first.SetPriorityClientV2(); TESTCHECK(ret,KErrPermissionDenied); INFO_PRINTF2(_L("first call of RTelServer::SetPriorityClientV2 %d."),ret); return TestStepResult(); }
TInt CTestSetPrClientV2MulCallFrDiffClt ::SecondThreadFunctiona(TAny* aThreadData2) { RTelServer server; CTestStep* testStep = static_cast<CTestStep*>(aThreadData2); CTrapCleanup* cleanup; if ((cleanup=CTrapCleanup::New())==NULL) { return KErrGeneral; } TInt ret = server.Connect(); testStep->TEST1(ret==KErrNone,ETrue); testStep->INFO_PRINTF2(_L("Thread2 RTelServer::Connect returned %d."),ret); ret=server.SetPriorityClientV2(); testStep->TEST1(( (ret==KErrAlreadyExists) || (ret==KErrNone) ),ETrue); testStep->INFO_PRINTF2(_L("Thread2 RTelServer::SetPriorityClientV2 returned %d."),ret); User::After(KETelThreadShutdownGuardPeriod); server.Close(); delete cleanup; return ret; }