Reactivating defaults and second parameter of deactivate is not working
Summary
According to the TTCN-3 standard activate() can not only be used with an altstep as actual parameter, but with a default. Also, deactivate can have a second boolean parameter, which if set to true, will reactivate the currently deactivated default with the default's priority at deactivation. If false, the default will be activated with highest priority.
Steps and/or TTCN-3 code to reproduce
module control_flow {
type port mypt message{
inout integer;
}with{extension "internal";}
type component myct{
port mypt p;
var integer v;
}
altstep a_myDefaultBehaviour1() runs on myct{
[] p.receive{v:=1}
}
altstep a_myDefaultBehaviour2() runs on myct{
[] p.receive{v:=2}
}
altstep a_myDefaultBehaviour3() runs on myct{
[] p.receive{v:=3}
}
testcase defaults() runs on myct{
connect(self:p, self:p);
var default v_def1 := activate(a_myDefaultBehaviour1());
var default v_def2 := activate(a_myDefaultBehaviour2());
p.send(1);
p.receive(2); //altsteps will handle as 2 is not sent
if(v==3){setverdict(pass);}else{setverdict(fail);}
deactivate(v_def2, true);
p.send(1);
p.receive(2); //altsteps will handle as 2 is not sent
if(v==1){setverdict(pass);}else{setverdict(fail);}
activate(v_def2);
p.send(1);
p.receive(2); //altsteps will handle as 2 is not sent
if(v==2){setverdict(pass);}else{setverdict(fail);}
deactivate(v_def2);
p.send(1);
p.receive(2); //altsteps will handle as 2 is not sent
if(v==1){setverdict(pass);}else{setverdict(fail);}
activate(v_def2);
p.send(1);
p.receive(2); //altsteps will handle as 2 is not sent
if(v==1){setverdict(pass);}else{setverdict(fail);}
}
}
What is the current bug behavior?
There is an error at deactivate(v_def2, true);
, as Titan does not expect the second parameter. Also, there is an error at activate(v_def2);
as activate can only be called for altsteps, not defaults, according to TITAN.
What is the expected correct behavior?
Test case should pass.
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as it's very hard to read otherwise.)
Possible fixes
Titan version
8.1.0
Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyari