Unexpected behavior of port.halt
Submitted by Elemer Lelik
Link to original bug (#568552)
Description
see https://www.eclipse.org/forums/index.php/t/1105772/
From TTCN-3 standards:
Quote:
22.5.4 The Halt port operation The halt operation is comparable to the stop operation, but allows entries being already in the queue to be processed with receiving operations
[...]
Examples Code: [Select all] [Show/ hide] myPort.halt; // No sending allowed on myPort from this moment on; // processing of messages in the queue still possible.
myPort.receive (mw_myTemplate1);
// If a message was already in the queue before the halt
// operation and it matches mw_myTemplate1, it is processed; // otherwise the receive operation blocks
I interpreted this to mean that I could halt my port, then receive what has already arrived on the port and been enqueued. No more messages would be enqueued on the port if they arrive.
However, when inside an alt statement, if a message arrives on the test port after halting it, I get a dynamic test case error saying "Port <name>
is not started by a message has arrived on it".
Is this optimal behavior and what was intended by the standard? It seems to me that this makes port.halt way less useful, since it risks raising an error if used after halting?
Anton Vikstrom
Version: 7.1.0