Commit f0252994 authored by urbant's avatar urbant
Browse files

STF 521 updates

parent 489eccda
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.2, Verify that template parameter of an activated altstep cannot be an out parameter
** @verdict pass reject
*****************************************************************/
module NegSem_05040102_parameters_of_kind_template_018 {
altstep a_test(out template integer p_par) runs on C {
[] any timer.timeout {
p_par := ?;
}
}
type component C {
}
testcase TC_NegSem_05040102_parameters_of_kind_template_018() {
var integer v_int := ?;
activate(a_test(v_int));
setverdict(pass);
}
control {
execute(TC_NegSem_05040102_parameters_of_kind_template_018());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.2, Verify that template parameter of an activated altstep cannot be an inout parameter
** @verdict pass reject
*****************************************************************/
module NegSem_05040102_parameters_of_kind_template_018 {
altstep a_test(inout template integer p_par) runs on C {
[] any timer.timeout {
p_par := ?;
}
}
type component C {
}
testcase TC_NegSem_05040102_parameters_of_kind_template_018() {
var integer v_int := ?;
activate(a_test(v_int));
setverdict(pass);
}
control {
execute(TC_NegSem_05040102_parameters_of_kind_template_018());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.3, Verify that functions with timer parameters cannot be used in component.start operation
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Only function and altstep definitions may have formal timer parameters, with the exception of functions or
// altsteps started as test component behaviour (see clause 21.3.2).
module NegSem_05040103_parameters_of_kind_timer_001 {
type component C {
}
function f_test(inout timer p_tmr) runs on C {
p_tmr.timeout;
setverdict(pass);
}
testcase TC_NegSem_05040103_parameters_of_kind_timer_001() runs on C system C {
timer t_tmr := 0.1;
var C v_ptc := C.create;
t_tmr.start;
v_ptc.start(f_test(t_tmr));
v_ptc.done;
}
control {
execute(TC_NegSem_05040103_parameters_of_kind_timer_001());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.3, Verify that altsteps with timer parameters cannot be used in component.start operation
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Only function and altstep definitions may have formal timer parameters, with the exception of functions or
// altsteps started as test component behaviour (see clause 21.3.2).
module NegSem_05040103_parameters_of_kind_timer_002 {
type component C {
}
altstep f_test(inout timer p_tmr) runs on C {
[] p_tmr.timeout {
setverdict(pass);
}
}
testcase TC_NegSem_05040103_parameters_of_kind_timer_002() runs on C system C {
timer t_tmr := 0.1;
var C v_ptc := C.create;
t_tmr.start;
v_ptc.start(f_test(t_tmr));
v_ptc.done;
}
control {
execute(TC_NegSem_05040103_parameters_of_kind_timer_002());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.3, Verify that test cases cannot have timer parameters
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Only function and altstep definitions may have formal timer parameters, with the exception of functions or
// altsteps started as test component behaviour (see clause 21.3.2).
module NegSem_05040103_parameters_of_kind_timer_003 {
type component C {
}
testcase TC_NegSem_05040103_parameters_of_kind_timer_003(timer p_tmr) runs on C {
p_tmr.timeout;
setverdict(pass);
}
control {
timer t_tmr := 0.1;
t_tmr.start;
execute(TC_NegSem_05040103_parameters_of_kind_timer_003(t_tmr));
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.3, Verify that templates cannot have timer parameters
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Only function and altstep definitions may have formal timer parameters, with the exception of functions or
// altsteps started as test component behaviour (see clause 21.3.2).
module NegSem_05040103_parameters_of_kind_timer_004 {
type component C {
}
template boolean m_msg (timer p_tmr) := p_tmr.running;
testcase TC_NegSem_05040103_parameters_of_kind_timer_004() runs on C system C {
timer t_tmr := 0.1;
t_tmr.start;
log(m_msg(t_tmr));
setverdict(pass);
}
control {
execute(TC_NegSem_05040103_parameters_of_kind_timer_004());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.3, Verify that in timer parameters are not allowed
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Formal timer parameters shall be inout parameters, which can optionally be indicated by the keyword inout.
module NegSyn_05040103_parameters_of_kind_timer_001 {
type component C {
}
function f_test(in timer p_tmr) {
p_tmr.timeout;
}
testcase TC_NegSyn_05040103_parameters_of_kind_timer_001() runs on C {
timer t_tmr := 1.0;
t_tmr.start;
f_test(t_tmr);
setverdict(pass);
}
control {
execute(TC_NegSyn_05040103_parameters_of_kind_timer_001());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.3, Verify that out timer parameters are not allowed
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Formal timer parameters shall be inout parameters, which can optionally be indicated by the keyword inout.
module NegSyn_05040103_parameters_of_kind_timer_002 {
type component C {
}
function f_test(out timer p_tmr) {
p_tmr.start(1.0);
}
testcase TC_NegSyn_05040103_parameters_of_kind_timer_002() runs on C{
timer t_tmr;
f_test(t_tmr);
t_tmr.timeout
setverdict(pass);
}
control {
execute(TC_NegSyn_05040103_parameters_of_kind_timer_002());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.3, Verify that inout prefix can be used for timer parameters
** @verdict pass accept, ttcn3verdict:pass
*****************************************************************/
// The following requirement is tested:
// Formal timer parameters shall be inout parameters, which can optionally be indicated by the keyword inout.
module Sem_05040103_parameters_of_kind_timer_002 {
type component C {
}
function f_test(inout timer p_tmr) {
p_tmr.timeout;
setverdict(pass);
}
testcase TC_Sem_05040103_parameters_of_kind_timer_001() runs on C {
timer t_tmr := 0.1;
t_tmr.start;
f_test(t_tmr);
}
control {
execute(TC_Sem_05040103_parameters_of_kind_timer_001());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.3, Verify that altstep can have timer parameters
** @verdict pass accept, ttcn3verdict:pass
*****************************************************************/
// The following requirement is tested:
// Only function and altstep definitions may have formal timer parameters, with the exception of functions or
// altsteps started as test component behaviour (see clause 21.3.2).
module Sem_05040103_parameters_of_kind_timer_003 {
type component C {
}
altstep a_test(timer p_tmr) {
[] p_tmr.timeout {
setverdict(pass);
}
}
testcase TC_Sem_05040103_parameters_of_kind_timer_001() runs on C {
timer t_tmr := 0.1;
t_tmr.start;
a_test(t_tmr);
}
control {
execute(TC_Sem_05040103_parameters_of_kind_timer_001());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.4, Verify that functions with port parameters cannot be used in component.start operation
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Only function and altstep definitions may have formal port parameters, - with the exception of functions or
// altsteps started as test component behaviour (see clause 21.3.2).
module NegSem_05040104_parameters_of_kind_port_001 {
type port P message {
inout integer
}
type component C {
port P p;
}
function f_test(P p_port) runs on C {
p_port.send(1);
setverdict(pass);
}
testcase TC_NegSem_05040104_parameters_of_kind_port_001() runs on C system C {
var C v_ptc := C.create;
v_ptc.start(f_test(p));
v_ptc.done;
}
control {
execute(TC_NegSem_05040104_parameters_of_kind_port_001());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.4, Verify that altsteps with port parameters cannot be used in component.start operation
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Only function and altstep definitions may have formal port parameters, - with the exception of functions or
// altsteps started as test component behaviour (see clause 21.3.2).
module NegSem_05040104_parameters_of_kind_port_002 {
type port P message {
inout integer
}
type component C {
port P p;
}
altstep a_test(P p_port) runs on C {
[] p_port.receive(integer:?) {
setverdict(pass);
}
}
testcase TC_NegSem_05040104_parameters_of_kind_port_002() runs on C system C {
var C v_ptc := C.create;
connect(mtc:p, mtc:p);
p.send(1);
v_ptc.start(a_test(p));
v_ptc.done;
}
control {
execute(TC_NegSem_05040104_parameters_of_kind_port_002());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.4, Verify that in port parameters are not allowed
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Formal port parameters shall be inout parameters, which can optionally be indicated by the keyword inout.
module NegSem_05040104_parameters_of_kind_port_003 {
type port P message {
inout integer
}
type component C {
port P p;
}
function f_test(in P p_port) {
p_port.send(1);
}
testcase TC_NegSem_05040104_parameters_of_kind_port_003() runs on C {
f_test(p);
setverdict(pass);
}
control {
execute(TC_NegSem_05040104_parameters_of_kind_port_003());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.4, Verify that out port parameters are not allowed
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Formal port parameters shall be inout parameters, which can optionally be indicated by the keyword inout.
module NegSem_05040104_parameters_of_kind_port_004 {
type port P message {
inout integer
}
type component C {
port P p;
}
function f_test(out P p_port) {
setverdict(pass);
}
testcase TC_NegSem_05040104_parameters_of_kind_port_004() runs on C {
f_test(p);
}
control {
execute(TC_NegSem_05040104_parameters_of_kind_port_004());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.4, Verify that test cases cannot have port parameters
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Only function and altstep definitions may have formal port parameters, - with the exception of functions or
// altsteps started as test component behaviour (see clause 21.3.2).
module NegSem_05040104_parameters_of_kind_port_005 {
type port P message {
inout integer
}
type component C {
port P p;
}
testcase TC_Test(P p_port) runs on C { // should cause a compilation error
p_port.send(1);
setverdict(pass);
}
testcase TC_NegSem_05040104_parameters_of_kind_port_005(P p_port) runs on C {
setverdict(pass);
}
control {
execute(TC_NegSem_05040104_parameters_of_kind_port_005());
}
}
\ No newline at end of file
/*****************************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:5.4.1.4, Verify that templates cannot contain port parameters
** @verdict pass reject
*****************************************************************/
// The following requirement is tested:
// Only function and altstep definitions may have formal port parameters, - with the exception of functions or
// altsteps started as test component behaviour (see clause 21.3.2).
module NegSem_05040104_parameters_of_kind_port_006 {
type port P message {
inout integer
}
type component C {
port P p;
}
template boolean m_msg(P p_par) := p_par.checkstate("Started");
testcase TC_NegSem_05040104_parameters_of_kind_port_006() runs on C system C {
log(m_msg(p));
setverdict(pass);
}