Remove stale trace-ir test files
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 29 Mar 2019 23:04:50 +0000 (19:04 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 2 May 2019 04:09:19 +0000 (00:09 -0400)
These test files test things that are now pre-conditions in the library,
that used to throw exceptions.

We could in theory keep testing these cases (verify that the
precondition failure is correctly caught, when in dev mode), but we
would have to change the test strategy completely.  It's not really a
priority, so for now, just remove them.

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
tests/lib/trace-ir/test_stream_class.py [deleted file]
tests/lib/trace-ir/test_trace.py [deleted file]

diff --git a/tests/lib/trace-ir/test_stream_class.py b/tests/lib/trace-ir/test_stream_class.py
deleted file mode 100644 (file)
index 0841848..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-import unittest
-import bt2
-
-
-class StreamClassSingleClockClassTestCase(unittest.TestCase):
-    def setUp(self):
-        self._sc = bt2.StreamClass()
-
-    def tearDown(self):
-        del self._sc
-
-    def _test_add_sc_ft_vs_event_class(self, set_ft_func):
-        cc = bt2.ClockClass('first_cc', 1000)
-        scft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        scft.append_field('salut', ft)
-        set_ft_func(scft)
-        cc = bt2.ClockClass('second_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('zorg', ft)
-        ec = bt2.EventClass('ec', payload_field_type=payloadft)
-        self._sc.add_event_class(ec)
-        trace = bt2.Trace()
-
-        with self.assertRaises(bt2.Error):
-            trace.add_stream_class(self._sc)
-
-    def test_add_sc_packet_context_vs_event_class(self):
-        def func(ft):
-            self._sc.packet_context_field_type = ft
-
-        self._test_add_sc_ft_vs_event_class(func)
-
-    def test_add_sc_event_context_vs_event_class(self):
-        def func(ft):
-            self._sc.event_context_field_type = ft
-
-        self._test_add_sc_ft_vs_event_class(func)
-
-    def test_add_sc_event_header_vs_event_class(self):
-        def func(ft):
-            self._sc.event_header_field_type = ft
-
-        self._test_add_sc_ft_vs_event_class(func)
-
-    def test_add_sc_event_class_vs_event_class(self):
-        ehft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32)
-        ehft.append_field('id', ft)
-        self._sc.event_header_field_type = ehft
-        cc = bt2.ClockClass('first_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('zorg', ft)
-        ec1 = bt2.EventClass('ec', payload_field_type=payloadft)
-        cc = bt2.ClockClass('second_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('logi', ft)
-        ec2 = bt2.EventClass('ec', payload_field_type=payloadft)
-        self._sc.add_event_class(ec1)
-        self._sc.add_event_class(ec2)
-        trace = bt2.Trace()
-
-        with self.assertRaises(bt2.Error):
-            trace.add_stream_class(self._sc)
-
-    def _test_create_event_ft_vs_event_class(self, set_ft_func):
-        cc = bt2.ClockClass('first_cc', 1000)
-        scft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        scft.append_field('salut', ft)
-        set_ft_func(scft)
-        cc = bt2.ClockClass('second_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('zorg', ft)
-        ec = bt2.EventClass('ec', payload_field_type=payloadft)
-        self._sc.add_event_class(ec)
-
-        with self.assertRaises(bt2.Error):
-            ev = ec()
-
-    def test_create_event_packet_context_vs_event_class(self):
-        def func(ft):
-            self._sc.packet_context_field_type = ft
-
-        self._test_create_event_ft_vs_event_class(func)
-
-    def test_create_event_event_context_vs_event_class(self):
-        def func(ft):
-            self._sc.event_context_field_type = ft
-
-        self._test_create_event_ft_vs_event_class(func)
-
-    def test_create_event_event_header_vs_event_class(self):
-        def func(ft):
-            self._sc.event_header_field_type = ft
-
-        self._test_create_event_ft_vs_event_class(func)
-
-    def test_create_event_event_class_vs_event_class(self):
-        ehft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32)
-        ehft.append_field('id', ft)
-        self._sc.event_header_field_type = ehft
-        cc = bt2.ClockClass('first_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('zorg', ft)
-        ec1 = bt2.EventClass('ec', payload_field_type=payloadft)
-        cc = bt2.ClockClass('second_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('logi', ft)
-        ec2 = bt2.EventClass('ec', payload_field_type=payloadft)
-        self._sc.add_event_class(ec1)
-        self._sc.add_event_class(ec2)
-
-        with self.assertRaises(bt2.Error):
-            ev = ec1()
-
-    def test_add_ec_after_add_sc(self):
-        cc = bt2.ClockClass('first_cc', 1000)
-        scft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        scft.append_field('salut', ft)
-        self._sc.packet_context_field_type = scft
-        trace = bt2.Trace()
-        trace.add_stream_class(self._sc)
-        cc = bt2.ClockClass('second_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('zorg', ft)
-        ec = bt2.EventClass('ec', payload_field_type=payloadft)
-
-        with self.assertRaises(bt2.Error):
-            self._sc.add_event_class(ec)
-
-    def test_add_ec_after_add_sc_single_cc(self):
-        ehft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32)
-        ehft.append_field('id', ft)
-        self._sc.event_header_field_type = ehft
-        trace = bt2.Trace()
-        trace.add_stream_class(self._sc)
-        cc = bt2.ClockClass('first_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('zorg', ft)
-        ec = bt2.EventClass('ec', payload_field_type=payloadft)
-        self._sc.add_event_class(ec)
-        cc = bt2.ClockClass('second_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('lel', ft)
-        ec = bt2.EventClass('ec', payload_field_type=payloadft)
-
-        with self.assertRaises(bt2.Error):
-            self._sc.add_event_class(ec)
-
-    def test_add_ec_after_create_event(self):
-        ehft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32)
-        ehft.append_field('id', ft)
-        self._sc.event_header_field_type = ehft
-        cc = bt2.ClockClass('first_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('zorg', ft)
-        ec1 = bt2.EventClass('ec', payload_field_type=payloadft)
-        self._sc.add_event_class(ec1)
-        ev = ec1()
-        cc = bt2.ClockClass('second_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('logi', ft)
-        ec2 = bt2.EventClass('ec', payload_field_type=payloadft)
-
-        with self.assertRaises(bt2.Error):
-            self._sc.add_event_class(ec2)
-
-    def test_sc_clock_matches_expected_clock_class(self):
-        clock = bt2.CtfWriterClock('sc_clock')
-        self._sc.clock = clock
-        writer = bt2.CtfWriter('/tmp')
-        writer.add_clock(clock)
-        writer.trace.add_stream_class(self._sc)
-        cc = bt2.ClockClass('other_cc', 1000)
-        payloadft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        payloadft.append_field('zorg', ft)
-        ec = bt2.EventClass('ec', payload_field_type=payloadft)
-
-        with self.assertRaises(bt2.Error):
-            self._sc.add_event_class(ec)
diff --git a/tests/lib/trace-ir/test_trace.py b/tests/lib/trace-ir/test_trace.py
deleted file mode 100644 (file)
index 116f7ba..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-import unittest
-import bt2
-
-
-class TraceTestCase(unittest.TestCase):
-    def setUp(self):
-        self._trace = bt2.Trace()
-
-    def tearDown(self):
-        del self._trace
-
-    def _add_stream_class(self):
-        sc = bt2.StreamClass()
-        self._trace.add_stream_class(sc)
-
-    def test_packet_header_ft_no_clock_class_simple(self):
-        cc = bt2.ClockClass('hello', 1000)
-        phft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        phft.append_field('salut', ft)
-        self._trace.add_clock_class(cc)
-        self._trace.packet_header_field_type = phft
-
-        with self.assertRaises(bt2.Error):
-            self._add_stream_class()
-
-    def test_packet_header_ft_no_clock_class_struct(self):
-        cc = bt2.ClockClass('hello', 1000)
-        phft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        struct_ft = bt2.StructureFieldType()
-        struct_ft.append_field('salut', ft)
-        phft.append_field('boucane', struct_ft)
-        self._trace.add_clock_class(cc)
-        self._trace.packet_header_field_type = phft
-
-        with self.assertRaises(bt2.Error):
-            self._add_stream_class()
-
-    def test_packet_header_ft_no_clock_class_variant(self):
-        cc = bt2.ClockClass('hello', 1000)
-        phft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        tag_ft = bt2.EnumerationFieldType(size=32)
-        tag_ft.add_mapping('heille', 12)
-        variant_ft = bt2.VariantFieldType('tag', tag_ft)
-        variant_ft.append_field('heille', ft)
-        phft.append_field('tag', tag_ft)
-        phft.append_field('boucane', variant_ft)
-        self._trace.add_clock_class(cc)
-        self._trace.packet_header_field_type = phft
-
-        with self.assertRaises(bt2.Error):
-            self._add_stream_class()
-
-    def test_packet_header_ft_no_clock_class_array(self):
-        cc = bt2.ClockClass('hello', 1000)
-        phft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        array_ft = bt2.ArrayFieldType(ft, 23)
-        phft.append_field('boucane', array_ft)
-        self._trace.add_clock_class(cc)
-        self._trace.packet_header_field_type = phft
-
-        with self.assertRaises(bt2.Error):
-            self._add_stream_class()
-
-    def test_packet_header_ft_no_clock_class_sequence(self):
-        cc = bt2.ClockClass('hello', 1000)
-        phft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        len_ft = bt2.IntegerFieldType(32)
-        seq_ft = bt2.SequenceFieldType(ft, 'len')
-        phft.append_field('len', len_ft)
-        phft.append_field('boucane', seq_ft)
-        self._trace.add_clock_class(cc)
-        self._trace.packet_header_field_type = phft
-
-        with self.assertRaises(bt2.Error):
-            self._add_stream_class()
-
-    def test_packet_header_ft_no_clock_class_set_static(self):
-        cc = bt2.ClockClass('hello', 1000)
-        phft = bt2.StructureFieldType()
-        ft = bt2.IntegerFieldType(32, mapped_clock_class=cc)
-        phft.append_field('salut', ft)
-        self._trace.add_clock_class(cc)
-        self._trace.packet_header_field_type = phft
-
-        with self.assertRaises(bt2.Error):
-            self._trace.set_is_static()
This page took 0.053146 seconds and 5 git commands to generate.