@lazy and @fuzzy modifiers are not working properly in Titan
Summary
According to Section 11.0 of the TTCN-3 standard a lazy variable shall be evaluated when it is first referenced after its value assignment, and shall keep its value until its next value assignment. A fuzzy variable shall be evaluated each time it is referenced after its value assignment. Titan however, evaluates lazy and fuzzy variables right at their value assignments.
Steps and/or TTCN-3 code to reproduce
module variables {
type component ct_empty{}
testcase lazyeval() runs on ct_empty{
var integer i := 5;
var @lazy integer l := i;
i := 6;
if(l==6){setverdict(pass);}else{setverdict(fail);}
i := 7;
if(l==6){setverdict(pass);}else{setverdict(fail);}
var float n := 1.0;
var float d := 0.0;
var @lazy float f := n/d;
//shall not cause error as it's not evaluated
}
testcase fuzzyeval() runs on ct_empty{
var integer i := 5;
var @fuzzy integer l := i;
i := 6;
if(l==6){setverdict(pass);}else{setverdict(fail);}
i := 7;
if(l==7){setverdict(pass);}else{setverdict(fail);}
var @fuzzy integer v_fuzzy := 1;
var integer v_var;
var boolean v_condition := true;
if (v_condition) {
var integer v_local := 0;
v_fuzzy := v_local;
v_local := 10;
}
if(v_fuzzy==10){setverdict(pass);}else{setverdict(fail);}
}
control{
execute(lazyeval());
execute(fuzzyeval());
}
}
What is the current bug behavior?
lazy test case causes error (and would not pass without the division by zero). The fuzzy test case fails too.
What is the expected correct behavior?
Both test cases shall pass
Relevant logs and/or screenshots
Possible fixes
Titan version
8.1.0
Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyari
Edited by Levente Erős