Commit 36d58d80 authored by kovacsa's avatar kovacsa
Browse files

chapter 6 update

parent 1c7df8ee
Loading
Loading
Loading
Loading
+50 −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 structures having incompatible anytypes 
 ** @verdict  pass reject
 ***************************************************/

module NegSem_060302_structured_types_011 { 

 import from A all; 
 import from B all; 


type component GeneralComp {	    	    
}	

testcase TC_NegSem_060302_structured_types_011() runs on GeneralComp {

   var A.Atype v_a; 
   var B.Atype v_b := { I := 1 } 
    
   v_a:=v_b;
    
    if ( v_a==1 ) {
        setverdict(pass);
    }
    else {
        setverdict(fail);
    }		
}

control{
    execute(TC_NegSem_060302_structured_types_011());
}

}


module A { 
  type integer I (0..2); 
  type float F; 
  type anytype Atype;
 } 


module B { 
  type integer I (0..2); 
  type anytype Atype;
} 
+3 −3
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

module Sem_060302_structured_types_001 { 
module Sem_060302_structured_types_003 { 


	type record RecordType { 
@@ -35,7 +35,7 @@ module Sem_060302_structured_types_001 {
type component GeneralComp {	    	    
}	

testcase TC_Sem_060302_structured_types_001() runs on GeneralComp {
testcase TC_Sem_060302_structured_types_003() runs on GeneralComp {

    var ModifiedRecord v_rec1:={f:=4,e:=8,g:=false};
    var ModifiedSet v_set1;
@@ -56,7 +56,7 @@ testcase TC_Sem_060302_structured_types_001() runs on GeneralComp {
}

control{
    execute(TC_Sem_060302_structured_types_001());
    execute(TC_Sem_060302_structured_types_003());
}

}
+50 −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 anytypes 
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

module Sem_060302_structured_types_004 { 

 import from A all; 
 import from B all; 


type component GeneralComp {	    	    
}	

testcase TC_Sem_060302_structured_types_004() runs on GeneralComp {

   var A.Atype v_a; 
   var B.Atype v_b := { integer := 1 } 
    
   v_a:=v_b;
    
    if ( v_a==1 ) {
        setverdict(pass);
    }
    else {
        setverdict(fail);
    }		
}

control{
    execute(TC_Sem_060302_structured_types_004());
}

}


module A { 
  type integer I (0..2); 
  type float F; 
  type anytype Atype;
 } 


module B { 
  type integer I (0..2); 
  type anytype Atype;
} 
+46 −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 types and type ranges 
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

module Sem_060302_structured_types_005 { 


	type record RecordType { 
 	 integer  a(0..10) optional, 
 	 integer  b(0..10) optional, 
 	 boolean  c 
	} 
	
	type record of RecordType RecordList;



type component GeneralComp {	    	    
}	

testcase TC_Sem_060302_structured_types_005() runs on GeneralComp {

    var RecordList v_list;
    var RecordType v_record:={a:=1,b:=2,c:=false};
    var integer v_int;
    
    
    v_list:= {v_record,v_record};
    v_int:=v_list[1].b;
    
    if ( v_int==2 ) {
        setverdict(pass);
    }
    else {
        setverdict(fail);
    }		
}

control{
    execute(TC_Sem_060302_structured_types_005());
}

}