X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fdata%2Fplugins%2Fflt.utils.trimmer%2Fbt_plugin_trimmer_test.py;h=a59ea9bd1bebf432ea6fbb78356b960ac3d1f441;hb=c49bf79b7d7e87cc21d065a7d208bcc238fb0800;hp=e1db25edb3239686795557e2c8886f455b3533f0;hpb=37a93d415ba5a4d839a89157d91496f21c367a96;p=babeltrace.git diff --git a/tests/data/plugins/flt.utils.trimmer/bt_plugin_trimmer_test.py b/tests/data/plugins/flt.utils.trimmer/bt_plugin_trimmer_test.py index e1db25ed..a59ea9bd 100644 --- a/tests/data/plugins/flt.utils.trimmer/bt_plugin_trimmer_test.py +++ b/tests/data/plugins/flt.utils.trimmer/bt_plugin_trimmer_test.py @@ -2,7 +2,7 @@ import bt2 class TheIteratorOfAllEvil(bt2._UserMessageIterator): - def __init__(self, port): + def __init__(self, config, port): tc, sc, ec1, ec2, params = port.user_data trace = tc() stream = trace.create_stream(sc) @@ -32,8 +32,9 @@ class TheIteratorOfAllEvil(bt2._UserMessageIterator): se_msg, ] self._at = 0 + config.can_seek_forward = True - def _seek_beginning(self): + def _user_seek_beginning(self): self._at = 0 def __next__(self): @@ -44,20 +45,24 @@ class TheIteratorOfAllEvil(bt2._UserMessageIterator): else: raise StopIteration + @bt2.plugin_component_class -class TheSourceOfAllEvil(bt2._UserSourceComponent, - message_iterator_class=TheIteratorOfAllEvil): - def __init__(self, params): +class TheSourceOfAllEvil( + bt2._UserSourceComponent, message_iterator_class=TheIteratorOfAllEvil +): + def __init__(self, config, params, obj): tc = self._create_trace_class() # Use a clock class with an offset, so we can test with --begin or --end # smaller than this offset (in other words, a time that it's not # possible to represent with this clock class). cc = self._create_clock_class(frequency=1, offset=bt2.ClockClassOffset(10000)) - sc = tc.create_stream_class(default_clock_class=cc, - supports_packets=True, - packets_have_beginning_default_clock_snapshot=True, - packets_have_end_default_clock_snapshot=True) + sc = tc.create_stream_class( + default_clock_class=cc, + supports_packets=True, + packets_have_beginning_default_clock_snapshot=True, + packets_have_end_default_clock_snapshot=True, + ) ec1 = sc.create_event_class(name='event 1') ec2 = sc.create_event_class(name='event 2') self._add_output_port('out', (tc, sc, ec1, ec2, params))