bt2: fix error message in trace_class.py
[babeltrace.git] / src / bindings / python / bt2 / bt2 / trace_class.py
index 615c410a89ba4ebc674615e9c6cd2a42c28fe42c..dc9439eb6aa424215d3ac883249699b115796852 100644 (file)
@@ -117,7 +117,7 @@ class _TraceClassConst(object._SharedObject, collections.abc.Mapping):
 
         if listener_handle._obj.addr != self.addr:
             raise ValueError(
-                'This trace class destruction listener does not match the trace object.'
+                'This trace class destruction listener does not match the trace class object.'
             )
 
         if listener_handle._listener_id is None:
@@ -190,6 +190,23 @@ class _TraceClass(_TraceClassConst):
         supports_discarded_packets=False,
         discarded_packets_have_default_clock_snapshots=False,
     ):
+        # Validate parameters before we create the object.
+        bt2_stream_class._StreamClass._validate_create_params(
+            name,
+            user_attributes,
+            packet_context_field_class,
+            event_common_context_field_class,
+            default_clock_class,
+            assigns_automatic_event_class_id,
+            assigns_automatic_stream_id,
+            supports_packets,
+            packets_have_beginning_default_clock_snapshot,
+            packets_have_end_default_clock_snapshot,
+            supports_discarded_events,
+            discarded_events_have_default_clock_snapshots,
+            supports_discarded_packets,
+            discarded_packets_have_default_clock_snapshots,
+        )
 
         if self.assigns_automatic_stream_class_id:
             if id is not None:
@@ -452,7 +469,7 @@ class _TraceClass(_TraceClassConst):
         utils._check_type(content_fc, bt2_field_class._FieldClass)
         utils._check_bool(selector_is_reversed)
         utils._check_type(selector_fc, bt2_field_class._BoolFieldClass)
-        ptr = native_bt.field_class_option_with_selector_bool_create(
+        ptr = native_bt.field_class_option_with_selector_field_bool_create(
             self._ptr, content_fc._ptr, selector_fc._ptr
         )
         self._check_field_class_create_status(ptr, 'option')
@@ -472,12 +489,12 @@ class _TraceClass(_TraceClassConst):
 
         if isinstance(selector_fc, bt2_field_class._UnsignedIntegerFieldClass):
             utils._check_type(ranges, bt2_integer_range_set.UnsignedIntegerRangeSet)
-            ptr = native_bt.field_class_option_with_selector_integer_unsigned_create(
+            ptr = native_bt.field_class_option_with_selector_field_integer_unsigned_create(
                 self._ptr, content_fc._ptr, selector_fc._ptr, ranges._ptr
             )
         else:
             utils._check_type(ranges, bt2_integer_range_set.SignedIntegerRangeSet)
-            ptr = native_bt.field_class_option_with_selector_integer_signed_create(
+            ptr = native_bt.field_class_option_with_selector_field_integer_signed_create(
                 self._ptr, content_fc._ptr, selector_fc._ptr, ranges._ptr
             )
 
This page took 0.025121 seconds and 4 git commands to generate.