コード例 #1
0
//
// Perform the Test
//
LOCAL_C void PerformTestL()
/**
 *
 * The PerformTestL method is the main user interface routine for the GSM TSY Regression
 * Test Harness.  It loads the appropriate serial drivers and unloads them at completion.
 * This method presents the user with the list of tests to run and then
 * responds to the user's input.  If the user does not select any specific test, it runs all
 * tests as the default.
 *
 * @leave	This method leaves if it can not connect to the communications server or load
 *			the CSY.  Additionally, this method leaves if the test script can not be created.
 *			If the test fails with an error, User::Leave will be invoked.
 */
	{
	RCommServ commServer;
	TESTL(commServer.Connect()==KErrNone);
	TInt res=commServer.LoadCommModule(_L("ECUART.CSY"));
	INFO_PRINTF1(TRefByValue<const TDesC>(_L("LoadCommModuleError = %d\n")), res);
	TESTL(res==KErrNone || res==KErrAlreadyExists);

//  This block of prints is for all tests to be listed in one column
//  Note: by displaying menu selectons in a single column, all selections will not be visible
	INFO_PRINTF1(_L("Which test?  Leave to run all tests\n"));
	INFO_PRINTF1(_L("a) Receive SMS Test\n"));
	INFO_PRINTF1(_L("b) SMS Notification Test\n"));
	INFO_PRINTF1(_L("c) SMS PDU Capability Test\n"));
	INFO_PRINTF1(_L("d) Default SCA Test\n"));
	INFO_PRINTF1(_L("e) SMS Transmission Test\n"));
	INFO_PRINTF1(_L("f) Data Call Test\n"));
	INFO_PRINTF1(_L("g) Errored Data Call Test\n"));
	INFO_PRINTF1(_L("h) Odd Initialisation Tests\n"));
	INFO_PRINTF1(_L("i) SMS Storage Tests\n"));
	INFO_PRINTF1(_L("j) Failure Initialisation Tests\n"));
	INFO_PRINTF1(_L("k) Incoming Call Tests\n"));
	INFO_PRINTF1(_L("l) SMS Cancel Scenarios\n"));
	INFO_PRINTF1(_L("m) Shutdown Scenarios\n"));
	INFO_PRINTF1(_L("n) SMS Storage Delete Test\n"));
	INFO_PRINTF1(_L("o) Simultaneous Fax Reception and Signal Strength Retrieval Scenario\n"));
	INFO_PRINTF1(_L("p) Data Call Cancel Scenarios\n"));
	INFO_PRINTF1(_L("q) Fax Call Premature Close Scenario\n"));
	INFO_PRINTF1(_L("r) Two Fax Reception Scenario\n"));
	INFO_PRINTF1(_L("s) Voice Call Scenarios\n"));
	INFO_PRINTF1(_L("t) Data Call Set-up, Data Transfer and Remote Termination Test\n"));
	INFO_PRINTF1(_L("u) Data Call Dial-up Networking Call-back Test\n"));
	INFO_PRINTF1(_L("v) Data Call Answer and Remote Hang-up Closely Followed by a Dial Test\n"));
	INFO_PRINTF1(_L("w) Phonebook tests\n"));
	INFO_PRINTF1(_L("x) Network and Registration tests\n"));
	INFO_PRINTF1(_L("y) Phone and Line tests\n"));
	INFO_PRINTF1(_L("z) Voice and Data calls tests\n"));
	INFO_PRINTF1(_L("1) No CNMI info and Modem Detection tests\n"));
	INFO_PRINTF1(_L("2) No CMGF info tests\n"));
	INFO_PRINTF1(_L("3) AT+CBST  tests\n"));
	INFO_PRINTF1(_L("4) CBST & CNMI string parsing test\n")) ;
	INFO_PRINTF1(_L("5) CGQREQ responses during initialise\n"));
	INFO_PRINTF1(_L("6) Unsolicited messages injected during initialisation\n"));
	INFO_PRINTF1(_L("9) Voice Call OOM tests (NOT RUN AS PART OF 'ALL TESTS')\n"));

	TBool keyPressed=ETrue;
	TKeyCode key=ShortWaitForKey(10, keyPressed);

	TBool allTests=!keyPressed;
	if(keyPressed)
		{
		if((key>='A')&&(key<='Z'))	// A simple fold
			key=(TKeyCode)(key-'A'+'a');
		}

//
// Run the tests...
//


// Test Rx SMS messages
	if((key=='a')||(allTests))
		{
		SIMPLETESTMACRO("Simple SMS Receive",CTestDriveRxMess,ERxMessScript);
		SIMPLETESTMACRO("CMT SMS Receive",CTestDriveRxMessCmt,ERxMessCmtAndCmtiScript);
		SIMPLETESTMACRO("CMTI SMS Receive emulating an Ericsson T28",CTestDriveRxMess,ERxMessEricssonT28Script);
		}

// Test Notification of SMS messages
	if((key=='b')||(allTests))
		{
		SIMPLETESTMACRO("SMS CMTI Notification and Receive",CTestDriveNotMess,ERxMessScript);
		SIMPLETESTMACRO("SMS CMT Notification and Receive",CTestDriveNotMessCmt,ERxMessCmtScript);
		}

// Test behaviour when a modem claims not to support SMS PDU mode
	if((key=='c')||(allTests))
		{
		SIMPLETESTMACRO("No SMS PDU capability",CTestDriveNoPduRxMess,ENoPduRxMessScript);
		}


// Test retrieval and setting of default service centre

	if ((key=='d')||(allTests))
		{
		SIMPLETESTMACRO("Simple SCA retrieval & setting",CTestDriveSca,EScaSimpleScript);
		SIMPLETESTMACRO("8210-style SCA retrieval & setting",CTestDriveSca,ESca8210StyleScript);
		}


// Test a simple SMS Tx
	if((key=='e')||(allTests))
		{
		SIMPLETESTMACRO("A simple SMS Tx",CTestDriveTxMess,ETxMessScript);
		SIMPLETESTMACRO("New Standard SMS Tx",CTestDriveTxNewStdMess,ETxMessNewStdScript);
		SIMPLETESTMACRO("New Standard SMS Tx Test emulating an Ericsson T28",CTestDriveTxNewStdMess,ETxMessT28NewStdScript);

	// Test no prefix on pdu, don't set default sca, new ETSI format
		_LIT8(KTxA,"Tx: no PDU prefix, no default SCA set, new standard");
		StartTest(KTxA);
		CTestDriveTxWithScaCombo* test4c=CTestDriveTxWithScaCombo::NewL(ETxMessScriptNoprefixNodefscaNew,EFalse,EFalse,ETrue);
		CleanupStack::PushL(test4c);
		User::LeaveIfError(test4c->RunTestL());
		CleanupStack::PopAndDestroy();
		EndTest(KTxA);
		User::After(1000000L);

	// Test prefix on pdu, don't set default sca, new ETSI format
		_LIT8(KTxB,"Tx: PDU prefix, no default SCA set, new standard");
		StartTest(KTxB);
		test4c=CTestDriveTxWithScaCombo::NewL(ETxMessScriptPrefixNodefscaNew,ETrue,EFalse,ETrue);
		CleanupStack::PushL(test4c);
		User::LeaveIfError(test4c->RunTestL());
		CleanupStack::PopAndDestroy();
		EndTest(KTxB);
		User::After(1000000L);

	// Test no prefix on pdu, set default sca, new ETSI format
		_LIT8(KTxC,"Tx: no PDU prefix, default SCA set, new standard");
		StartTest(KTxC);
		test4c=CTestDriveTxWithScaCombo::NewL(ETxMessScriptNoprefixDefscaNew,EFalse,ETrue,ETrue);
		CleanupStack::PushL(test4c);
		User::LeaveIfError(test4c->RunTestL());
		CleanupStack::PopAndDestroy();
		EndTest(KTxC);
		User::After(1000000L);

	// Test prefix on pdu, set default sca, new ETSI format
		_LIT8(KTxD,"Tx: PDU prefix, default SCA set, new standard");
		StartTest(KTxD);
		test4c=CTestDriveTxWithScaCombo::NewL(ETxMessScriptPrefixDefscaNew,ETrue,ETrue,ETrue);
		CleanupStack::PushL(test4c);
		User::LeaveIfError(test4c->RunTestL());
		CleanupStack::PopAndDestroy();
		EndTest(KTxD);
		User::After(1000000L);

	// Test no prefix on pdu, don't set default sca, old ETSI format
		_LIT8(KTxE,"Tx: No PDU prefix, no default SCA set, old standard");
		StartTest(KTxE);
		test4c=CTestDriveTxWithScaCombo::NewL(ETxMessScriptNoprefixNodefscaOld,EFalse,EFalse,EFalse);
		CleanupStack::PushL(test4c);
		User::LeaveIfError(test4c->RunTestL());
		CleanupStack::PopAndDestroy();
		EndTest(KTxE);
		User::After(1000000L);

	// Test prefix on pdu, don't set default sca, old ETSI format
		_LIT8(KTxF,"Tx: PDU prefix, no default SCA set, old standard");
		StartTest(KTxF);
		test4c=CTestDriveTxWithScaCombo::NewL(ETxMessScriptPrefixNodefscaOld,ETrue,EFalse,EFalse);
		CleanupStack::PushL(test4c);
		User::LeaveIfError(test4c->RunTestL());
		CleanupStack::PopAndDestroy();
		EndTest(KTxF);
		User::After(1000000L);

	// Test no prefix on pdu, set default sca, old ETSI format
		_LIT8(KTxG,"Tx: no PDU prefix, default SCA set, old standard");
		StartTest(KTxG);
		test4c=CTestDriveTxWithScaCombo::NewL(ETxMessScriptNoprefixDefscaOld,EFalse,ETrue,EFalse);
		CleanupStack::PushL(test4c);
		User::LeaveIfError(test4c->RunTestL());
		CleanupStack::PopAndDestroy();
		EndTest(KTxG);
		User::After(1000000L);

	// Test prefix on pdu, set default sca, old ETSI format
		_LIT8(KTxH,"Tx: PDU prefix, default SCA set, old standard");
		StartTest(KTxH);
		test4c=CTestDriveTxWithScaCombo::NewL(ETxMessScriptPrefixDefscaOld,ETrue,ETrue,EFalse);
		CleanupStack::PushL(test4c);
		User::LeaveIfError(test4c->RunTestL());
		CleanupStack::PopAndDestroy();
		EndTest(KTxH);
		User::After(1000000L);

	// Test a "+CMS ERROR 321" from a Read (observed on an Ericsson 888)
		SIMPLETESTMACRO("Invalid Read Test",CTestDriveTxRx,ETxMessRxTxScriptA);
		}

// Test Dialing a Data Call
	if((key=='f')||(allTests))
		{
		SIMPLETESTMACRO("Dialing a simple Data Call",CTestDriveDataCall,EDataCallScript);
		}

// Test an Error Dialing a Data Call
	if((key=='g')||(allTests))
		{
		SIMPLETESTMACRO("Dialing a simple Data Call, with the modem ERRORing some commands",CTestDriveDataCall,EDataCallErrorAScript);
		}

// Test some odd initialisation sequences
	if((key=='h')||(allTests))
		{
		SIMPLETESTMACRO("Odd Initialisation Sequence A",CTestDriveOddInit,EOddInitAScript);
		SIMPLETESTMACRO("Odd Initialisation Sequence B",CTestDriveOddInit,EOddInitBScript);
		SIMPLETESTMACRO("Odd Initialisation Sequence C",CTestDriveOddInit,EOddInitCScript);
		SIMPLETESTMACRO("Odd Initialisation Sequence D",CTestDriveOddInit,EOddInitDScript);
		SIMPLETESTMACRO("Odd Initialisation Sequence E",CTestDriveOddInit,EOddInitEScript);
		SIMPLETESTMACRO("Odd Initialisation Sequence F",CTestDriveOddInit,EOddInitFScript);
		SIMPLETESTMACRO("Odd Initialisation Sequence G",CTestDriveOddInit,EOddInitGScript);
		SIMPLETESTMACRO("Odd Initialisation Sequence H",CTestDriveOddInit,EOddInitHScript);
 		SIMPLETESTMACRO("Odd Initialisation Sequence I",CTestDriveOddInit,EOddInitIScript);
		}

// Test SMS Storage functions
	if((key=='i')||(allTests))
		{
		SIMPLETESTMACRO("Message Storage Functions with old standard PDUs",CTestDriveMessStor,EMessStorOldSmsStdScript);
		SIMPLETESTMACRO("Message Storage Functions with new standard PDUs",CTestDriveMessStor,EMessStorNewSmsStdScript);
		}

// Test Initialisation Failure Scenarios
	if((key=='j')||(allTests))
		{
		SIMPLETESTMACRO("Initialisation Failure Scenarios",CTestDriveFailInit,EFailInitAScript);
		}

// Test Incoming Call Scenarios
	if((key=='k')||(allTests))
		{
		SIMPLETESTMACRO("Incoming Call Scenarios",CTestDriveInCall,EInCallScriptA);
		SIMPLETESTMACRO("Incoming Call Scenarios with a Nokia",CTestDriveInCall,EInCallScriptB);
		}

// Test SMS Cancel
	if((key=='l')||(allTests))
		{
		SIMPLETESTMACRO("SMS Cancel CMT Scenarios",CTestDriveSmsCancel,ESmsCancelScript);
		SIMPLETESTMACRO("SMS Cancel CMTI Scenarios",CTestDriveSmsCancel,ESmsCancelCmtiScript);
		}

// Test Shutdown Scenarios
	if((key=='m')||(allTests))
		{
 		SIMPLETESTMACRO("Shutdown Scenarios",CTestDriveShutdown,EShutdownScript);
		SIMPLETESTMACRO("Shutdown Scenarios A",CTestDriveShutdownA,EShutdownScriptA);
		}

// Test SMS Delete
	if((key=='n')||(allTests))
		{
		SIMPLETESTMACRO("A Simple SMS Storage Delete",CTestDriveSmsDelete,ESmsStorageDeleteScript);
		}

// Test simultaneous Fax Reception and Signal Strength Retrieval
	if((key=='o')||(allTests))
		{
		SIMPLETESTMACRO("Simultaneous Fax Reception and Signal Strength Retrieval",CTestDriveSsFax,ESsFaxScriptA);
		SIMPLETESTMACRO("Simultaneous Data Reception and Signal Strength Retrieval",CTestDriveSSData,ESsDataScriptA);
		}

// Test Data Call Cancel Scenarios
	if((key=='p')||(allTests))
		{
		SIMPLETESTMACRO("Data Call Cancel Scenarios",CTestDriveDataCallCancel,EDataCallCancelScript);
		}

// Fax Call Premature Close Scenarios
	if((key=='q')||(allTests))
		{
		SIMPLETESTMACRO("Fax Call Premature Close Scenarios",CTestDrivePremClose,EFaxPremCloseScriptA);
//		SIMPLETESTMACRO("Fax Call Premature Close Scenarios Part B",CTestDrivePremCloseB,EFaxPremCloseScriptB);
		}

// Two Fax Reception Scenarios
	if((key=='r')||(allTests))
		{
		SIMPLETESTMACRO("Two Fax Reception Scenarios",CTestDriveTwoFaxRx,ETwoFaxRxScriptA);
		}

// Voice Call Scenarios
	if((key=='s')||(allTests))
		{
		SIMPLETESTMACRO("Voice Call Scenarios",CTestDriveVoiceCall,EVoiceCallScriptA);
		}

// Test Dialing a Set-up, Data Transfer and Remote Termination Data Call
	if((key=='t')||(allTests))
		{
		SIMPLETESTMACRO("Dialing a Set-up, Data Transfer and Remote Termination Data Call",CTestDriveDataCallRemoteTerm,EDataCallRemoteTermScript);
		}

// Test Dialing a Dial-up Networking Call-back Data Call
	if((key=='u')||(allTests))
		{
		TInt varDelay;  // Variable Delay for EWait script, for scoping purposes
		varDelay = KCallBackDefVarDelay;
		if(!allTests)
			{
			// This tests is valid for supporting variable delay for an EWait script
			varDelay = GetNumberEntry(	KCallBackMaxDigits,	// max numbers of digits
										KCallBackMinVarDelay,	// min value allowed
										KCallBackMaxVarDelay,	// max value allowed
										KInputWaitOnDelaySecs,	// secs to wait for a user key entry
										KCallBackDefVarDelay,	// default value if timed out
										_L("Enter delay value")
									 );
			}
		_LIT8(KCallbackA,"Dialing a Dial-up Networking Call-back Data Call");
		StartTest(KCallbackA);
		CTestDriveDataCallCallBack* test23=CTestDriveDataCallCallBack::NewL(EDataCallCallBackScript, varDelay);
		CleanupStack::PushL(test23);
		User::LeaveIfError(test23->RunTestL());
		CleanupStack::PopAndDestroy();
		EndTest(KCallbackA);
		User::After(1000000L);
		}

// Test an Answer and Remote Hang-up Closely Followed by a Dial Data Call
	if((key=='v')||(allTests))
		{
		TInt varDelay;  // Variable Delay for EWait script, for scoping purposes
		varDelay = KHangupDialDefVarDelay;
		if(!allTests)
			{
			// This tests is valid for supporting variable delay for an EWait script
			varDelay = GetNumberEntry(	KHangupDialMaxDigits,	// max numbers of digits
										KHangupDialMinVarDelay,	// min value allowed
										KHangupDialMaxVarDelay,	// max value allowed
										KInputWaitOnDelaySecs,	// secs to wait for a user key entry
										KHangupDialDefVarDelay,	// default value if timed out
										_L("Enter delay value")
									 );
			}
		_LIT8(KCallbackB,"Answer and Remote Hang-up Closely Followed by a Dial Data Call");
		StartTest(KCallbackB);
		CTestDriveRemoteHangupDial* test24=CTestDriveRemoteHangupDial::NewL(EDataCallRemoteHangDialScript, varDelay);
		CleanupStack::PushL(test24);
		User::LeaveIfError(test24->RunTestL());
		CleanupStack::PopAndDestroy();
		EndTest(KCallbackB);
		User::After(1000000L);
		}

// Phone book tests
	if((key=='w')||(allTests))
		{
		SIMPLETESTMACRO("Phone book Scenarios",CTestDrivePhoneBook,EPhoneBookScript);
		}

// Network and Registration tests
	if((key=='x')||(allTests))
		{
		SIMPLETESTMACRO("Testing Network and Registration",CTestDriveNetworkRegistration,ENetworkRegistrationScript);
		}

// Phone and Line tests
	if((key=='y')||(allTests))
		{
		SIMPLETESTMACRO("Phone and Line Scenarios",CTestDrivePhoneLine,EPhoneLineScript);
		}

// Voice and Data Call tests
	if((key=='z')||(allTests))
		{
		SIMPLETESTMACRO("Voice and Data Calls",CTestDriveAllCalls,EAllCallsScript);
		}

// No CNMI information and Modem notification tests
	if((key=='1')||(allTests))
		{
		SIMPLETESTMACRO("No CNMI info and Modem notification request",CTestDriveNoCnmi,ENoCnmiScript);
		}

// No CMGF information tests
	if((key=='2')||(allTests))
		{
		SIMPLETESTMACRO("No CMGF info request",CTestDriveNoCmgf,ENoCmgfScript);
		}

// AT+CBST information tests
	if((key=='3')||(allTests))
		{
		SIMPLETESTMACRO("AT+CBST tests",CTestDriveDataCallDiffParam, ECallDiffParamScript);
		}
//CBST string parsing test
	if((key=='4')||(allTests))
		{
		SIMPLETESTMACRO("CBST & CNMI string parsing test",CTestDriveCbstParse, ECbstParseScript);
		}

// CGQREQ responses during initialise (added to increase conditional code coverage)
	if((key=='5')||(allTests))
		{
		SIMPLETESTMACRO("CGQREQ responses during initialise",CTestDriveCGQREQResponses,ECGQREQResponsesScript);
		}

// Unsolicited messages injected during initialisation
	if((key=='6')||(allTests))
		{
		SIMPLETESTMACRO("Unsolicited messages injected during initialisation",CTestDriveUnsolicited,EUnsolicitedScript);
		}

// OOM Voice Call tests, not run as part of 'all tests'
	if(key=='9')
		{
		SIMPLETESTMACRO("OOM Voice Call",CTestDriveOOMVoiceCall,EOOMVoiceCall);
		}

//
// Tidy up after the tests
//
	res = commServer.UnloadCommModule(_L("ECUART.CSY"));
	commServer.Close();
	}
コード例 #2
0
ファイル: widgetOPS.c プロジェクト: authorNari/panda
extern	void
UpdateWidgetData(WidgetData	*data)
{
	GtkWidget	*widget;

	widget = GetWidgetByLongName(data->name);
	g_return_if_fail(widget != NULL);

	switch (data->type) {
// gtk+panda
	case WIDGET_TYPE_NUMBER_ENTRY:
		GetNumberEntry(widget, (_NumberEntry*)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_CLIST:
		GetPandaCList(widget, (_CList*)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_ENTRY:
	case WIDGET_TYPE_ENTRY:
		GetEntry(widget, (_Entry*)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_TEXT:
		GetText(widget, (_Text*)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_TIMER:
		GetPandaTimer(widget, (_Timer*)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_TABLE:
		GetPandaTable(widget, (_Table*)data->attrs);
		break;
	case WIDGET_TYPE_TEXT:
		GetText(widget, (_Text*)data->attrs);
		break;
	case WIDGET_TYPE_TOGGLE_BUTTON:
	case WIDGET_TYPE_CHECK_BUTTON:
	case WIDGET_TYPE_RADIO_BUTTON:
		GetButton(widget, (_Button*)data->attrs);
		break;
	case WIDGET_TYPE_CALENDAR:
		GetCalendar(widget, (_Calendar*)data->attrs);
		break;
	case WIDGET_TYPE_NOTEBOOK:
		GetNotebook(widget, (_Notebook*)data->attrs);
		break;
	case WIDGET_TYPE_PROGRESS_BAR:
		GetProgressBar(widget, (_ProgressBar*)data->attrs);
		break;
	case WIDGET_TYPE_SCROLLED_WINDOW:
		GetScrolledWindow(widget, (_ScrolledWindow*)data->attrs);
		break;
	case WIDGET_TYPE_FILE_CHOOSER_BUTTON:
		GetFileChooserButton(widget, (_FileChooserButton*)data->attrs);
		break;
	case WIDGET_TYPE_COLOR_BUTTON:
		GetColorButton(widget, (_ColorButton*)data->attrs);
		break;
// gtk+
	case WIDGET_TYPE_FILE_ENTRY:
		GetFileEntry(widget, (_FileEntry*)data->attrs);
		break;
	default:
		MessageLogPrintf("invalid widget [%s]", data->name);
		break;
	}
}