Commit 1cb03e54 authored by zeiss's avatar zeiss
Browse files

No commit message

No commit message
parent a614e768
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 12 $
 ** @purpose  1:7.1.1, Ensure that the application of the modulo 
 **           operator on integer variables is evaluated correctly
 **           when the operand is a negative integer.
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

module Sem_070101_ArithmeticOperators_014 {

type component GeneralComp {	    	    
}

testcase TC_Sem_070101_ArithmeticOperators_014() runs on GeneralComp {
	var integer v_i := -2;
	var integer v_result := (v_i mod 3);
	
	if (v_result == 1) {
		setverdict(pass);
	} else {
		setverdict(fail);
	}
}			

control{
    execute(TC_Sem_070101_ArithmeticOperators_014());
}

}
+30 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 12 $
 ** @purpose  1:7.1.1, Ensure that the application of the remainder 
 **           operator on integer variables is evaluated correctly
 **           when the operand is a negative integer.
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

module Sem_070101_ArithmeticOperators_015 {

type component GeneralComp {	    	    
}

testcase TC_Sem_070101_ArithmeticOperators_015() runs on GeneralComp {
	var integer v_i := -2;
	var integer v_result := (v_i rem 3);
	
	if (v_result == -2) {
		setverdict(pass);
	} else {
		setverdict(fail);
	}
}			

control{
    execute(TC_Sem_070101_ArithmeticOperators_015());
}

}
+30 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 12 $
 ** @purpose  1:7.1.1, Ensure that the application of the remainder 
 **           operator on integer variables is evaluated correctly
 **           when the operand is a negative integer.
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

module Sem_070101_ArithmeticOperators_016 {

type component GeneralComp {	    	    
}

testcase TC_Sem_070101_ArithmeticOperators_016() runs on GeneralComp {
	var integer v_i := 2;
	var integer v_result := (v_i rem 3);
	
	if (v_result == 2) {
		setverdict(pass);
	} else {
		setverdict(fail);
	}
}			

control{
    execute(TC_Sem_070101_ArithmeticOperators_016());
}

}
+30 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 12 $
 ** @purpose  1:7.1.1, Ensure that the consecutive application of 
 **           the remainder operator and the modulo operator 
 **           on integer variables is evaluated correctly.
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

module Sem_070101_ArithmeticOperators_017 {

type component GeneralComp {	    	    
}

testcase TC_Sem_070101_ArithmeticOperators_017() runs on GeneralComp {
	var integer v_i := -2;
	var integer v_result := (v_i rem 3) mod 3;
	
	if (v_result == 1) {
		setverdict(pass);
	} else {
		setverdict(fail);
	}
}			

control{
    execute(TC_Sem_070101_ArithmeticOperators_017());
}

}
+30 −0
Original line number Diff line number Diff line
/*****************************************************************
 ** @author   STF 409
 ** @version  $Rev: 12 $
 ** @purpose  1:7.1.1, Ensure that operator combinations and the 
 **           modulo operator on integer variables is evaluated 
 **           correctly.
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

module Sem_070101_ArithmeticOperators_018 {

type component GeneralComp {	    	    
}

testcase TC_Sem_070101_ArithmeticOperators_018() runs on GeneralComp {
	var integer v_i := 100;
	var integer v_result := (((((v_i mod 75)/5)*2)+10)-22) rem 3;
	
	if (v_result == -2) {
		setverdict(pass);
	} else {
		setverdict(fail);
	}
}			

control{
    execute(TC_Sem_070101_ArithmeticOperators_018());
}

}
Loading