Commit be9b16f0 authored by kovacsa's avatar kovacsa
Browse files

chapter 6 update

parent 12319580
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ modulepar {
 MyEnumeratedType ENUMERATED_MODULE_PARAMETER := e_black;
}

type enumerated MyEnumeratedType {e_black, e_white}
type enumerated MyEnumeratedType {e_black, e_white};
type integer address;

type component GeneralComp {	    	    
@@ -22,7 +22,7 @@ type component GeneralComp {


testcase TC_Sem_05040101_parameters_of_kind_value_001() runs on GeneralComp {
    if ( (INTEGER_MODULE_PARAMETER == 1) & (BOOLEAN_MODULE_PARAMETER == true) & (ADDRESS_MODULE_PARAMETER == null) & (ENUMERATED_MODULE_PARAMETER == e_black) ) {
    if ( (INTEGER_MODULE_PARAMETER == 1) and (BOOLEAN_MODULE_PARAMETER == true) and (ADDRESS_MODULE_PARAMETER == null) and (ENUMERATED_MODULE_PARAMETER == e_black) ) {
        setverdict(pass);
    }
    else {
+2 −11
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ function f_parametrizationCheck (
  address p_address := null,
  MyEnumeratedType p_enumerated := e_black,
  template integer p_integerTemplate := ?,
  TestPort p_port := generalPort
  TestPort p_port := null
 ) runs on GeneralComp {
  var template MyRecord ReceivedRecord := {p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate};

@@ -44,8 +44,6 @@ function f_parametrizationCheck (
    else {
        setverdict(fail);
    }		
 
   p_port.send(ReceivedRecord);
  }

testcase TC_Sem_05040103_parameters_of_kind_timer_001 (
@@ -60,13 +58,6 @@ testcase TC_Sem_05040103_parameters_of_kind_timer_001 (
 timer t_check;
 t_check.start(1.0);
 f_parametrizationCheck(ExpectedMatch, t_check, p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate);
 alt {
  [] generalPort.receive {
  }
  [] t_check.timeout {
     setverdict(fail);
  }
 }

 t_check.stop;
 
+2 −2
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ function f_parametrizationCheck (
  address p_address := null,
  MyEnumeratedType p_enumerated := e_black,
  template integer p_integerTemplate := ?,
  TestPort p_port := generalPort
  TestPort p_port := null
 ) runs on GeneralComp {
  var template MyRecord ReceivedRecord := {p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate};

@@ -59,7 +59,7 @@ testcase TC_Sem_05040104_parameters_of_kind_port_001_a (

 timer t_check;
 t_check.start(1.0);
 f_parametrizationCheck(ExpectedMatch, t_check, p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate,-);
 f_parametrizationCheck(ExpectedMatch, t_check, p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate,generalPort);
 alt {
  [] generalPort.receive {
  }
+31 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409 
 ** @version  $Rev: 150 $
 ** @purpose  1:6.3, Ensure that the IUT rejects assignments from incompatible types or type ranges 
 ** @verdict  pass reject
 ***************************************************/

module NegSem_060302_structured_types_001 { 

	type enumerated EnumeratedType {e_black, e_white};
	type enumerated EnumeratedRedefinition {e_black, e_white};



type component GeneralComp {	    	    
}	

testcase TC_NegSem_060302_structured_types_001() runs on GeneralComp {

    var EnumeratedType v_enum1:=e_black;
    var EnumeratedRedefinition v_enum2;
    
    v_enum2:=v_enum1;

}

control{
    execute(TC_NegSem_060302_structured_types_001());
}

}
+39 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409 
 ** @version  $Rev: 150 $
 ** @purpose  1:6.3, Ensure that the IUT rejects assignments from incompatible types or type ranges 
 ** @verdict  pass reject
 ***************************************************/

module NegSem_060302_structured_types_002 { 

	type record RecordType { 
 	 integer  a(0..10) optional, 
 	 integer  b(0..10) optional, 
 	 boolean  c 
	} 
	type record ModifiedRecord { 
 	 integer  e 	   optional, 
 	 integer  f(0..5)  , 
 	 boolean  g 
	} 



type component GeneralComp {	    	    
}	

testcase TC_NegSem_060302_structured_types_002() runs on GeneralComp {

    var ModifiedRecord v_rec1:={f:=4,e:=8,g:=false};
    var RecordType v_rec2;
    
    v_rec2:=v_rec1;		//optionality mismatch

}

control{
    execute(TC_NegSem_060302_structured_types_002());
}

}
Loading