Commit 5c784391 authored by Kristof Szabados's avatar Kristof Szabados Committed by Gerrit Code Review
Browse files

Merge "fix: checkstate marked as non-deterministic function invoking during snapshots"

parents bd7509f2 482bfbc2
......@@ -630,7 +630,7 @@ namespace Common {
break;
case OPTYPE_CHECKSTATE_ANY: // [r1] v2: port or any
case OPTYPE_CHECKSTATE_ALL: // [r1] v2: port or all
u.expr.v2->chk_expr_immutability();
warning("State of port(s) may change during the actual snapshot.");
break;
case OPTYPE_HOSTID: // [v1]
if (u.expr.v1) u.expr.v1->chk_expr_immutability();
......
......@@ -1333,16 +1333,16 @@ module M {
testcase T() runs on C {
timer t := 5.0; t.start;
alt {
[(p.checkstate("Connected"))] t.timeout {} // OK?
[(any port.checkstate("Connected"))] t.timeout {} // OK?
[(p.checkstate("Connected"))] t.timeout {} // NOT OK
[(any port.checkstate("Connected"))] t.timeout {} // NOT OK
[(p.checkstate(FS()))] t.timeout {} // NOT OK
[(any port.checkstate(FS()))] t.timeout {} // NOT OK
}
}
}
<END_MODULE>
<RESULT IF_FAIL COUNT 2>
(?im)\bwarning\b.+?\bFunction invocation\b.+?\bmay change the actual snapshot\b
<RESULT IF_FAIL COUNT 4>
(?im)\bwarning\b.+?\bstate of port\b.+?\bmay change during the actual snapshot\b
<END_RESULT>
<END_TC>
:exmp.
......
......@@ -149,10 +149,10 @@ module InvokingFunctionFromSpecificPlaces_SW { //^In TTCN-3 module//
[t.running] t.timeout {} //^In guard expression// //^warning\: State of timer//
/* OPTYPE_CHECKSTATE_ANY */
[(any port.checkstate("Connected"))] t.timeout {}
[(any port.checkstate(fs()))] t.timeout {} //^In guard expression// //^warning\: Function invocation//
[(any port.checkstate("Connected"))] t.timeout {} //^In guard expression// //^warning\: State of port//
[(any port.checkstate(fs()))] t.timeout {} //^In guard expression// //^warning\: State of port//
/* OPTYPE_CHECKSTATE_ALL */
[(all port.checkstate(fs()))] t.timeout {} //^In guard expression// //^warning\: Function invocation//
[(all port.checkstate(fs()))] t.timeout {} //^In guard expression// //^warning\: State of port//
/* OPTYPE_HOSTID */
[hostid() == ""] t.timeout {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment