Commit 967b925e authored by urbant's avatar urbant
Browse files

New tests for 20.5, 21.1.1, 21.1.2 and 21.3.2

parent dced5adf
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -28,7 +28,7 @@ module NegSem_200502_the_activate_operation_001 {
	}
	}
	
	
	testcase TC_NegSem_200502_the_activate_operation_001() runs on GeneralComp {
	testcase TC_NegSem_200502_the_activate_operation_001() runs on GeneralComp {
		a();
		activate(a());
		setverdict(pass);
		setverdict(pass);
	}
	}


+47 −0
Original line number Original line Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:20.5.2, local timer as a parameter of activated altstep in module control
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// For altsteps activated in module control or in functions or altsteps invoked
// directly or indirectly from module control, all timer instances in the actual 
// parameter list shall be declared in the highest scope of the module control 
// part (see clause 26.2). Timers from lower scopes of the module control part 
// (i.e. from the nested statement blocks) are not allowed to occur in the actual
// parameter list.

module NegSem_200502_the_activate_operation_006 { 

	type port P message {
		inout integer;
	}
	
	type component GeneralComp {
		port P p;
	}
	
	altstep a(timer t_tmr) {
		[] t_tmr.timeout { log ("Timeout in default"); }
	}
	
	testcase TC_NegSem_200502_the_activate_operation_006() runs on GeneralComp {
        setverdict(pass);
	}

    function f_test() {
        timer t_tmr := 1.0, t_tmr2;
        t_tmr.start;
        activate(a(t_tmr));
        alt {
            [] t_tmr2.timeout { }
        }
    }
    
	control{
        f_test();
		execute(TC_NegSem_200502_the_activate_operation_006());
	}
}
+52 −0
Original line number Original line Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:20.5.2, local timer (referenced through timer parameter) as a parameter of activated altstep in module control
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// For altsteps activated in module control or in functions or altsteps invoked
// directly or indirectly from module control, all timer instances in the actual 
// parameter list shall be declared in the highest scope of the module control 
// part (see clause 26.2). Timers from lower scopes of the module control part 
// (i.e. from the nested statement blocks) are not allowed to occur in the actual
// parameter list.

module NegSem_200502_the_activate_operation_007 { 

	type port P message {
		inout integer;
	}
	
	type component GeneralComp {
		port P p;
	}
	
	altstep a(timer t_tmr) {
		[] t_tmr.timeout { log ("Timeout in default"); }
	}
	
	testcase TC_NegSem_200502_the_activate_operation_007() runs on GeneralComp {
        setverdict(pass);
	}

    function f_activate(timer t_tmr) {
        activate(a(t_tmr));
    }
    
    function f_test() {
        timer t_tmr := 1.0;
        t_tmr.start;
        f_activate(t_tmr); // t_tmr is a local timer, this should lead to an activation error in f_activate
    }
    
	control{
        timer t_tmr2;
        f_test();
        alt {
            [] t_tmr2.timeout { }
        }
		execute(TC_NegSem_200502_the_activate_operation_007());
	}
}
+43 −0
Original line number Original line Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:20.5.2, control block timer as a parameter of activated altstep
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

// The following requirement is tested:
// For altsteps activated in module control or in functions or altsteps invoked
// directly or indirectly from module control, all timer instances in the actual 
// parameter list shall be declared in the highest scope of the module control 
// part (see clause 26.2). Timers from lower scopes of the module control part 
// (i.e. from the nested statement blocks) are not allowed to occur in the actual
// parameter list.

module Sem_200502_the_activate_operation_005 { 

	type port P message {
		inout integer;
	}
	
	type component GeneralComp {
		port P p;
	}
	
	altstep a(timer t_tmr) {
		[] t_tmr.timeout { log ("Timeout in default"); }
	}
	
	testcase TC_Sem_200502_the_activate_operation_005() runs on GeneralComp {
        setverdict(pass);
	}

	control{
        timer t_tmr := 1.0, t_tmr2;
        t_tmr.start;
        activate(a(t_tmr));
        alt {
            [] t_tmr2.timeout { }
        }
		execute(TC_Sem_200502_the_activate_operation_005());
	}
}
+48 −0
Original line number Original line Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:20.5.2, control block timer (referenced through timer parameter) as a parameter of activated altstep
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

// The following requirement is tested:
// For altsteps activated in module control or in functions or altsteps invoked
// directly or indirectly from module control, all timer instances in the actual 
// parameter list shall be declared in the highest scope of the module control 
// part (see clause 26.2). Timers from lower scopes of the module control part 
// (i.e. from the nested statement blocks) are not allowed to occur in the actual
// parameter list.

module Sem_200502_the_activate_operation_006 { 

	type port P message {
		inout integer;
	}
	
	type component GeneralComp {
		port P p;
	}
	
	altstep a(timer t_tmr) {
		[] t_tmr.timeout { log ("Timeout in default"); }
	}
	
	testcase TC_Sem_200502_the_activate_operation_006() runs on GeneralComp {
        setverdict(pass);
	}

    function f_test(timer t_tmr) {
        timer t_tmr2;
        t_tmr.start;
        activate(a(t_tmr));
        alt {
            [] t_tmr2.timeout { }
        }
    }
    
	control{
        timer t_tmr := 1.0;
        f_test(t_tmr);
		execute(TC_Sem_200502_the_activate_operation_006());
	}
}
Loading