Commit 3ee039e0 authored by urbant's avatar urbant
Browse files

New test cases for 6.2.7

parent de2bc8b5
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.2.7, runtime resolved constant in array type declaration
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// Array dimensions shall be specified using constant expressions, which shall 
// evaluate to a positive integer values. Constants used in the constant 
// expressions shall meet with the restrictions in clause 10.

module NegSem_060207_arrays_011 {

	type component GeneralComp {
	}

    function f() return integer {
        if (rnd() < 0.5) { return 5; }
        else { return 10; }
    }
    
    const integer c_dimension := f();
    type integer Arr[c_dimension];
	
	testcase TC_NegSem_060207_arrays_011() runs on GeneralComp {        
        var Arr v_arr;
        v_arr[0] := 1;
		setverdict(pass);
	}
	
	control {
		execute(TC_NegSem_060207_arrays_011());
	}

}
+35 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.2.7, runtime resolved constant in array variable declaration 
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// Array dimensions shall be specified using constant expressions, which shall 
// evaluate to a positive integer values. Constants used in the constant 
// expressions shall meet with the restrictions in clause 10.

module NegSem_060207_arrays_012 {

	type component GeneralComp {
	}

    function f() return integer {
        if (rnd() < 0.5) { return 5; }
        else { return 10; }
    }
    
    const integer c_dimension := f();
	
	testcase TC_NegSem_060207_arrays_012() runs on GeneralComp {        
        var integer v_arr[c_dimension];
        v_arr[0] := 1;
		setverdict(pass);
	}
	
	control {
		execute(TC_NegSem_060207_arrays_012());
	}

}
+34 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.2.7, variable in array variable declaration
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// Array dimensions shall be specified using constant expressions, which shall 
// evaluate to a positive integer values. Constants used in the constant 
// expressions shall meet with the restrictions in clause 10.

module NegSem_060207_arrays_013 {

	type component GeneralComp {
	}

    function f() return integer {
        if (rnd() < 0.5) { return 5; }
        else { return 10; }
    }
	
	testcase TC_NegSem_060207_arrays_013() runs on GeneralComp {        
        var integer v_dimension := f();
        var integer v_arr[v_dimension];
        v_arr[0] := 1;
		setverdict(pass);
	}
	
	control {
		execute(TC_NegSem_060207_arrays_013());
	}

}
+35 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.2.7, modulepar in array variable declaration
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// Array dimensions shall be specified using constant expressions, which shall 
// evaluate to a positive integer values. Constants used in the constant 
// expressions shall meet with the restrictions in clause 10.

module NegSem_060207_arrays_014 {

	type component GeneralComp {
	}

    function f() return integer {
        if (rnd() < 0.5) { return 5; }
        else { return 10; }
    }
    
    modulepar integer PX_DIMENSION := 5;
	
	testcase TC_NegSem_060207_arrays_014() runs on GeneralComp {
        var integer v_arr[PX_DIMENSION];
        v_arr[0] := 1;
		setverdict(pass);
	}
	
	control {
		execute(TC_NegSem_060207_arrays_014());
	}

}
+27 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.2.7, zero dimension array
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// Array dimensions shall be specified using constant expressions, which shall 
// evaluate to a positive integer values. Constants used in the constant 
// expressions shall meet with the restrictions in clause 10.

module NegSem_060207_arrays_015 {

	type component GeneralComp {
	}
	
	testcase TC_NegSem_060207_arrays_015() runs on GeneralComp {        
        var integer v_arr[0] := {};
		setverdict(pass);
	}
	
	control {
		execute(TC_NegSem_060207_arrays_015());
	}

}
Loading