Commit fd683f2d authored by kovacsa's avatar kovacsa
Browse files

chapter 6 update

parent ee163cca
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409 
 ** @version  $Rev: 150 $
 ** @purpose  1:6.3, Ensure that the IUT correctly handles assignments from structures having compatible components 
 ** @verdict  pass reject
 ***************************************************/

module NegSem_060303_component_types_001 { 

  	 type integer ConstrainedInteger(0..10); 	    	    

type component TestCaseComp {
	 const integer c_integer:=2;
	 const ConstrainedInteger c_constrained:=2; 
}

type component FunctionComp {
	 const integer c_integer:=2;
}

function f_testFunction(integer p_arg) runs on FunctionComp return integer {

 var integer v_result;
 v_result:=p_arg*c_integer;
 return v_result;
}

testcase TC_NegSem_060303_component_types_001() runs on GeneralComp {

    var integer v_int:=1;
        
    f_testFunction(v_int);		
}

control {
    execute(TC_NegSem_060303_component_types_001());
}

}
+40 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409 
 ** @version  $Rev: 150 $
 ** @purpose  1:6.3, Ensure that the IUT correctly handles assignments from structures having compatible components 
 ** @verdict  pass reject
 ***************************************************/

module NegSem_060303_component_types_002 { 

  	 type integer ConstrainedInteger(0..10); 	    	    

type component TestCaseComp {
	 const integer c_integer:=2;
	 const integer c_constrained:=2; 
}

type component FunctionComp {
	 const integer c_integer:=2;
	 const ConstrainedInteger c_constrained:=2; 
}

function f_testFunction(integer p_arg) runs on FunctionComp return integer {

 var integer v_result;
 v_result:=p_arg*c_integer;
 return v_result;
}

testcase TC_NegSem_060303_component_types_002() runs on GeneralComp {

    var integer v_int:=1;
        
    f_testFunction(v_int);		
}

control {
    execute(TC_NegSem_060303_component_types_002());
}

}
+45 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409 
 ** @version  $Rev: 150 $
 ** @purpose  1:6.3, Ensure that the IUT correctly handles assignments from structures having compatible components 
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

module Sem_060303_component_types_001 { 

  	 type integer ConstrainedInteger(0..10); 	    	    

type component TestCaseComp {
	 const integer c_integer:=2;
	 const ConstrainedInteger c_constrained:=2;
}

type component FunctionComp {
	 const integer c_integer:=2;
	 const ConstrainedInteger c_constrained:=2;
}

function f_testFunction(integer p_arg) runs on FunctionComp return integer {

 var integer v_result;
 v_result:=p_arg*c_integer*c_constrained;
 return v_result;
}

testcase TC_Sem_060303_component_types_001() runs on GeneralComp {

    var integer v_int:=1;
        
    if ( f_testFunction(v_int)==4 ) {
        setverdict(pass);
    }
    else {
        setverdict(fail);
    }		
}

control {
    execute(TC_Sem_060303_component_types_001());
}

}
+1 −0
Original line number Diff line number Diff line
Rules involving synonyms have already been tested as part of section 6.3.
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
@@ -5,3 +5,9 @@ Section 6.3.2 :
Is the assignment between record and set types possible if their structures are compatible?
STF409 experts assumed the answer to above question to be yes.

Section 6.3.4 :
This section is skipped because the content of section 6.3.4 is not clear. Specific issues:
- The given example is incomplete, because the port definitions are missing.
- It is not clear what happens when the communications port can process both messages of a given record
 type and its type synonym.