Commit 51172647 authored by kovacsa's avatar kovacsa
Browse files

chapter 6 update

parent a2a23372
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@

module NegSem_060302_structured_types_008 { 

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

	type union UnionType { 
 	 integer  a(0..10), 
+41 −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_009 { 

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

	type union UnionType { 
 	 integer  a(0..10), 
 	 EnumeratedType  b, 
 	 boolean  c 
	} 
	type union ModifiedUnion { 
 	 integer  a, 
 	 boolean  c, 
 	 EnumeratedRedefinition  b 
	}


type component GeneralComp {	    	    
}	

testcase TC_NegSem_060302_structured_types_009() runs on GeneralComp {

	var ModifiedUnion v_union1:={b:=e_black};
	var UnionType v_union2;
    
    v_union2:=v_union1;	//enumerated type mismatch

}

control{
    execute(TC_NegSem_060302_structured_types_009());
}

}
+41 −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_010 { 

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

	type union UnionType { 
 	 integer  a, 
 	 EnumeratedType  b, 
 	 boolean  c 
	} 
	type union ModifiedUnion { 
 	 integer  aa, 
 	 boolean  cc, 
 	 EnumeratedSynonym  bb 
	}


type component GeneralComp {	    	    
}	

testcase TC_NegSem_060302_structured_types_010() runs on GeneralComp {

	var ModifiedUnion v_union1:={a:=1};
	var UnionType v_union2;
    
    v_union2:=v_union1;	//element naming  mismatch

}

control{
    execute(TC_NegSem_060302_structured_types_010());
}

}