Commit 07ed5b8f authored by mullers's avatar mullers
Browse files

review and UT concept added

parent cf85e2ae
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ module dPMR_Defaults {
	import from dPMR_Types all;
	import from dPMR_Values all;


//TODO JP description
	altstep a_dftUt()
		runs on Ut{
		[]syncPort.receive(m_syncServerStop){
@@ -29,11 +29,12 @@ module dPMR_Defaults {
				log("a_dftUt: TEST COMPONENT NOW STOPPING ITSELF!");
				stop;
			}
		[]utPort.receive(e_error){
			setverdict(inconc);
			log("*** a_dftUt: Unexpected error message received on upper tester ***");
			repeat;
		}
		//TODO JP update
		//[]utPort.receive(e_error){
		//	setverdict(inconc);
		//	log("*** a_dftUt: Unexpected error message received on upper tester ***");
		//	repeat;
		//}
		[]utPort.receive{
			setverdict(inconc);
			log("*** a_dftUt: Unexpected message received on upper tester ***");
@@ -45,8 +46,8 @@ module dPMR_Defaults {



	altstep a_dftSimu()
	runs on Simu{
	altstep a_dftMse()
	runs on Mse{
		[]syncPort.receive(m_syncServerStop){
				log("a_dftSimu: Test component received STOP signal from MTC - going to IDLE state");
				log("a_dftSimu: TEST COMPONENT NOW STOPPING ITSELF!");
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ module dPMR_ExtFunctions {
	//Ats
	import from dPMR_Types all;
	
	
	//TODO JP add @param @remark clause

	/*
	 * @desc: fx_calcDialString calculates and returns the dialstring
+74 −91
Original line number Diff line number Diff line
@@ -30,9 +30,9 @@
		 * @desc	Init the Mse
        */
		function f_initMse()
		runs on Simu {
		runs on Mse{
			vc_mse.useAllCallCommonId := e_noAllCall;
			vc_mse.iutId := f_createMsAddress(true /* its IUT */);
			vc_mse.iutId := f_createMsAddress(true /* its IUT */);//TODO JPcleanup
			vc_mse.testerId := f_createMsAddress(false /* its not IUT (its Tester) */);
			vc_mse.iutIdUP := f_msAddress2Upper(vc_mse.iutId);
			vc_mse.iutIdLP := f_msAddress2Lower(vc_mse.iutId);
@@ -41,8 +41,10 @@
			
		}//end f_initMse

		//TODO JP desc
		//TODO JP do nto forget the parameter itself p_useAllCallCommonId
		function f_initMse_isfAllCall(UseAllCallCommonId p_useAllCallCommonId)
		runs on Simu {
		runs on Mse{

			vc_mse.useAllCallCommonId := p_useAllCallCommonId;
			vc_mse.iutId := f_createMsAddress(true /* its IUT */);
@@ -52,8 +54,37 @@
			vc_mse.testerIdUP := f_msAddress2Upper(vc_mse.testerId);
			vc_mse.testerIdLP := f_msAddress2Lower(vc_mse.testerId);

		}//end f_initMse
		}//end f_initMse_isfAllCall

		/*
		 * @desc	Init the Upper Tester
        */
		function f_initUt()
		runs on Ut{
			vc_ut.useAllCallCommonId := e_noAllCall;
			vc_ut.iutId := f_createMsAddress(true /* its IUT */);//TODO JPcleanup
			vc_ut.testerId := f_createMsAddress(false /* its not IUT (its Tester) */);
			vc_ut.iutIdUP := f_msAddress2Upper(vc_ut.iutId);
			vc_ut.iutIdLP := f_msAddress2Lower(vc_ut.iutId);
			vc_ut.testerIdUP := f_msAddress2Upper(vc_ut.testerId);
			vc_ut.testerIdLP := f_msAddress2Lower(vc_ut.testerId);
			
		}//end f_initUt

		//TODO JP desc
		//TODO JP do nto forget the parameter itself p_useAllCallCommonId
		function f_initUt_isfAllCall(UseAllCallCommonId p_useAllCallCommonId)
		runs on Ut{

			vc_ut.useAllCallCommonId := p_useAllCallCommonId;
			vc_ut.iutId := f_createMsAddress(true /* its IUT */);
			vc_ut.testerId := f_createMsAddress(false /* its not IUT (its Tester) */);
			vc_ut.iutIdUP := f_msAddress2Upper(vc_ut.iutId);
			vc_ut.iutIdLP := f_msAddress2Lower(vc_ut.iutId);
			vc_ut.testerIdUP := f_msAddress2Upper(vc_ut.testerId);
			vc_ut.testerIdLP := f_msAddress2Lower(vc_ut.testerId);

		}//end f_initUt_isfAllCall

	}//end initFunctions

@@ -66,11 +97,13 @@
		 * @param	p_cc is the CoulourCode used
		*/
		function f_msConfigureRx(ColourCode p_cc)
		runs on Simu
		runs on Mse
		return FncRetCode {
			var FncRetCode v_ret := e_success;
			if (PIC_ISF_OR_CSF == e_isf) {
				v_ret := f_msConfig_Ut(  m_msCfgParamsIsfPoliteRx( p_cc, int2bit(PXT_APPLICABLE_COMMON_ID,8)), v_ret);
				//TODO JP wrogn , CSF needs to be configured as well
				// get rid of f_msConfigureRx/Tx and just use f_utsHandshake_Ut
				v_ret := f_handshake_Ut(  m_msCfgParamsIsfRx( p_cc, int2bit(PXT_APPLICABLE_COMMON_ID,8)));
			}
			return v_ret;
		}//end f_msConfigureRx
@@ -84,13 +117,13 @@
		 * @param	p_callType is the CallType used
		*/
		function f_msConfigureTx(ColourCode p_cc, PoliteLvl p_politeLvl, CallType p_callType)
		runs on Simu
		runs on Mse
		return FncRetCode {
			var FncRetCode v_ret := e_success;
			if (PIC_ISF_OR_CSF == e_isf) { 
				v_ret := f_iutMsTxInit_Ut(m_msCfgParamsIsfPoliteTx(p_cc, p_politeLvl, p_callType, int2bit(PXT_APPLICABLE_COMMON_ID,8)), v_ret); }
				v_ret := f_handshake_Ut(m_msCfgParamsIsfPoliteTx(p_cc, p_politeLvl, p_callType, int2bit(PXT_APPLICABLE_COMMON_ID,8))); }
			else { 
				v_ret := f_iutMsTxInit_Ut(m_msCfgParamsCsfPoliteTx(p_cc, p_politeLvl, p_callType, fx_calcDialString(PXT_CSF_ADDRESS_TESTER)), v_ret);
				v_ret := f_handshake_Ut(m_msCfgParamsCsfPoliteTx(p_cc, p_politeLvl, p_callType, fx_calcDialString(PXT_CSF_ADDRESS_TESTER)));
			}
			return v_ret;
		}//end f_msConfigureTx
@@ -100,85 +133,37 @@
		 * @param	p_msCfgParams MS config parameters
		 * @param   p_ret the return code
		*/
		function f_msConfig_Ut( template MsCfgParams p_msCfgParams , FncRetCode p_ret )
		function f_handshake_Ut( template UtRequest p_utRequest)
		runs on Ut return FncRetCode{
			if(p_ret != e_success){
				return e_error;
			}
			utPort.send(p_msCfgParams);
			tc_maxTimeCfgActRly.start;
			alt{
				[]utPort.receive(m_success){
					setverdict(pass);
					tc_maxTimeCfgActRly.stop;
					return e_success;
				}
				[]utPort.receive(m_noSuccess){
					setverdict(fail);
					tc_maxTimeCfgActRly.stop;
					log("*** f_msConfig_Ut: Error message received on upper tester ***");
				}
				[]tc_maxTimeCfgActRly.timeout{
					setverdict(fail);
					log("*** f_msConfig_Ut: timeout of configuration or action ***");
				}
			}
			return e_error;
		} // end f_msConfig_Ut
	} //end configFunctions

	/*
	 * @desc 	f_iutMsTxInit_Ut is used to prepare the MS for transmission and 
	 *          sets the following parameters
	 * @param	p_msCfgParams MS config parameters
	 * @param   p_ret the return code
	*/
			
	function f_iutMsTxInit_Ut(template MsCfgParams p_msCfgParams, FncRetCode p_ret)
	runs on Ut return FncRetCode{
		if(p_ret != e_success){
			return e_error;
		}
		utPort.send(p_msCfgParams);
			utPort.send(p_utRequest);
			tc_maxTimeCfgActRly.start;
			alt{
			[]utPort.receive(e_success){
				setverdict(pass);
				[]utPort.receive(mw_utsCfn_success){
					tc_maxTimeCfgActRly.stop;
					setverdict(pass);
					return e_success;
				}
			[]utPort.receive(e_error){
				setverdict(fail);
				[]utPort.receive(mw_utsCfn_noSuccess){
					tc_maxTimeCfgActRly.stop;
				log("*** f_iutMsInit_Ut: Error message received on upper tester ***");
					log("*** f_handshake_Ut: Error message received on upper tester ***");
					setverdict(fail);
					return e_error;
				}
				[]tc_maxTimeCfgActRly.timeout{
					log("*** f_handshake_Ut: timeout of configuration or action ***");
					setverdict(fail);
				log("*** f_iutMsInit_Ut: timeout of configuration or action ***");
					return e_error;
				}
			}
		return e_error;
	} //end f_iutMsTxInit_Ut
			
		} // end f_handshake_Ut

} //end configFunctions

	/*
 	 * @desc: f_iutMsAction_Ut is used to ask IUT ms to do following actions
	 *			Action Type:=  PressPtt, DekeyPtt, 
	 * @param	p_msActParams MS config parameters
	 * @param   p_ret the return code
	*/

	function f_iutMsAction_Ut(template MsActParams p_msActParams, FncRetCode p_ret)
	runs on Ut return FncRetCode{
		if(p_ret != e_success){
			return e_error;
		}
		utPort.send(p_msActParams);
		return e_success;
	} //end f_iutMsAction_Ut

	group converterFunctions {

		/*
	 	 * @desc f_getCommonId returns the Common ID from an ISF address.
@@ -196,13 +181,11 @@
			}
		} // end f_getCommonId
		
	group converterFunctions {
		
		/*
	 	 * @desc f_getColourCode returns the Colour Code for ISF or CSF
		*/
		function f_getColourCode ()
		runs on Simu
		runs on Mse
		return ColourCode {
		
			var ColourCode v_cc;
@@ -254,7 +237,7 @@
		 * @remark	This function should perhaps be rewritten (split) , and the enumerated type UseAllCallCommonId removed
		*/
		function f_createMsAddress(	boolean p_testingEntityIsIUT)
		runs on Simu
		runs on Mse
		return MsAddress {
			var MsAddress v_retAdr;
			if (PIC_ISF_OR_CSF == e_isf) {
@@ -285,7 +268,7 @@
		 * @remark	This function should perhaps be rewritten (split) , and the enumerated type UseAllCallCommonId removed
		*/
		function f_getCsfAddress (boolean p_testingEntityIsIUT) 
		runs on Simu
		runs on Mse
		return CSFAddress {
			var CSFAddress v_ret;
			if (p_testingEntityIsIUT) {
+0 −6
Original line number Diff line number Diff line
@@ -17,9 +17,6 @@ module dPMR_Pics {
	import from dPMR_TestConfiguration all;

	


	
	/*
	* @desc  	Is the IUT an ISF or CSF entity?
	* @remark	see PICS, Table A.1/1.
@@ -27,7 +24,4 @@ module dPMR_Pics {
	modulepar {Entity PIC_ISF_OR_CSF := e_isf}





} // end module dPMR_PICS
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ module dPMR_Pixits {
	*/ 
	modulepar {CsfChannelNr PXT_CSF_CHANNEL_NR := e_csfChannelNr_0 }

	
	////TODO JP add clauses + make groups


	/*
Loading