Fix: lib: set iterator state even in non-dev mode
The following test fails currently when building with
BABELTRACE_DEV_MODE off:
FAIL: test_finalize (test_message_iterator.UserMessageIteratorTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File ".../babeltrace/tests/bindings/python/bt2/test_message_iterator.py", line 67, in test_finalize
self.assertTrue(finalized)
AssertionError: False is not true
The test verifies that the _finalize method (in Python) of an input port
message iterator is called when the iterator is destroyed. The failure
shows that the method is not getting called.
The issue is that
bt_self_component_port_input_message_iterator_try_finalize doesn't call
the finalize method if the iterator state is
BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_NON_INITIALIZED.
However, the iterator state is only set when in dev mode. In non-dev
mode, the state is left to its initial value of
BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_NON_INITIALIZED.
Fix this by setting the state of the iterator regardless of whether we
are in dev mode or not.
Change-Id: I158c9d913777eba117ed0d32e82db5a1b29f50ab
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1385
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins
This page took 0.025632 seconds and 4 git commands to generate.