NegSem_060212_AddressingEntitiesInsideSut_004.ttcn 1.53 KB
Newer Older
kovacsa's avatar
kovacsa committed
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.2.12, Ensure that address type cannot be used in a to part of sender operation with connected ports
 ** @verdict  pass reject
 ***************************************************/

/* The following requirements are tested: 
 * Restrictions c)	The address data type shall not be used in the to, 
 * from and sender parts of receive and send operations of connected ports,
 * i.e, ports used for the communication among test components.*/


module NegSem_060212_AddressingEntitiesInsideSut_004 {

    type integer MyAddress;
    type integer MyMessType;
    type integer address;

    
    type port PortType message {
        address MyAddress;
        inout MyMessType;
    }
	
    type component TestCaseComp {
        port PortType p1;
        port PortType p2;
    }

		function CheckConnected() runs on TestCaseComp
	{
		if(p1.checkstate("Connected")) {
kovacsa's avatar
kovacsa committed
	        setverdict(pass,"Connected");
kovacsa's avatar
kovacsa committed
        } else {
kovacsa's avatar
kovacsa committed
			setverdict(fail,"Not connected");
kovacsa's avatar
kovacsa committed
		}
	}
    
    testcase TC_NegSem_060212_AddressingEntitiesInsideSut_004() runs on TestCaseComp system TestCaseComp {
      
        var PortType.address MySUTentity := 1;


        connect(mtc:p1, mtc:p2);
       
        p1.send(MyMessType: 1) to MySUTentity;    //error: address type is allowed in to part send operation

        setverdict(pass);
    }

    control {
        execute(TC_NegSem_060212_AddressingEntitiesInsideSut_004());
    }
}