示例#1
0
enum TVerdict CTestErrGetTsyOk::doTestStepL()
/** 
Check that RTelServer::GetTsyName and RTelServer::SendReceive( EEtelServerGetTsyName, ... ) 
	return no errors when they use a large enough valid buffer for returning the tsy name. 

@return EPass or EFail 
*/
	{

	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);
		
	TInt indexOfPhone=0;
	TName tsyName;
	ret = server.GetTsyName(indexOfPhone, tsyName);
	  // Check that the original still  works okay.
	TESTCHECK(ret, KErrNone);

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();

	}
enum TVerdict CTestRelinquishOwner::doTestStepL()
	{
 	INFO_PRINTF1(_L("Test Call Recover Port And Relinquish Ownership"));
	RTelServer serverA;
	TInt ret = serverA.Connect();
    TESTCHECK(ret, KErrNone);
   	ret=serverA.LoadPhoneModule(DSTD_MODULE_NAME);
    TESTCHECK(ret, KErrNone);
	RCall callA;
    ret = callA.OpenNewCall(serverA,DSTD_CALL_FULLNAME);
	TESTCHECK(ret, KErrNone);
	RCall::TCallParams callParams;
	RCall::TCallParamsPckg callParamsPckg(callParams);

    ret=callA.Dial(callParamsPckg,DACQ_PHONE_NUMBER_TO_DIAL);
	TESTCHECK(ret, KErrNone);

	RCall::TCommPort port;
	ret=callA.LoanDataPort(port);
    TESTCHECK(ret, KErrNone);
	callA.Close();

	ServerClose(serverA);

	return TestStepResult();
	}
示例#3
0
enum TVerdict CTestErrGetTsyVersionNumberOk::doTestStepL()
/** 
Check that RTelServer::GetTsyVersionNumber and RTelServer::SendReceive( EEtelServerGetTsyVersionNo, ... )
	return no errors when there is a large enough valid buffer to hold the version number.

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	// Check that GetTsyVersionNumber still runs okay.
	TInt indexOfPhone=0;
	TName tsyName;
	ret = server.GetTsyName(indexOfPhone, tsyName);	
		// Get a name for us to use.
	TESTCHECK(ret, KErrNone);

	TVersion version;
	ret = server.GetTsyVersionNumber(tsyName, version);
	TESTCHECK(ret, KErrNone);

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();
	}
示例#4
0
enum TVerdict CTestErrIsSupportedByModuleOk::doTestStepL()
/** 
Check that RTelServer::IsSupportedByModuleo and RTelServer::SendReceive( EEtelServerQueryTsyFunctionality, ... )
 return no errors when there is a large enough valid buffer to hold the result.

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	// Check IsSupportedByModule is ok,
	TInt indexOfPhone=0;
	TName tsyName;
	ret = server.GetTsyName(indexOfPhone, tsyName);	
		// Get a name for us to use.
	TESTCHECK(ret, KErrNone);

	TInt mixin = 0;
	TBool result = 0;
	ret = server.IsSupportedByModule(tsyName, mixin, result);

	TESTCHECK(ret, KErrNone);

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();
	}
示例#5
0
enum TVerdict CTestErrSetExtendedErrorGranularityPanic::doTestStepL()
/** 
Check that RTelServer::SendReceive( EEtelServerSetExtendedErrorGranularity, ... ) panics the client when the wrong size buffer is passed in.

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	// Send Fewer bytes required for enum TErrorGranularity. 
	RTelServer::TErrorGranularity granularity = RTelServer::EErrorExtended;
	TPtr8 ptr(REINTERPRET_CAST(TText8*,CONST_CAST(RTelServer::TErrorGranularity*,&granularity)),
		sizeof(RTelServer::TErrorGranularity)-1,sizeof(RTelServer::TErrorGranularity));
		// Do not have all the bytes required to make the enum.

	TIpcArgs args(&ptr);
	ret = server.SendReceive(EEtelServerSetExtendedErrorGranularity, args);
			// This will panic and will not continue.

	ServerClose(server);
	return TestStepResult();
	}
示例#6
0
enum TVerdict CTestErrIsSupportedByModuleSmallBuffer::doTestStepL()
/** 
Check that RTelServer::SendReceive( EEtelServerQueryTsyFunctionality, ... ) returns an error when a small buffer is passed in. 

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	TInt indexOfPhone=0;
	TName tsyName;
	ret = server.GetTsyName(indexOfPhone, tsyName);	
		// Get a name for us to use.
	TESTCHECK(ret, KErrNone);

	char mixin = 0;
	TBool result = 0;
	TPtr8 ptr1(REINTERPRET_CAST(TText8*,&mixin),sizeof(mixin),sizeof(mixin));
	TPtr8 ptr2(REINTERPRET_CAST(TText8*,&result),sizeof(result),sizeof(result));
	TIpcArgs args(&tsyName,&ptr1,&ptr2);
	ret = server.SendReceive(EEtelServerQueryTsyFunctionality,args);

	TESTCHECK(ret, KErrOverflow);

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();
	}
示例#7
0
enum TVerdict CTestErrGetTsySmallBuffer::doTestStepL()
/** 
Check that RTelServer::SendReceive( EEtelServerGetTsyName, ... ) returns an error when a descriptor is too small 
 for the tsy name.

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	// Now lets pass in a small data buffer.
	// This is possible if a programmer derives from RTelServer
	// and makes a mistake, or does it on purpose for some perverse reason.

	TInt indexOfPhone=0;
	TBuf<1> tsyName;
	TIpcArgs args(indexOfPhone,&tsyName);
	ret = server.SendReceive(EEtelServerGetTsyName,args);

	TESTCHECK(ret, KErrOverflow);

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();
	}
enum TVerdict CTestOpenFaxFrCall::doTestStepL()
	{
	INFO_PRINTF1(_L("Test Open Fax From Call"));

    RTelServer server;
	TInt ret = server.Connect();
    TESTCHECK(ret, KErrNone);
   	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
    TESTCHECK(ret, KErrNone);

	RCall call;
	ret=call.OpenNewCall(server,DSTD_CALL_FULLNAME);
    TESTCHECK(ret, KErrNone);

	RFax fax;
	ret=fax.Open(call);
    TESTCHECK(ret, KErrNone);

	fax.Close();
	call.Close();
  	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);
    ServerClose(server);

	return TestStepResult();
	}
enum TVerdict CTestOpenCallFrLine::doTestStepL()
	{
	INFO_PRINTF1(_L("Open Call from RLine!"));
    RTelServer server;
	TInt ret = server.Connect();
    TESTCHECK(ret, KErrNone);
   	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
    TESTCHECK(ret, KErrNone);

	RPhone phone;
    ret = phone.Open(server,DSTD_PHONE_NAME);
    TESTCHECK(ret, KErrNone);

	RLine line;
    ret = line.Open(phone,DSTD_LINE_NAME);
	TESTCHECK(ret, KErrNone);

	RCall call;
	ret = call.OpenNewCall(line);
    TESTCHECK(ret, KErrNone);
	call.Close();

	line.Close();
	phone.Close();
  	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);
    ServerClose(server);

	return TestStepResult();
	}
enum TVerdict CTestRelinquishCase1::doTestStepL()
//
// This test is used to check the objects are destroy in the right order
// make break points at CCallBase,CLineBase,CPhoneBase and CPhoneFactoryBase
// and ensure that to stop at the break point in order described above
//
    {
 	INFO_PRINTF1(_L("Test Call Relinquish Case 1"));
	RTelServer serverA;
	TInt ret = serverA.Connect();
    TESTCHECK(ret, KErrNone);
   	ret=serverA.LoadPhoneModule(DSTD_MODULE_NAME);
    TESTCHECK(ret, KErrNone);;

	RCall callA;
    ret = callA.OpenNewCall(serverA,DSTD_CALL_FULLNAME);
	TESTCHECK(ret, KErrNone);;

	RCall::TCallParams callParams;
	RCall::TCallParamsPckg callParamsPckg(callParams);

    ret=callA.Dial(callParamsPckg,DACQ_PHONE_NUMBER_TO_DIAL);
	TESTCHECK(ret, KErrNone);;


	callA.Close();
	ServerClose(serverA);

	return TestStepResult();
	}
示例#11
0
enum TVerdict CTestErrGetPhoneInfoSmallBuffer::doTestStepL()
/** 
Check that RTelServer::SendReceive( EEtelServerPhoneInfoByIndex, ... ) returns an error when a descriptor is too small 
 for the phone info.

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	// Now lets pass in a small data buffer 
	// This is possible if a programmer derives from RTelServer
	// and makes a mistake, or does it on purpose for some perverse reason.
	// Normally goes through server API.

	TInt index=0;
	TBuf8<1> phoneInfo;

	TPckg< TBuf8<1> > result(phoneInfo);

	TIpcArgs args(&result,index);
	ret = server.SendReceive(EEtelServerPhoneInfoByIndex,args);

	TESTCHECK(ret, KErrOverflow);

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();
	}
示例#12
0
enum TVerdict CTestErrGetPhoneInfoOk::doTestStepL()
/** 
Check that RTelServer::GetPhoneInfo and RTelServer::SendReceive( EEtelServerPhoneInfoByIndex, ... )
 return no errors when there is a large enough valid buffer to hold the phone info.

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	TInt index=0;
	RTelServer::TPhoneInfo phoneInfo;

	ret = server.GetPhoneInfo(index,phoneInfo);
	TESTCHECK(ret, KErrNone);

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();
	}
示例#13
0
enum TVerdict CTestErrNewTelObjectIllegalBuffer::doTestStepL()
/** 
Check that CTelSession::NewTelObject fails when an illegal buffer is passed to it for the name of the call.
 (Uses similar code to that in RTelServer::OpenNewCall().)

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	RTelServer::TPhoneInfo phoneInfo;

	ret = server.GetPhoneInfo( 0, phoneInfo );
	TESTCHECK(ret, KErrNone);

	RPhone phone;
	ret = phone.Open( server, phoneInfo.iName );
	TESTCHECK(ret, KErrNone);


	RPhone::TLineInfo lineInfo;
	ret = phone.GetLineInfo( 0, lineInfo );
	TESTCHECK(ret, KErrNone);


	RLine line;
	ret = line.Open( phone, lineInfo.iName );

	char retName;  
		// Illegal buffer.

	RCall1 call;

	// Taken from OpenNewCall(line , retName); 
	RSessionBase* session=&line.SessionHandle();
	call.ConstructL();
	TInt subSessionHandle=line.SubSessionHandle();

	TPtrC name(_L("::"));	// necessary so that server knows to ask TSY for new name

	TIpcArgs args(&name,REINTERPRET_CAST(TDes*,&retName),subSessionHandle);
	call.SetSessionHandle(*session);
	ret = call.CreateSubSession(*session,EEtelOpenFromSubSession,args);
	call.Destruct();

	TESTCHECK(ret, KErrBadDescriptor);

	line.Close();
	phone.Close();

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();
	}
enum TVerdict CTestMemZeroLength::doTestStepL()
	{
	INFO_PRINTF1(_L("Test Zero Length Dials"));
    RTelServer server;
	TInt ret = server.Connect();
    TESTCHECK(ret, KErrNone);
   	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
    TESTCHECK(ret, KErrNone);

	RPhone phone;
    ret = phone.Open(server,DSTD_PHONE_NAME);
    TESTCHECK(ret, KErrNone);

	RLine line;
    ret = line.Open(phone,DSTD_LINE_NAME);
	TESTCHECK(ret, KErrNone);

	RCall call;
	TName name;
    ret = call.OpenNewCall(line,name);
	TESTCHECK(ret, KErrNone);

	RCall::TTelNumberC number(_L(""));
	TPtrC8 callParams(_L8(""));
	ret=call.Dial(number);
    TESTCHECK(ret, KErrArgument);

	ret=call.Dial(callParams,number);
    TESTCHECK(ret, KErrArgument);

	TRequestStatus status;
	call.Dial(status,number);
	User::WaitForRequest(status);
    TESTCHECK(status.Int(), KErrArgument);

	call.Dial(status,callParams,number);
	User::WaitForRequest(status);
    TESTCHECK(status.Int(), KErrArgument);

	call.Close();
	line.Close();

	INFO_PRINTF1(_L("Passed illegal Cancel Test"));
	INFO_PRINTF1(_L("Test an illegal Cancel"));

// This shouldn't panic
	phone.NotifyModemDetectedCancel();

	phone.Close();
    ServerClose(server);

	INFO_PRINTF1(_L("Passed illegal Cancel Test"));

	return TestStepResult();
	}
示例#15
0
int ServerDel (Server * Current){

  struct object *obj = (object *) Current;

  ServerClose(Current);
  free(obj);
  Current = NULL;

  return (0);


}
示例#16
0
enum TVerdict CTestErrNewTelObjectOk::doTestStepL()
/** 
Check that RTelServer::OpenNewCall returns no errors 
 when it has a large enough valid buffer to put the call name in. 

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	RTelServer::TPhoneInfo phoneInfo;

	ret = server.GetPhoneInfo( 0, phoneInfo );
	TESTCHECK(ret, KErrNone);

	RPhone phone;
	ret = phone.Open( server, phoneInfo.iName );
	TESTCHECK(ret, KErrNone);


	RPhone::TLineInfo lineInfo;
	ret = phone.GetLineInfo( 0, lineInfo );
	TESTCHECK(ret, KErrNone);


	RLine line;
	ret = line.Open( phone, lineInfo.iName );

	TName retName;

	// Check that we can get a name for the newly opened call. 

	RCall call;
	ret = call.OpenNewCall(line , retName); 
	TESTCHECK(ret, KErrNone);

	call.Close();
	line.Close();
	phone.Close();

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);

	return TestStepResult();
	}
示例#17
0
enum TVerdict CTestSetDes::doTestStepL()
	{
	INFO_PRINTF1(_L("Set By Des"));
    RTelServer server;
	TInt ret = server.Connect();
    TESTCHECK(ret, KErrNone);
   	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
    TESTCHECK(ret, KErrNone);
	RPhone phone;
	ret = phone.Open(server,DSTD_PHONE_NAME);
    TESTCHECK(ret, KErrNone);

	RCall call;
	ret=call.OpenNewCall(phone,DSTD_OPEN_CALL_FROM_PHONE_NAME);
	TESTCHECK(ret, KErrNone);

	RCall::TCallParams callParams;
	RCall::TCallParamsPckg callParamsPckg(callParams);

	TDummyString dialString=DACQ_PHONE_NUMBER_TO_DIAL;
	ret=call.Dial(callParamsPckg,dialString);
	TESTCHECK(ret, KErrNone);

	RFax fax;
	ret=fax.Open(call);

	TRequestStatus faxReadStatus;
	TRequestStatus faxWriteStatus;

	TAcqFaxBuf readbuf=DACQ_FAX_BUF_DATA;
	TAcqFaxBuf writebuf=DACQ_FAX_BUF_DATA;

	// check each req complete correctly
	fax.Read(faxReadStatus,readbuf);
	User::WaitForRequest(faxReadStatus);
	TESTCHECKSTR(readbuf, DACQ_FAX_BUF_DATA);

	fax.Write(faxWriteStatus,writebuf);
	User::WaitForRequest(faxWriteStatus);

	fax.Close();
	call.Close();
	phone.Close();
  	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);
    ServerClose(server);

	return TestStepResult();
	}
示例#18
0
enum TVerdict CTestErrNewTelObjectSmallBuffer::doTestStepL()
/** 
Check that CTelSession::NewTelObject fails when a small buffer is passed to it for the name of the call.
 (Uses similar code to that in RTelServer::OpenNewCall().)

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	RTelServer::TPhoneInfo phoneInfo;

	ret = server.GetPhoneInfo( 0, phoneInfo );
	TESTCHECK(ret, KErrNone);

	RPhone phone;
	ret = phone.Open( server, phoneInfo.iName );
	TESTCHECK(ret, KErrNone);


	RPhone::TLineInfo lineInfo;
	ret = phone.GetLineInfo( 0, lineInfo );
	TESTCHECK(ret, KErrNone);


	RLine line;
	ret = line.Open( phone, lineInfo.iName );

	TBuf<1> retName;
		//Buffer too small to recieve name.

	RCall call;
	ret = call.OpenNewCall(line , retName); 

	TESTCHECK(ret, KErrOverflow);

	line.Close();
	phone.Close();

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();
	}
enum TVerdict CTestOpenPhoneFrServ::doTestStepL()
	{
	INFO_PRINTF1(_L("Test Open Phone From Server"));

    RTelServer server;
	TInt ret = server.Connect();
    TESTCHECK(ret, KErrNone);
   	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
    TESTCHECK(ret, KErrNone);

	RPhone phone;
    ret = phone.Open(server,DSTD_PHONE_NAME);
    TESTCHECK(ret, KErrNone);
	phone.Close();
  	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);
    ServerClose(server);

	return TestStepResult();
    }
示例#20
0
enum TVerdict CTestErrGetTsyVersionNumberSmallBuffer::doTestStepL()
/** 
Check that RTelServer::SendReceive( EEtelServerGetTsyVersionNo, ... ) returns an error when a descriptor is too small 
 for the version info.

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	// Now lets pass in a small data buffer 
	// This is possible if a programmer derives from RTelServer
	// and makes a mistake, or does it on purpose for some perverse reason.

	TInt indexOfPhone=0;
	TName tsyName;
	ret = server.GetTsyName(indexOfPhone, tsyName);	
		// Get a name for us to use.
	TESTCHECK(ret, KErrNone);

	TBuf8<1> version;

	TPtr8 ptr(REINTERPRET_CAST(TText8*,&version),version.Length(),version.MaxLength() );
	TIpcArgs args(&tsyName, &ptr);
	ret = server.SendReceive(EEtelServerGetTsyVersionNo,args);
		// Note only possible of error if we inherit and mess around with calls.
		// Otherwise goes through API, which is more safe, but even then we can
		// do some casting.

	TESTCHECK(ret, KErrOverflow);

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();
	}
示例#21
0
enum TVerdict CTestErrGetTsyVersionNumberIllegalBuffer::doTestStepL()
/** 
Check that RTelServer::SendReceive( EEtelServerGetTsyVersionNo, ... ) returns an error when a bad buffer is passed in.
@SYMTestPriority High

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	// Now lets pass in an illegal data buffer.
	// This is possible if a programmer derives from RTelServer
	// and makes a mistake, or does it on purpose for some perverse reason.

	TInt indexOfPhone=0;
	TName tsyName;
	ret = server.GetTsyName(indexOfPhone, tsyName);	
		// Get a name for us to use.
	TESTCHECK(ret, KErrNone);

	TInt version=0;

	TIpcArgs args(&tsyName, version);
	ret = server.SendReceive(EEtelServerGetTsyVersionNo,args);
		// Note only possible of error if we inherit and mess around with calls.
		// Otherwise goes through API, which is more safe, but even then we can
		// do some casting.

	TESTCHECK(ret, KErrBadDescriptor);

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();
	}
示例#22
0
enum TVerdict CTestErrSetExtendedErrorGranularityOk::doTestStepL()
/** 
Check that RTelServer::SetExtendedErrorGranularity and RTelServer::SendReceive( EEtelServerSetExtendedErrorGranularity, ... )
 return no errors (or panics) when there is a large enough input buffer to hold the granularity settings.

@return EPass or EFail 
*/
	{
	RTelServer1 server;
	TInt ret = server.Connect();
	TESTCHECK(ret, KErrNone);
	ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);

	// Check works okay after modification.
	RTelServer::TErrorGranularity granularity = RTelServer::EErrorExtended;
	ret = server.SetExtendedErrorGranularity(granularity);
	TESTCHECK(ret, KErrNone);

	ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
	TESTCHECK(ret, KErrNone);	
	ServerClose(server);
	return TestStepResult();
	}
enum TVerdict CTestPhoneInfo::doTestStepL()
{
    INFO_PRINTF1(_L("Test Phone Info"));

    RTelServer server;
    TInt ret = server.Connect();
    TESTCHECK(ret, KErrNone);

    TInt  originalNumPhones;
    ret = server.EnumeratePhones(originalNumPhones);
    TESTCHECK(ret, KErrNone);

    ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
    TESTCHECK(ret, KErrNone);
    ret=server.LoadPhoneModule(DSTDNC_MODULE_NAME);
    TESTCHECK(ret, KErrNone);

    TInt numPhones;
    ret=server.EnumeratePhones(numPhones);
    TESTCHECK(ret, KErrNone);
    INFO_PRINTF2(_L("EnumeratePhones returned %d"),numPhones);

    INFO_PRINTF4(_L("Should equal %d + %d + %d"), DSTDNC_NUMBER_OF_PHONES, DSTD_NUMBER_OF_PHONES,
                 originalNumPhones);
    TESTCHECK(numPhones, (DSTDNC_NUMBER_OF_PHONES + DSTD_NUMBER_OF_PHONES + originalNumPhones));

    RTelServer::TPhoneInfo info;
    TName tsyName;
    TInt  phoneIndex = originalNumPhones;

    // first phone
    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNone);
    TESTCHECK(info.iNetworkType, DSTD_NETWORK_TYPE);
    TESTCHECKSTR(info.iName, DSTD_PHONE_NAME);
    TESTCHECK(info.iNumberOfLines, DSTD_NUMBER_OF_LINES);

    ret=server.GetTsyName(phoneIndex,tsyName);
    TESTCHECK(ret, KErrNone);
    TESTCHECKSTR(tsyName, DSTD_MODULE_NAME);
    phoneIndex++;

    // second phone
    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNone);
    TESTCHECK(info.iNetworkType, DSTDFC_NETWORK_TYPE);
    TESTCHECKSTR(info.iName, DSTDFC_PHONE_NAME);
    TESTCHECK(info.iNumberOfLines, DSTDFC_NUMBER_OF_LINES);

    ret=server.GetTsyName(phoneIndex,tsyName);
    TESTCHECK(ret, KErrNone);
    TESTCHECKSTR(tsyName, DSTD_MODULE_NAME);
    phoneIndex++;

    // third phone
    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNone);
    TESTCHECK(info.iNetworkType, DSTDPM_NETWORK_TYPE);
    TESTCHECKSTR(info.iName, DSTDPM_PHONE_NAME);
    TESTCHECK(info.iNumberOfLines, DSTDPM_NUMBER_OF_LINES);

    ret=server.GetTsyName(phoneIndex,tsyName);
    TESTCHECK(ret, KErrNone);
    TESTCHECKSTR(tsyName, DSTD_MODULE_NAME);
    phoneIndex++;

    // fourth phone
    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNone);
    TESTCHECK(info.iNetworkType, DSTDPM_NETWORK_TYPE);
    TESTCHECKSTR(info.iName, DSTD_SLOW_PHONE_NAME);
    TESTCHECK(info.iNumberOfLines, DSTDPM_NUMBER_OF_LINES);

    ret=server.GetTsyName(phoneIndex,tsyName);
    TESTCHECK(ret, KErrNone);
    TESTCHECKSTR(tsyName, DSTD_MODULE_NAME);
    phoneIndex++;

    // fifth phone
    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNone);
    TESTCHECK(info.iNetworkType, DSTDNC_NETWORK_TYPE);
    TESTCHECKSTR(info.iName, DSTDNC_PHONE_NAME);
    TESTCHECK(info.iNumberOfLines, DSTDNC_NUMBER_OF_LINES);

    ret=server.GetTsyName(phoneIndex,tsyName);
    TESTCHECK(ret, KErrNone);
    TESTCHECKSTR(tsyName, DSTDNC_MODULE_NAME);
    phoneIndex++;

    // sixth phone
    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNotFound);

    ret=server.GetTsyName(phoneIndex,tsyName);
    TESTCHECK(ret, KErrNotFound);
    phoneIndex++;

    ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
    TESTCHECK(ret, KErrNone);
    ret=server.UnloadPhoneModule(DSTDNC_MODULE_NAME);
    TESTCHECK(ret, KErrNone);
    ServerClose(server);

    ret = server.Connect();
    TESTCHECK(ret, KErrNone);
    ret=server.LoadPhoneModule(DSTDNC_MODULE_NAME);
    TESTCHECK(ret, KErrNone);

    ret=server.LoadPhoneModule(DSTD_MODULE_NAME);
    TESTCHECK(ret, KErrNone);

    ret=server.EnumeratePhones(numPhones);
    TESTCHECK(ret, KErrNone);
    TESTCHECK(numPhones, (DSTD_NUMBER_OF_PHONES + DSTDNC_NUMBER_OF_PHONES + originalNumPhones));

    phoneIndex = originalNumPhones;

    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNone);
    TESTCHECK(info.iNetworkType, DSTDNC_NETWORK_TYPE);
    TESTCHECKSTR(info.iName, DSTDNC_PHONE_NAME);
    TESTCHECK(info.iNumberOfLines, DSTDNC_NUMBER_OF_LINES);
    phoneIndex++;

    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNone);
    TESTCHECK(info.iNetworkType, DSTD_NETWORK_TYPE);
    TESTCHECKSTR(info.iName, DSTD_PHONE_NAME);
    TESTCHECK(info.iNumberOfLines, DSTD_NUMBER_OF_LINES);
    phoneIndex++;

    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNone);
    TESTCHECK(info.iNetworkType, DSTDFC_NETWORK_TYPE);
    TESTCHECKSTR(info.iName, DSTDFC_PHONE_NAME);
    TESTCHECK(info.iNumberOfLines, DSTDFC_NUMBER_OF_LINES);
    phoneIndex++;

    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNone);
    TESTCHECK(info.iNetworkType, DSTDPM_NETWORK_TYPE);
    TESTCHECKSTR(info.iName, DSTDPM_PHONE_NAME);
    TESTCHECK(info.iNumberOfLines, DSTDPM_NUMBER_OF_LINES);
    phoneIndex++;

    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNone);
    TESTCHECK(info.iNetworkType, DSTDPM_NETWORK_TYPE);
    TESTCHECKSTR(info.iName, DSTD_SLOW_PHONE_NAME);
    TESTCHECK(info.iNumberOfLines, DSTDPM_NUMBER_OF_LINES);
    phoneIndex++;

    ret=server.GetPhoneInfo(phoneIndex,info);
    TESTCHECK(ret, KErrNotFound);
    phoneIndex++;

    ret=server.UnloadPhoneModule(DSTD_MODULE_NAME);
    TESTCHECK(ret, KErrNone);
    ret=server.UnloadPhoneModule(DSTDNC_MODULE_NAME);
    TESTCHECK(ret, KErrNone);
    ServerClose(server);

    return TestStepResult();
}
示例#24
0
CNetManager::~CNetManager()
{
	if(m_bServerRunning == true)
		ServerClose();
}