tests: add tests for discarded events/packets creation
Creation of these messages is a bit tested in AllMessagesTestCase, but
not everything, especially not the error cases.
To avoid code duplication as much as possible, I've added a
`run_in_message_iterator_next` helper, similar to the existing
`run_in_component_init`. This helper takes a callback to run in the
context of a source component's message iterator's __next__method.
Individual tests also need to customize the stream class creation, to
decide if the stream class supports discarded event/packet messages,
clock snapshots on those messages, etc. So it also receives a callback
executed in the source component's __init__ method, which must return a
stream class. This callback takes a trace class as a parameter, which
it will need to create the stream class, and a clock class. It is free
to use the clock class as the stream class' default_clock_class or not.
Doing this, I noticed that reading the count and clock snapshot
properties on a _DiscardedEventsMessage didn't work. This will be fixed
in a subsequent patch, in the mean time the corresponding assertions are
commented out.
Change-Id: I5025d06e6cb5b9d1bbd4372818b391cbc7b5bfa2
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3391
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3402
This page took 0.025148 seconds and 4 git commands to generate.