Commit cd392f27 authored by stancakapost's avatar stancakapost
Browse files

constants

parent d66feb2f
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409
 ** @version  $Rev: 45 $
 ** @purpose  1:10, 1:16.2.1, Assign rnd to constant not allowed
 ** @verdict  pass reject
 ***************************************************/
module NegSem_10_Constants_001 {

    const float c_i := rnd(314E-2);
    
    type component GeneralComp {}
    
    testcase TC_NegSem_10_Constants_001() runs on GeneralComp {
        log(c_i);
        setverdict(pass);
    }
    
    control{
        execute(TC_NegSem_10_Constants_001());
    }
}
 No newline at end of file
+27 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409
 ** @version  $Rev: 45 $
 ** @purpose  1:10, Assign and read constants
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/
module Sem_10_Constants_001 {

    const integer c_i := 5;
    
    type component GeneralComp {}
    
    testcase TC_Sem_10_Constants_001() runs on GeneralComp {
        const integer c_j := 5;
    
    	if (c_i == c_j){
    		setverdict(pass);
    	}
    	else {
    		setverdict(fail);
    	}
    }
    
    control{
        execute(TC_Sem_10_Constants_001());
    }
}
 No newline at end of file
+27 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409
 ** @version  $Rev: 45 $
 ** @purpose  1:10, Assign and read constants values
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/
module Sem_10_Constants_002 {

    const integer c_ai[3] := {1, 3, 5};
    
    type component GeneralComp {}
    
    testcase TC_Sem_10_Constants_002() runs on GeneralComp {
        const integer c_j := 5;
    
    	if (c_ai[2] == c_j){
    		setverdict(pass);
    	}
    	else {
    		setverdict(fail);
    	}
    }
    
    control{
        execute(TC_Sem_10_Constants_002());
    }
}
 No newline at end of file
+12 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409
 ** @version  $Rev: 45 $
 ** @purpose  1:10, Create constants
 ** @verdict  pass accept, noexecution
 ***************************************************/
module Syn_10_Constants_001 {
    const integer c_i1 := 5, c_i2 := 3;
    const float c_f := 3.14E-4;
    const boolean c_b := true, c_b2 := false;
    const bitstring c_bs := '1011'B;
}
 No newline at end of file
+9 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 409
 ** @version  $Rev: 45 $
 ** @purpose  1:10, Assign default constants values
 ** @verdict  pass accept, noexecution
 ***************************************************/
module Syn_10_Constants_002 {
    const default c_d := null;
}
 No newline at end of file
Loading