given the following state machine:
we would expect the two following state-sequences:
somefunc returns !1: A->B->C0->D
somefunc returns 1: A->B->C1->D
But, when running the following SCTUnit tests:
@Test
operation branchTest0(){
mock ifc.somefunc() returns (0)
enter
assert active(main_region.StateA)
proceed 1 cycle
assert active(main_region.StateB)
assert(ifc.testvar==0)
proceed 1 cycle
assert(ifc.testvar==1)
assert active(main_region.StateC0)
proceed 1 cycle
assert active(main_region.StateD)
exit
}
@Test
operation branchTest1(){
mock ifc.somefunc() returns (1)
enter
assert active(main_region.StateA)
proceed 1 cycle
assert active(main_region.StateB)
assert(ifc.testvar==1)
proceed 1 cycle
assert(ifc.testvar==1)
assert active(main_region.StateC1)
proceed 1 cycle
assert active(main_region.StateD)
exit
}
The execution order is different, it seems to be A->B->C0->D in both cases.
When swapping the transition priority in stateB it works as expected. This seems strange to me as I expect the ifc.testvar assingment only to happen on else.
When changing the transition assignment from 1 to 2 it again works as expected (with the exeption of the var not being 1, but 2)