Commit 42a02b32 authored by kovacsa's avatar kovacsa
Browse files

STF487 on-hold processing

parent 2cda0974
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:7.1.3, Ensure that the equals operator on records is evaluated correctly.
 ** @verdict  pass reject
 *****************************************************************/

module NegSem_070103_RelationalOperators_002 {

type component GeneralComp {	    	    
}

 type set IntegerSet1 {
  integer a1 optional,
  integer a2 optional,
  integer a3 optional
 };

 type set IntegerSet2 {
  integer a4 optional,
  integer a5 optional,
  integer a6 optional
 };

 type set LargeSet {
  integer a1 optional,
  integer a2 optional,
  integer a3 optional,
  integer a4 optional,
  integer a5 optional,
  integer a6 optional
 };


testcase TC_NegSem_070103_RelationalOperators_002() runs on GeneralComp {
	const IntegerSet1 c_set1 := {a1:=0,a2:=omit,a3:=2};
	const IntegerSet2 c_set2 := {a4:=3,a5:=5,a6:=omit};
	const LargeSet   c_large := {a1:=0,a2:=omit,a3:=2,a4:=3,a5:=5,a6:=omit};

	if ( c_set1 & c_set2 == c_large ) {  //It is intentionally forbidden to concatenate record and set values
		setverdict(pass);
	}

}

control{
    execute(TC_NegSem_070103_RelationalOperators_002());
}

}
+51 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:7.1.3, Ensure that the equals operator on records is evaluated correctly.
 ** @verdict  pass reject
 *****************************************************************/
//on hold till resolution of CR6707

module NegSem_070103_RelationalOperators_003 {

type component GeneralComp {	    	    
}

 type set IntegerSet1 {
  integer a1 optional,
  integer a2 optional,
  integer a3 optional
 };

 type set IntegerSet2 {
  integer a4 optional,
  integer a5 optional,
  integer a6 optional
 };

 type set LargeSet {
  integer a1 optional,
  integer a2 optional,
  integer a3 optional,
  integer a4 optional,
  integer a5 optional,
  integer a6 optional
 };


testcase TC_NegSem_070103_RelationalOperators_003() runs on GeneralComp {
	const IntegerSet1 c_set1 := {a1:=0,a2:=omit,a3:=2};
	const IntegerSet2 c_set2 := {a4:=3,a5:=5,a6:=omit};
	const LargeSet   c_large := {a1:=0,a2:=omit,a3:=2,a4:=3,a5:=5,a6:=6};

	if ( c_set1 & c_set2 != c_large ) {  //It is intentionally forbidden to concatenate record and set values
		setverdict(pass);
	} 
	
}

control{
    execute(TC_NegSem_070103_RelationalOperators_003());
}

}
+50 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:7.1.3, Ensure that the equals operator on records is evaluated correctly.
 ** @verdict  pass reject
 *****************************************************************/
//on hold till resolution of CR6707

module NegSem_070103_RelationalOperators_004 {

type component GeneralComp {	    	    
}

 type set IntegerSet1 {
  integer a1 optional,
  integer a2 optional,
  integer a3 optional
 };

 type set IntegerSet2 {
  integer a4 optional,
  integer a5 optional,
  integer a6 optional
 };

 type set LargeSet {
  integer a1 optional,
  integer a2 optional,
  integer a3 optional,
  integer a4 optional,
  integer a5 optional
 };


testcase TC_NegSem_070103_RelationalOperators_004() runs on GeneralComp {
	const IntegerSet1 c_set1 := {a1:=0,a2:=omit,a3:=2};
	const IntegerSet2 c_set2 := {a4:=3,a5:=5,a6:=omit};
	const LargeSet   c_large := {a1:=0,a2:=omit,a3:=2,a4:=3,a5:=5};

	if ( c_set1 & c_set2 != c_large ) {  //It is intentionally forbidden to concatenate record and set values
		setverdict(pass);
	} 
	
}

control{
    execute(TC_NegSem_070103_RelationalOperators_004());
}

}
+54 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:15.6.2, ? shall be returned for mandatory subfields and * shall be returned for optional subfields.
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

module Sem_150602_ReferencingRecordAndSetFields_003 {

    type component GeneralComp { }

    type record MyRecordTwo {
        integer g1,
        MyRecordTwo g2 optional
    }

    type record MyRecordOne {
        integer f1 optional,
        MyRecordTwo f2 optional
    }

    testcase TC_Sem_150602_ReferencingRecordAndSetFields_003() runs on GeneralComp {
        var boolean v_matchRes;
        var template MyRecordOne m_R1 := {
            f1 := 0,
            f2 := ?
        }

        // m_R2.g1 is mandatory, therefore it shall be ?
        // m_R2.g2 is optional, therefore it shall be *
        var template MyRecordTwo m_R2 := m_R1.f2;
        var template(value) MyRecordTwo m_value := {
            g1 := 5,
            g2 := omit
        }

        // match against {?, *}
        v_matchRes := match(m_value, MyRecordTwo:{m_R2.g1, m_R2.g2});


        if (v_matchRes) {
            setverdict(pass);
        } else {
            setverdict(fail, "match against {?, *}");
        }

    }

    control{
        execute(TC_Sem_150602_ReferencingRecordAndSetFields_003());
    }


}
 No newline at end of file
+53 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:15.6.2, ? shall be returned for mandatory subfields and * shall be returned for optional subfields.
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

module Sem_150602_ReferencingRecordAndSetFields_004 {

    type component GeneralComp { }

    type record MyRecordTwo {
        integer g1,
        MyRecordTwo g2 optional
    }

    type record MyRecordOne {
        integer f1 optional,
        MyRecordTwo f2 optional
    }

    testcase TC_Sem_150602_ReferencingRecordAndSetFields_004() runs on GeneralComp {
        var template MyRecordOne m_R1 := {
            f1 := 0,
            f2 := ?
        }

        // m_R2.g1 is mandatory, therefore it shall be ?
        // m_R2.g2 is optional, therefore it shall be *
        var template MyRecordTwo m_R2 := m_R1.f2;
 
        var template(value) MyRecordTwo m_value := {
            g1 := 5,
            g2 := omit
        }

        // match against {?, *} - use dotted notation to cover other expansion thread
        var boolean v_matchRes := match(m_value, MyRecordTwo:{m_R1.f2.g1, m_R1.f2.g2});


        if (v_matchRes) {
            setverdict(pass);
        } else {
            setverdict(fail, "match against {?, *} - use dotted notation to cover other expansion thread");
        }
    }

    control{
        execute(TC_Sem_150602_ReferencingRecordAndSetFields_004());
    }


}
 No newline at end of file
Loading