Commit a8f2756b authored by zeiss's avatar zeiss
Browse files

No commit message

No commit message
parent ef5cdb41
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 150 $
 ** @purpose  1:15.6.3, Ensure that access into permutation in record of templates is forbidden.
 ** @verdict  pass reject
 *****************************************************************/

module NegSem_150603_ReferencingRecordOfAndSetElements_007 {

type component GeneralComp { }

type record of integer RoI;

testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_007() runs on GeneralComp {
	var template RoI m_one;
	var integer v_test;
	
	m_one := {permutation(0,1,3,?),2,*};
	v_test := m_one[2]; // shall cause an error as the third element (index 2) will be inside the permutation 

	setverdict(fail);
}

control{
    execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_007());
}

}
 No newline at end of file
+28 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 150 $
 ** @purpose  1:15.6.3, Ensure that access to record of indexes is forbidden when a previous index entry is a permutation with a *.
 ** @verdict  pass reject
 *****************************************************************/

module NegSem_150603_ReferencingRecordOfAndSetElements_008 {

type component GeneralComp { }

type record of integer RoI;

testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_008() runs on GeneralComp {
	var template RoI m_one;
	var integer v_test;
	
	m_one := {permutation(0,1,3,*),2,?};
	v_test := m_one[5]; // shall cause an error as the permutation contains a * that is able to cover any record of indexes 

	setverdict(fail);
}

control{
    execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_008());
}

}
 No newline at end of file
+35 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 150 $
 ** @purpose  1:15.6.3, Ensure that access outside permutation fields is allowed and works as expected.
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

module Sem_150603_ReferencingRecordOfAndSetElements_005 {

type component GeneralComp { }

type record of integer RoI;

testcase TC_Sem_150603_ReferencingRecordOfAndSetElements_005() runs on GeneralComp {
	var template RoI m_one;
	var template integer m_two;
	
	m_one := {permutation(0,1,3,?),2,?};
	// assignment should yield ?
	m_two := m_one[5];
	
	if (match("?",m_two)) {
		setverdict(pass);
	} else {
		setverdict(fail);
	}
}

control{
    execute(TC_Sem_150603_ReferencingRecordOfAndSetElements_005());
}



}
 No newline at end of file