From fabfe03472e26e997f9bfaec3fb075e6dbb029dd Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 3 Oct 2019 16:59:06 -0400 Subject: [PATCH] lib, bt2: rename "signed/unsigned sel." -> "integer signed/unsigned sel." This matches the option field class terminology and makes it possible to add other types of variant selectors in the future. Signed-off-by: Philippe Proulx Change-Id: I8b1d5b10ffb9062b09ac5ce2ef6607045cdfb5cb Reviewed-on: https://review.lttng.org/c/babeltrace/+/2123 Tested-by: jenkins Reviewed-by: Francis Deslauriers --- .../babeltrace2/trace-ir/field-class-const.h | 36 +++---- include/babeltrace2/trace-ir/field-class.h | 12 +-- include/babeltrace2/trace-ir/field-const.h | 8 +- include/babeltrace2/types.h | 4 +- src/bindings/python/bt2/bt2/__init__.py | 12 +-- src/bindings/python/bt2/bt2/field.py | 8 +- src/bindings/python/bt2/bt2/field_class.py | 94 ++++++++++--------- src/common/common.h | 8 +- src/lib/lib-logging.c | 12 +-- src/lib/trace-ir/field-class.c | 58 ++++++------ src/lib/trace-ir/field-class.h | 12 +-- src/lib/trace-ir/field.c | 20 ++-- src/lib/trace-ir/field.h | 4 +- src/lib/trace-ir/resolve-field-path.c | 24 ++--- .../ctf/common/metadata/ctf-meta-translate.c | 4 +- src/plugins/ctf/common/msg-iter/msg-iter.c | 4 +- .../fs-sink/translate-trace-ir-to-ctf-ir.c | 24 ++--- .../debug-info/trace-ir-data-copy.c | 4 +- .../trace-ir-metadata-field-class-copy.c | 40 ++++---- src/plugins/text/details/write.c | 40 ++++---- src/plugins/text/pretty/print.c | 4 +- tests/bindings/python/bt2/test_field_class.py | 6 +- tests/bindings/python/bt2/test_package.py | 24 ++--- .../trace-meta-variant-no-underscore.expect | 2 +- .../trace-meta-variant-one-underscore.expect | 2 +- ...race-meta-variant-reserved-keywords.expect | 2 +- ...e-meta-variant-same-with-underscore.expect | 2 +- .../trace-meta-variant-two-underscores.expect | 2 +- 28 files changed, 239 insertions(+), 233 deletions(-) diff --git a/include/babeltrace2/trace-ir/field-class-const.h b/include/babeltrace2/trace-ir/field-class-const.h index c1a89050..3110242d 100644 --- a/include/babeltrace2/trace-ir/field-class-const.h +++ b/include/babeltrace2/trace-ir/field-class-const.h @@ -54,8 +54,8 @@ typedef enum bt_field_class_type { BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR = 14, BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR = 15, BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR = 16, - BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR = 17, - BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR = 18, + BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR = 17, + BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR = 18, } bt_field_class_type; typedef enum bt_field_class_integer_preferred_display_base { @@ -207,20 +207,20 @@ extern const bt_field_class_variant_option * bt_field_class_variant_borrow_option_by_name_const( const bt_field_class *field_class, const char *name); -extern const bt_field_class_variant_with_selector_unsigned_option * -bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( +extern const bt_field_class_variant_with_selector_integer_unsigned_option * +bt_field_class_variant_with_selector_integer_unsigned_borrow_option_by_index_const( const bt_field_class *field_class, uint64_t index); -extern const bt_field_class_variant_with_selector_unsigned_option * -bt_field_class_variant_with_selector_unsigned_borrow_option_by_name_const( +extern const bt_field_class_variant_with_selector_integer_unsigned_option * +bt_field_class_variant_with_selector_integer_unsigned_borrow_option_by_name_const( const bt_field_class *field_class, const char *name); -extern const bt_field_class_variant_with_selector_signed_option * -bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( +extern const bt_field_class_variant_with_selector_integer_signed_option * +bt_field_class_variant_with_selector_integer_signed_borrow_option_by_index_const( const bt_field_class *field_class, uint64_t index); -extern const bt_field_class_variant_with_selector_signed_option * -bt_field_class_variant_with_selector_signed_borrow_option_by_name_const( +extern const bt_field_class_variant_with_selector_integer_signed_option * +bt_field_class_variant_with_selector_integer_signed_borrow_option_by_name_const( const bt_field_class *field_class, const char *name); extern const char *bt_field_class_variant_option_get_name( @@ -238,25 +238,25 @@ bt_field_class_variant_with_selector_borrow_selector_field_path_const( const bt_field_class *field_class); extern const bt_integer_range_set_unsigned * -bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( - const bt_field_class_variant_with_selector_unsigned_option *option); +bt_field_class_variant_with_selector_integer_unsigned_option_borrow_ranges_const( + const bt_field_class_variant_with_selector_integer_unsigned_option *option); static inline const bt_field_class_variant_option * -bt_field_class_variant_with_selector_unsigned_option_as_option_const( - const bt_field_class_variant_with_selector_unsigned_option *option) +bt_field_class_variant_with_selector_integer_unsigned_option_as_option_const( + const bt_field_class_variant_with_selector_integer_unsigned_option *option) { return __BT_UPCAST_CONST(bt_field_class_variant_option, option); } extern const bt_integer_range_set_signed * -bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( - const bt_field_class_variant_with_selector_signed_option *option); +bt_field_class_variant_with_selector_integer_signed_option_borrow_ranges_const( + const bt_field_class_variant_with_selector_integer_signed_option *option); static inline const bt_field_class_variant_option * -bt_field_class_variant_with_selector_signed_option_as_option_const( - const bt_field_class_variant_with_selector_signed_option *option) +bt_field_class_variant_with_selector_integer_signed_option_as_option_const( + const bt_field_class_variant_with_selector_integer_signed_option *option) { return __BT_UPCAST_CONST(bt_field_class_variant_option, option); } diff --git a/include/babeltrace2/trace-ir/field-class.h b/include/babeltrace2/trace-ir/field-class.h index e6711b4a..79459a76 100644 --- a/include/babeltrace2/trace-ir/field-class.h +++ b/include/babeltrace2/trace-ir/field-class.h @@ -179,19 +179,19 @@ bt_field_class_variant_without_selector_append_option( bt_field_class *var_field_class, const char *name, bt_field_class *field_class); -typedef enum bt_field_class_variant_with_selector_append_option_status { +typedef enum bt_field_class_variant_with_selector_integer_append_option_status { BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_OK = __BT_FUNC_STATUS_OK, -} bt_field_class_variant_with_selector_append_option_status; +} bt_field_class_variant_with_selector_integer_append_option_status; -extern bt_field_class_variant_with_selector_append_option_status -bt_field_class_variant_with_selector_unsigned_append_option( +extern bt_field_class_variant_with_selector_integer_append_option_status +bt_field_class_variant_with_selector_integer_unsigned_append_option( bt_field_class *var_field_class, const char *name, bt_field_class *field_class, const bt_integer_range_set_unsigned *range_set); -extern bt_field_class_variant_with_selector_append_option_status -bt_field_class_variant_with_selector_signed_append_option( +extern bt_field_class_variant_with_selector_integer_append_option_status +bt_field_class_variant_with_selector_integer_signed_append_option( bt_field_class *var_field_class, const char *name, bt_field_class *field_class, const bt_integer_range_set_signed *range_set); diff --git a/include/babeltrace2/trace-ir/field-const.h b/include/babeltrace2/trace-ir/field-const.h index a3902ce2..bb1d8fc5 100644 --- a/include/babeltrace2/trace-ir/field-const.h +++ b/include/babeltrace2/trace-ir/field-const.h @@ -103,12 +103,12 @@ extern const bt_field_class_variant_option * bt_field_variant_borrow_selected_class_option_const( const bt_field *field); -extern const bt_field_class_variant_with_selector_unsigned_option * -bt_field_variant_with_unsigned_selector_borrow_selected_class_option_const( +extern const bt_field_class_variant_with_selector_integer_unsigned_option * +bt_field_variant_with_unsigned_integer_selector_borrow_selected_class_option_const( const bt_field *field); -extern const bt_field_class_variant_with_selector_signed_option * -bt_field_variant_with_signed_selector_borrow_selected_class_option_const( +extern const bt_field_class_variant_with_selector_integer_signed_option * +bt_field_variant_with_signed_integer_selector_borrow_selected_class_option_const( const bt_field *field); #ifdef __cplusplus diff --git a/include/babeltrace2/types.h b/include/babeltrace2/types.h index fe74a81a..ecd6d59e 100644 --- a/include/babeltrace2/types.h +++ b/include/babeltrace2/types.h @@ -106,8 +106,8 @@ typedef struct bt_field_class_enumeration_signed_mapping bt_field_class_enumerat typedef struct bt_field_class_enumeration_unsigned_mapping bt_field_class_enumeration_unsigned_mapping; typedef struct bt_field_class_structure_member bt_field_class_structure_member; typedef struct bt_field_class_variant_option bt_field_class_variant_option; -typedef struct bt_field_class_variant_with_selector_signed_option bt_field_class_variant_with_selector_signed_option; -typedef struct bt_field_class_variant_with_selector_unsigned_option bt_field_class_variant_with_selector_unsigned_option; +typedef struct bt_field_class_variant_with_selector_integer_signed_option bt_field_class_variant_with_selector_integer_signed_option; +typedef struct bt_field_class_variant_with_selector_integer_unsigned_option bt_field_class_variant_with_selector_integer_unsigned_option; typedef struct bt_field_path bt_field_path; typedef struct bt_field_path_item bt_field_path_item; typedef struct bt_graph bt_graph; diff --git a/src/bindings/python/bt2/bt2/__init__.py b/src/bindings/python/bt2/bt2/__init__.py index 4310f469..0b7beefa 100644 --- a/src/bindings/python/bt2/bt2/__init__.py +++ b/src/bindings/python/bt2/bt2/__init__.py @@ -99,9 +99,9 @@ from bt2.field_class import _OptionWithUnsignedIntegerSelectorFieldClass from bt2.field_class import _OptionWithSignedIntegerSelectorFieldClass from bt2.field_class import _VariantFieldClass from bt2.field_class import _VariantFieldClassWithoutSelector -from bt2.field_class import _VariantFieldClassWithSelector -from bt2.field_class import _VariantFieldClassWithUnsignedSelector -from bt2.field_class import _VariantFieldClassWithSignedSelector +from bt2.field_class import _VariantFieldClassWithIntegerSelector +from bt2.field_class import _VariantFieldClassWithUnsignedIntegerSelector +from bt2.field_class import _VariantFieldClassWithSignedIntegerSelector from bt2.field_class import _ArrayFieldClass from bt2.field_class import _StaticArrayFieldClass from bt2.field_class import _DynamicArrayFieldClass @@ -124,9 +124,9 @@ from bt2.field_class import _OptionWithUnsignedIntegerSelectorFieldClassConst from bt2.field_class import _OptionWithSignedIntegerSelectorFieldClassConst from bt2.field_class import _VariantFieldClassConst from bt2.field_class import _VariantFieldClassWithoutSelectorConst -from bt2.field_class import _VariantFieldClassWithSelectorConst -from bt2.field_class import _VariantFieldClassWithUnsignedSelectorConst -from bt2.field_class import _VariantFieldClassWithSignedSelectorConst +from bt2.field_class import _VariantFieldClassWithIntegerSelectorConst +from bt2.field_class import _VariantFieldClassWithUnsignedIntegerSelectorConst +from bt2.field_class import _VariantFieldClassWithSignedIntegerSelectorConst from bt2.field_class import _ArrayFieldClassConst from bt2.field_class import _StaticArrayFieldClassConst from bt2.field_class import _DynamicArrayFieldClassConst diff --git a/src/bindings/python/bt2/bt2/field.py b/src/bindings/python/bt2/bt2/field.py index 83409b1b..f1a632f3 100644 --- a/src/bindings/python/bt2/bt2/field.py +++ b/src/bindings/python/bt2/bt2/field.py @@ -940,8 +940,8 @@ _TYPE_ID_TO_CONST_OBJ = { native_bt.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR: _OptionFieldConst, native_bt.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR: _OptionFieldConst, native_bt.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: _VariantFieldConst, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: _VariantFieldConst, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: _VariantFieldConst, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: _VariantFieldConst, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: _VariantFieldConst, } _TYPE_ID_TO_OBJ = { @@ -962,6 +962,6 @@ _TYPE_ID_TO_OBJ = { native_bt.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR: _OptionField, native_bt.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR: _OptionField, native_bt.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: _VariantField, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: _VariantField, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: _VariantField, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: _VariantField, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: _VariantField, } diff --git a/src/bindings/python/bt2/bt2/field_class.py b/src/bindings/python/bt2/bt2/field_class.py index 4268bbf7..121a73c5 100644 --- a/src/bindings/python/bt2/bt2/field_class.py +++ b/src/bindings/python/bt2/bt2/field_class.py @@ -679,7 +679,7 @@ class _VariantFieldClassOption(_VariantFieldClassOptionConst): _user_attributes = property(fset=_user_attributes) -class _VariantFieldClassWithSelectorOptionConst(_VariantFieldClassOptionConst): +class _VariantFieldClassWithIntegerSelectorOptionConst(_VariantFieldClassOptionConst): def __init__(self, owning_var_fc, spec_opt_ptr): self._spec_ptr = spec_opt_ptr super().__init__(owning_var_fc, self._as_option_ptr(spec_opt_ptr)) @@ -691,46 +691,46 @@ class _VariantFieldClassWithSelectorOptionConst(_VariantFieldClassOptionConst): return self._range_set_pycls._create_from_ptr_and_get_ref(range_set_ptr) -class _VariantFieldClassWithSelectorOption( - _VariantFieldClassWithSelectorOptionConst, _VariantFieldClassOption +class _VariantFieldClassWithIntegerSelectorOption( + _VariantFieldClassWithIntegerSelectorOptionConst, _VariantFieldClassOption ): pass -class _VariantFieldClassWithSignedSelectorOptionConst( - _VariantFieldClassWithSelectorOptionConst +class _VariantFieldClassWithSignedIntegerSelectorOptionConst( + _VariantFieldClassWithIntegerSelectorOptionConst ): _as_option_ptr = staticmethod( - native_bt.field_class_variant_with_selector_signed_option_as_option_const + native_bt.field_class_variant_with_selector_integer_signed_option_as_option_const ) _borrow_ranges_ptr = staticmethod( - native_bt.field_class_variant_with_selector_signed_option_borrow_ranges_const + native_bt.field_class_variant_with_selector_integer_signed_option_borrow_ranges_const ) _range_set_pycls = bt2_integer_range_set._SignedIntegerRangeSetConst -class _VariantFieldClassWithSignedSelectorOption( - _VariantFieldClassWithSignedSelectorOptionConst, - _VariantFieldClassWithSelectorOption, +class _VariantFieldClassWithSignedIntegerSelectorOption( + _VariantFieldClassWithSignedIntegerSelectorOptionConst, + _VariantFieldClassWithIntegerSelectorOption, ): pass -class _VariantFieldClassWithUnsignedSelectorOptionConst( - _VariantFieldClassWithSelectorOptionConst +class _VariantFieldClassWithUnsignedIntegerSelectorOptionConst( + _VariantFieldClassWithIntegerSelectorOptionConst ): _as_option_ptr = staticmethod( - native_bt.field_class_variant_with_selector_unsigned_option_as_option_const + native_bt.field_class_variant_with_selector_integer_unsigned_option_as_option_const ) _borrow_ranges_ptr = staticmethod( - native_bt.field_class_variant_with_selector_unsigned_option_borrow_ranges_const + native_bt.field_class_variant_with_selector_integer_unsigned_option_borrow_ranges_const ) _range_set_pycls = bt2_integer_range_set._UnsignedIntegerRangeSetConst -class _VariantFieldClassWithUnsignedSelectorOption( - _VariantFieldClassWithUnsignedSelectorOptionConst, - _VariantFieldClassWithSelectorOption, +class _VariantFieldClassWithUnsignedIntegerSelectorOption( + _VariantFieldClassWithUnsignedIntegerSelectorOptionConst, + _VariantFieldClassWithIntegerSelectorOption, ): pass @@ -838,7 +838,7 @@ class _VariantFieldClassWithoutSelector( return self -class _VariantFieldClassWithSelectorConst(_VariantFieldClassConst): +class _VariantFieldClassWithIntegerSelectorConst(_VariantFieldClassConst): _NAME = 'Const Variant (with selector)' @property @@ -853,8 +853,8 @@ class _VariantFieldClassWithSelectorConst(_VariantFieldClassConst): return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr) -class _VariantFieldClassWithSelector( - _VariantFieldClassWithSelectorConst, _VariantFieldClass +class _VariantFieldClassWithIntegerSelector( + _VariantFieldClassWithIntegerSelectorConst, _VariantFieldClass ): _NAME = 'Variant (with selector)' @@ -892,49 +892,55 @@ class _VariantFieldClassWithSelector( return self -class _VariantFieldClassWithUnsignedSelectorConst(_VariantFieldClassWithSelectorConst): - _NAME = 'Const Variant (with unsigned selector)' +class _VariantFieldClassWithUnsignedIntegerSelectorConst( + _VariantFieldClassWithIntegerSelectorConst +): + _NAME = 'Const Variant (with unsigned integer selector)' _borrow_option_ptr_by_name = staticmethod( - native_bt.field_class_variant_with_selector_unsigned_borrow_option_by_name_const + native_bt.field_class_variant_with_selector_integer_unsigned_borrow_option_by_name_const ) _borrow_option_ptr_by_index = staticmethod( - native_bt.field_class_variant_with_selector_unsigned_borrow_option_by_index_const + native_bt.field_class_variant_with_selector_integer_unsigned_borrow_option_by_index_const ) - _variant_option_pycls = _VariantFieldClassWithUnsignedSelectorOptionConst + _variant_option_pycls = _VariantFieldClassWithUnsignedIntegerSelectorOptionConst _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr) -class _VariantFieldClassWithUnsignedSelector( - _VariantFieldClassWithUnsignedSelectorConst, _VariantFieldClassWithSelector +class _VariantFieldClassWithUnsignedIntegerSelector( + _VariantFieldClassWithUnsignedIntegerSelectorConst, + _VariantFieldClassWithIntegerSelector, ): - _NAME = 'Variant (with unsigned selector)' - _variant_option_pycls = _VariantFieldClassWithUnsignedSelectorOption + _NAME = 'Variant (with unsigned integer selector)' + _variant_option_pycls = _VariantFieldClassWithUnsignedIntegerSelectorOption _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr) _append_option = staticmethod( - native_bt.field_class_variant_with_selector_unsigned_append_option + native_bt.field_class_variant_with_selector_integer_unsigned_append_option ) -class _VariantFieldClassWithSignedSelectorConst(_VariantFieldClassWithSelectorConst): - _NAME = 'Const Variant (with signed selector)' +class _VariantFieldClassWithSignedIntegerSelectorConst( + _VariantFieldClassWithIntegerSelectorConst +): + _NAME = 'Const Variant (with signed integer selector)' _borrow_option_ptr_by_name = staticmethod( - native_bt.field_class_variant_with_selector_signed_borrow_option_by_name_const + native_bt.field_class_variant_with_selector_integer_signed_borrow_option_by_name_const ) _borrow_option_ptr_by_index = staticmethod( - native_bt.field_class_variant_with_selector_signed_borrow_option_by_index_const + native_bt.field_class_variant_with_selector_integer_signed_borrow_option_by_index_const ) - _variant_option_pycls = _VariantFieldClassWithSignedSelectorOptionConst + _variant_option_pycls = _VariantFieldClassWithSignedIntegerSelectorOptionConst _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr) -class _VariantFieldClassWithSignedSelector( - _VariantFieldClassWithSignedSelectorConst, _VariantFieldClassWithSelector +class _VariantFieldClassWithSignedIntegerSelector( + _VariantFieldClassWithSignedIntegerSelectorConst, + _VariantFieldClassWithIntegerSelector, ): - _NAME = 'Variant (with signed selector)' - _variant_option_pycls = _VariantFieldClassWithSignedSelectorOption + _NAME = 'Variant (with signed integer selector)' + _variant_option_pycls = _VariantFieldClassWithSignedIntegerSelectorOption _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr) _append_option = staticmethod( - native_bt.field_class_variant_with_selector_signed_append_option + native_bt.field_class_variant_with_selector_integer_signed_append_option ) @@ -1009,8 +1015,8 @@ _FIELD_CLASS_TYPE_TO_CONST_OBJ = { native_bt.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR: _OptionWithUnsignedIntegerSelectorFieldClassConst, native_bt.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR: _OptionWithSignedIntegerSelectorFieldClassConst, native_bt.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: _VariantFieldClassWithoutSelectorConst, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: _VariantFieldClassWithUnsignedSelectorConst, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: _VariantFieldClassWithSignedSelectorConst, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: _VariantFieldClassWithUnsignedIntegerSelectorConst, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: _VariantFieldClassWithSignedIntegerSelectorConst, } _FIELD_CLASS_TYPE_TO_OBJ = { @@ -1031,6 +1037,6 @@ _FIELD_CLASS_TYPE_TO_OBJ = { native_bt.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR: _OptionWithUnsignedIntegerSelectorFieldClass, native_bt.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR: _OptionWithSignedIntegerSelectorFieldClass, native_bt.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: _VariantFieldClassWithoutSelector, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: _VariantFieldClassWithUnsignedSelector, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: _VariantFieldClassWithSignedSelector, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: _VariantFieldClassWithUnsignedIntegerSelector, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: _VariantFieldClassWithSignedIntegerSelector, } diff --git a/src/common/common.h b/src/common/common.h index dae93f52..dead8792 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -451,10 +451,10 @@ const char *bt_common_field_class_type_string(enum bt_field_class_type class_typ return "OPTION_WITH_SIGNED_INTEGER_SELECTOR"; case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: return "VARIANT_WITHOUT_SELECTOR"; - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - return "VARIANT_WITH_UNSIGNED_SELECTOR"; - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: - return "VARIANT_WITH_SIGNED_SELECTOR"; + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + return "VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR"; + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: + return "VARIANT_WITH_SIGNED_INTEGER_SELECTOR"; default: return "(unknown)"; } diff --git a/src/lib/lib-logging.c b/src/lib/lib-logging.c index dc0c97c5..51682ed8 100644 --- a/src/lib/lib-logging.c +++ b/src/lib/lib-logging.c @@ -293,8 +293,8 @@ static inline void format_field_class(char **buf_ch, bool extended, break; } case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { const struct bt_field_class_variant *var_fc = (const void *) field_class; @@ -304,8 +304,8 @@ static inline void format_field_class(char **buf_ch, bool extended, PRFIELD(var_fc->common.named_fcs->len)); } - if (field_class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR || - field_class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) { + if (field_class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR || + field_class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) { const struct bt_field_class_variant_with_selector *var_with_sel_fc = (const void *) var_fc; @@ -442,8 +442,8 @@ static inline void format_field(char **buf_ch, bool extended, break; } case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { const struct bt_field_variant *var_field = (const void *) field; diff --git a/src/lib/trace-ir/field-class.c b/src/lib/trace-ir/field-class.c index 90f60340..29368750 100644 --- a/src/lib/trace-ir/field-class.c +++ b/src/lib/trace-ir/field-class.c @@ -1480,9 +1480,9 @@ struct bt_field_class *bt_field_class_variant_create( if (selector_fc->type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER || selector_fc->type == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION) { - fc_type = BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR; + fc_type = BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR; } else { - fc_type = BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR; + fc_type = BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR; } ret = init_named_field_classes_container( @@ -1666,7 +1666,7 @@ int append_option_to_variant_with_selector_field_class( BT_ASSERT_PRE(range_set->ranges->len > 0, "Integer range set is empty: %!+R", range_set); status = ranges_overlap(var_fc->common.common.named_fcs, range_set, - expected_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR, + expected_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR, &has_overlap); if (status) { /* ranges_overlap() logs errors */ @@ -1698,26 +1698,26 @@ end: return status; } -enum bt_field_class_variant_with_selector_append_option_status -bt_field_class_variant_with_selector_unsigned_append_option( +enum bt_field_class_variant_with_selector_integer_append_option_status +bt_field_class_variant_with_selector_integer_unsigned_append_option( struct bt_field_class *fc, const char *name, struct bt_field_class *option_fc, const struct bt_integer_range_set_unsigned *range_set) { return append_option_to_variant_with_selector_field_class(fc, name, option_fc, (const void *) range_set, - BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR); + BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR); } -enum bt_field_class_variant_with_selector_append_option_status -bt_field_class_variant_with_selector_signed_append_option( +enum bt_field_class_variant_with_selector_integer_append_option_status +bt_field_class_variant_with_selector_integer_signed_append_option( struct bt_field_class *fc, const char *name, struct bt_field_class *option_fc, const struct bt_integer_range_set_signed *range_set) { return append_option_to_variant_with_selector_field_class(fc, name, option_fc, (const void *) range_set, - BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR); + BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR); } uint64_t bt_field_class_variant_get_option_count(const struct bt_field_class *fc) @@ -1773,52 +1773,52 @@ bt_field_class_variant_borrow_option_by_index( (void *) fc, index); } -const struct bt_field_class_variant_with_selector_unsigned_option * -bt_field_class_variant_with_selector_unsigned_borrow_option_by_name_const( +const struct bt_field_class_variant_with_selector_integer_unsigned_option * +bt_field_class_variant_with_selector_integer_unsigned_borrow_option_by_name_const( const struct bt_field_class *fc, const char *name) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, - BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR, + BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR, "Field class"); return (const void *) borrow_named_field_class_from_container_field_class_by_name( (void *) fc, name); } -const struct bt_field_class_variant_with_selector_unsigned_option * -bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( +const struct bt_field_class_variant_with_selector_integer_unsigned_option * +bt_field_class_variant_with_selector_integer_unsigned_borrow_option_by_index_const( const struct bt_field_class *fc, uint64_t index) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, - BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR, + BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR, "Field class"); return (const void *) borrow_named_field_class_from_container_field_class_at_index( (void *) fc, index); } -const struct bt_field_class_variant_with_selector_signed_option * -bt_field_class_variant_with_selector_signed_borrow_option_by_name_const( +const struct bt_field_class_variant_with_selector_integer_signed_option * +bt_field_class_variant_with_selector_integer_signed_borrow_option_by_name_const( const struct bt_field_class *fc, const char *name) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, - BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR, + BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR, "Field class"); return (const void *) borrow_named_field_class_from_container_field_class_by_name( (void *) fc, name); } -const struct bt_field_class_variant_with_selector_signed_option * -bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( +const struct bt_field_class_variant_with_selector_integer_signed_option * +bt_field_class_variant_with_selector_integer_signed_borrow_option_by_index_const( const struct bt_field_class *fc, uint64_t index) { BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class"); BT_ASSERT_PRE_DEV_FC_HAS_ID(fc, - BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR, + BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR, "Field class"); return (const void *) borrow_named_field_class_from_container_field_class_at_index( @@ -1855,8 +1855,8 @@ bt_field_class_variant_option_borrow_field_class( } const struct bt_integer_range_set_unsigned * -bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( - const struct bt_field_class_variant_with_selector_unsigned_option *option) +bt_field_class_variant_with_selector_integer_unsigned_option_borrow_ranges_const( + const struct bt_field_class_variant_with_selector_integer_unsigned_option *option) { const struct bt_field_class_variant_with_selector_option *opt = (const void *) option; @@ -1866,8 +1866,8 @@ bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( } const struct bt_integer_range_set_signed * -bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( - const struct bt_field_class_variant_with_selector_signed_option *option) +bt_field_class_variant_with_selector_integer_signed_option_borrow_ranges_const( + const struct bt_field_class_variant_with_selector_integer_signed_option *option) { const struct bt_field_class_variant_with_selector_option *opt = (const void *) option; @@ -2112,8 +2112,8 @@ void _bt_field_class_freeze(const struct bt_field_class *c_fc) switch (fc->type) { case BT_FIELD_CLASS_TYPE_STRUCTURE: case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { struct bt_field_class_named_field_class_container *container_fc = (void *) fc; @@ -2155,8 +2155,8 @@ void bt_field_class_make_part_of_trace_class(const struct bt_field_class *c_fc) switch (fc->type) { case BT_FIELD_CLASS_TYPE_STRUCTURE: case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { struct bt_field_class_named_field_class_container *container_fc = (void *) fc; diff --git a/src/lib/trace-ir/field-class.h b/src/lib/trace-ir/field-class.h index fa970d43..3df7b9aa 100644 --- a/src/lib/trace-ir/field-class.h +++ b/src/lib/trace-ir/field-class.h @@ -98,15 +98,15 @@ #define _BT_ASSERT_PRE_FC_IS_VARIANT_COND(_fc) \ (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR || \ + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) #define _BT_ASSERT_PRE_FC_IS_VARIANT_FMT(_name) \ _name " is not a variant field class: %![fc-]+F" #define _BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_COND(_fc) \ - (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) + (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR || \ + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) #define _BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_FMT(_name) \ _name " is not a variant field class with a selector: %![fc-]+F" @@ -313,8 +313,8 @@ struct bt_named_field_class { struct bt_field_class_structure_member; struct bt_field_class_variant_option; -struct bt_field_class_variant_with_selector_unsigned_option; -struct bt_field_class_variant_with_selector_signed_option; +struct bt_field_class_variant_with_selector_integer_unsigned_option; +struct bt_field_class_variant_with_selector_integer_signed_option; struct bt_field_class_named_field_class_container { struct bt_field_class common; diff --git a/src/lib/trace-ir/field.c b/src/lib/trace-ir/field.c index 7c0c2d32..f1d31ea9 100644 --- a/src/lib/trace-ir/field.c +++ b/src/lib/trace-ir/field.c @@ -194,8 +194,8 @@ struct bt_field *(* const field_create_funcs[])(struct bt_field_class *) = { [BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR] = create_option_field, [BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR] = create_option_field, [BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR] = create_variant_field, - [BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR] = create_variant_field, - [BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR] = create_variant_field, + [BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR] = create_variant_field, + [BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR] = create_variant_field, }; static @@ -244,8 +244,8 @@ void (* const field_destroy_funcs[])(struct bt_field *) = { [BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR] = destroy_option_field, [BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR] = destroy_option_field, [BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR] = destroy_variant_field, - [BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR] = destroy_variant_field, - [BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR] = destroy_variant_field, + [BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR] = destroy_variant_field, + [BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR] = destroy_variant_field, }; struct bt_field_class *bt_field_borrow_class(struct bt_field *field) @@ -1139,23 +1139,23 @@ bt_field_variant_borrow_selected_class_option_const( return borrow_variant_field_selected_class_option(field); } -const struct bt_field_class_variant_with_selector_unsigned_option * -bt_field_variant_with_unsigned_selector_borrow_selected_class_option_const( +const struct bt_field_class_variant_with_selector_integer_unsigned_option * +bt_field_variant_with_unsigned_integer_selector_borrow_selected_class_option_const( const struct bt_field *field) { BT_ASSERT_PRE_DEV_NON_NULL(field, "Field"); BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, - BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR, "Field"); + BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR, "Field"); return (const void *) borrow_variant_field_selected_class_option(field); } -const struct bt_field_class_variant_with_selector_signed_option * -bt_field_variant_with_signed_selector_borrow_selected_class_option_const( +const struct bt_field_class_variant_with_selector_integer_signed_option * +bt_field_variant_with_signed_integer_selector_borrow_selected_class_option_const( const struct bt_field *field) { BT_ASSERT_PRE_DEV_NON_NULL(field, "Field"); BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(field, - BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR, "Field"); + BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR, "Field"); return (const void *) borrow_variant_field_selected_class_option(field); } diff --git a/src/lib/trace-ir/field.h b/src/lib/trace-ir/field.h index 7bc83b3d..d6fe2bce 100644 --- a/src/lib/trace-ir/field.h +++ b/src/lib/trace-ir/field.h @@ -75,8 +75,8 @@ #define BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(_field, _name) \ BT_ASSERT_PRE_DEV( \ ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR || \ - ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR || \ - ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR, \ + ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR || \ + ((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR, \ _name " is not a variant field: %![field-]+f", (_field)) #define BT_ASSERT_PRE_DEV_FIELD_IS_SET(_field, _name) \ diff --git a/src/lib/trace-ir/resolve-field-path.c b/src/lib/trace-ir/resolve-field-path.c index c8cd6703..47da3986 100644 --- a/src/lib/trace-ir/resolve-field-path.c +++ b/src/lib/trace-ir/resolve-field-path.c @@ -70,8 +70,8 @@ bool find_field_class_recursive(struct bt_field_class *fc, } case BT_FIELD_CLASS_TYPE_STRUCTURE: case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { struct bt_field_class_named_field_class_container *container_fc = (void *) fc; @@ -276,8 +276,8 @@ struct bt_field_class *borrow_child_field_class( } case BT_FIELD_CLASS_TYPE_STRUCTURE: case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { struct bt_field_class_named_field_class_container *container_fc = (void *) parent_fc; @@ -334,8 +334,8 @@ bool target_field_path_in_different_scope_has_struct_fc_only( fc->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR || fc->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR || fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR || - fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR || - fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) { + fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR || + fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) { is_valid = false; goto end; } @@ -457,8 +457,8 @@ bool lca_to_target_has_struct_fc_only(struct bt_field_path *src_field_path, tgt_fc->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR || tgt_fc->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR || tgt_fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR || - tgt_fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR || - tgt_fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) { + tgt_fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR || + tgt_fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) { is_valid = false; goto end; } @@ -602,8 +602,8 @@ int bt_resolve_field_paths(struct bt_field_class *fc, break; } - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { struct bt_field_class_variant_with_selector *var_fc = (void *) fc; @@ -637,8 +637,8 @@ int bt_resolve_field_paths(struct bt_field_class *fc, } case BT_FIELD_CLASS_TYPE_STRUCTURE: case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { struct bt_field_class_named_field_class_container *container_fc = (void *) fc; diff --git a/src/plugins/ctf/common/metadata/ctf-meta-translate.c b/src/plugins/ctf/common/metadata/ctf-meta-translate.c index b7f2cbdb..27611bc6 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-translate.c +++ b/src/plugins/ctf/common/metadata/ctf-meta-translate.c @@ -302,7 +302,7 @@ bt_field_class *ctf_field_class_variant_to_ir(struct ctx *ctx, bt_field_class_enumeration_signed_mapping_borrow_ranges_const( mapping); BT_ASSERT(range_set); - ret = bt_field_class_variant_with_selector_signed_append_option( + ret = bt_field_class_variant_with_selector_integer_signed_append_option( ir_fc, named_fc->name->str, option_ir_fc, range_set); } else { @@ -318,7 +318,7 @@ bt_field_class *ctf_field_class_variant_to_ir(struct ctx *ctx, bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( mapping); BT_ASSERT(range_set); - ret = bt_field_class_variant_with_selector_unsigned_append_option( + ret = bt_field_class_variant_with_selector_integer_unsigned_append_option( ir_fc, named_fc->name->str, option_ir_fc, range_set); } diff --git a/src/plugins/ctf/common/msg-iter/msg-iter.c b/src/plugins/ctf/common/msg-iter/msg-iter.c index dd350c75..fa2e8f36 100644 --- a/src/plugins/ctf/common/msg-iter/msg-iter.c +++ b/src/plugins/ctf/common/msg-iter/msg-iter.c @@ -1863,8 +1863,8 @@ bt_field *borrow_next_field(struct bt_msg_iter *notit) base_field, index); break; case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: BT_ASSERT(index == 0); next_field = bt_field_variant_borrow_selected_option_field( base_field); diff --git a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c index 1b0e8e7a..f2a2c717 100644 --- a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c +++ b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c @@ -833,26 +833,26 @@ int maybe_protect_variant_option_name(const bt_field_class *ir_var_fc, if (ir_var_fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR) { /* No ranges: we're done */ goto end; - } if (ir_var_fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR) { - const bt_field_class_variant_with_selector_unsigned_option *var_opt = - bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( + } if (ir_var_fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR) { + const bt_field_class_variant_with_selector_integer_unsigned_option *var_opt = + bt_field_class_variant_with_selector_integer_unsigned_borrow_option_by_index_const( ir_var_fc, opt_i); opt_ranges = - bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( + bt_field_class_variant_with_selector_integer_unsigned_option_borrow_ranges_const( var_opt); } else { - const bt_field_class_variant_with_selector_signed_option *var_opt = - bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( + const bt_field_class_variant_with_selector_integer_signed_option *var_opt = + bt_field_class_variant_with_selector_integer_signed_borrow_option_by_index_const( ir_var_fc, opt_i); opt_ranges = - bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( + bt_field_class_variant_with_selector_integer_signed_option_borrow_ranges_const( var_opt); } /* Find corresponding mapping by range set in selector FC */ for (i = 0; i < bt_field_class_enumeration_get_mapping_count(ir_tag_fc); i++) { - if (ir_var_fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR) { + if (ir_var_fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR) { const bt_field_class_enumeration_mapping *mapping_base; const bt_field_class_enumeration_unsigned_mapping *mapping; const bt_integer_range_set_unsigned *mapping_ranges; @@ -999,8 +999,8 @@ int translate_variant_field_class(struct ctx *ctx) ir_fc_type = bt_field_class_get_type(fc->base.ir_fc); opt_count = bt_field_class_variant_get_option_count(fc->base.ir_fc); - if (ir_fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR || - ir_fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) { + if (ir_fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR || + ir_fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) { ir_selector_field_path = bt_field_class_variant_with_selector_borrow_selector_field_path_const( fc->base.ir_fc); BT_ASSERT(ir_selector_field_path); @@ -1341,8 +1341,8 @@ int translate_field_class(struct ctx *ctx) ret = translate_option_field_class(ctx); break; case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: ret = translate_variant_field_class(ctx); break; default: diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c b/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c index f17f8501..d908e96b 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c +++ b/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c @@ -368,8 +368,8 @@ void copy_field_content(const bt_field *in_field, bt_field *out_field, break; } case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { bt_field_variant_select_option_field_by_index_status sel_opt_status; uint64_t in_selected_option_idx; diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c index c7680c8d..1face29d 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c +++ b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c @@ -86,8 +86,8 @@ const bt_field_class *walk_field_path(struct trace_ir_metadata_maps *md_maps, break; } case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { const bt_field_class_variant_option *option; @@ -479,36 +479,36 @@ int field_class_variant_copy( goto error; } - if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR) { - const bt_field_class_variant_with_selector_unsigned_option *spec_opt = - bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( + if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR) { + const bt_field_class_variant_with_selector_integer_unsigned_option *spec_opt = + bt_field_class_variant_with_selector_integer_unsigned_borrow_option_by_index_const( in_field_class, i); const bt_integer_range_set_unsigned *ranges = - bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( + bt_field_class_variant_with_selector_integer_unsigned_option_borrow_ranges_const( spec_opt); - if (bt_field_class_variant_with_selector_unsigned_append_option( + if (bt_field_class_variant_with_selector_integer_unsigned_append_option( out_field_class, option_name, out_option_field_class, ranges) != BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_OK) { - BT_COMP_LOGE_STR("Cannot append option to variant field class with unsigned selector'"); + BT_COMP_LOGE_STR("Cannot append option to variant field class with unsigned integer selector'"); BT_FIELD_CLASS_PUT_REF_AND_RESET(out_tag_field_class); ret = -1; goto error; } - } else if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) { - const bt_field_class_variant_with_selector_signed_option *spec_opt = - bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( + } else if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) { + const bt_field_class_variant_with_selector_integer_signed_option *spec_opt = + bt_field_class_variant_with_selector_integer_signed_borrow_option_by_index_const( in_field_class, i); const bt_integer_range_set_signed *ranges = - bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( + bt_field_class_variant_with_selector_integer_signed_option_borrow_ranges_const( spec_opt); - if (bt_field_class_variant_with_selector_signed_append_option( + if (bt_field_class_variant_with_selector_integer_signed_append_option( out_field_class, option_name, out_option_field_class, ranges) != BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_OK) { - BT_COMP_LOGE_STR("Cannot append option to variant field class with signed selector'"); + BT_COMP_LOGE_STR("Cannot append option to variant field class with signed integer selector'"); BT_FIELD_CLASS_PUT_REF_AND_RESET(out_tag_field_class); ret = -1; goto error; @@ -840,13 +840,13 @@ bt_field_class *create_field_class_copy_internal(struct trace_ir_metadata_maps * break; } case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { bt_field_class *out_sel_fc = NULL; - if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR || - fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) { + if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR || + fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) { const bt_field_class *in_sel_fc; const bt_field_path *sel_fp = bt_field_class_variant_with_selector_borrow_selector_field_path_const( @@ -961,8 +961,8 @@ int copy_field_class_content_internal( in_field_class, out_field_class); break; case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: ret = field_class_variant_copy(md_maps, in_field_class, out_field_class); break; diff --git a/src/plugins/text/details/write.c b/src/plugins/text/details/write.c index 8b18bf02..49b7b314 100644 --- a/src/plugins/text/details/write.c +++ b/src/plugins/text/details/write.c @@ -840,22 +840,22 @@ void write_variant_field_class_option(struct details_write_ctx *ctx, write_compound_member_name(ctx, bt_field_class_variant_option_get_name(option)); - if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR) { - const bt_field_class_variant_with_selector_unsigned_option *spec_opt = - bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( + if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR) { + const bt_field_class_variant_with_selector_integer_unsigned_option *spec_opt = + bt_field_class_variant_with_selector_integer_unsigned_borrow_option_by_index_const( fc, index); orig_ranges = - bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( + bt_field_class_variant_with_selector_integer_unsigned_option_borrow_ranges_const( spec_opt); is_signed = false; - } else if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) { - const bt_field_class_variant_with_selector_signed_option *spec_opt = - bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( + } else if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) { + const bt_field_class_variant_with_selector_integer_signed_option *spec_opt = + bt_field_class_variant_with_selector_integer_signed_borrow_option_by_index_const( fc, index); orig_ranges = - bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( + bt_field_class_variant_with_selector_integer_signed_option_borrow_ranges_const( spec_opt); is_signed = true; } @@ -964,11 +964,11 @@ void write_field_class(struct details_write_ctx *ctx, const bt_field_class *fc) case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: type = "Variant (no selector)"; break; - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - type = "Variant (unsigned selector)"; + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + type = "Variant (unsigned integer selector)"; break; - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: - type = "Variant (signed selector)"; + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: + type = "Variant (signed integer selector)"; break; default: abort(); @@ -1043,15 +1043,15 @@ void write_field_class(struct details_write_ctx *ctx, const bt_field_class *fc) break; } case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { uint64_t option_count = bt_field_class_variant_get_option_count(fc); const bt_field_path *sel_field_path = NULL; - if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR || - fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) { + if (fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR || + fc_type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) { sel_field_path = bt_field_class_variant_with_selector_borrow_selector_field_path_const( fc); @@ -1235,8 +1235,8 @@ void write_field_class(struct details_write_ctx *ctx, const bt_field_class *fc) break; } case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: { uint64_t option_count = bt_field_class_variant_get_option_count(fc); @@ -1986,8 +1986,8 @@ void write_field(struct details_write_ctx *ctx, const bt_field *field, break; } case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: write_field(ctx, bt_field_variant_borrow_selected_option_field_const( field), NULL); diff --git a/src/plugins/text/pretty/print.c b/src/plugins/text/pretty/print.c index c098dd6c..5d03c572 100644 --- a/src/plugins/text/pretty/print.c +++ b/src/plugins/text/pretty/print.c @@ -1065,8 +1065,8 @@ int print_field(struct pretty_component *pretty, case BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR: return print_option(pretty, field, print_names); case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR: - case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: + case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: return print_variant(pretty, field, print_names); case BT_FIELD_CLASS_TYPE_STATIC_ARRAY: return print_array(pretty, field, print_names); diff --git a/tests/bindings/python/bt2/test_field_class.py b/tests/bindings/python/bt2/test_field_class.py index 1ea9bad2..d980548f 100644 --- a/tests/bindings/python/bt2/test_field_class.py +++ b/tests/bindings/python/bt2/test_field_class.py @@ -958,7 +958,7 @@ class VariantFieldClassWithoutSelectorTestCase( _create_default_field_class = _create_field_class -class _VariantFieldClassWithSelectorTestCase: +class _VariantFieldClassWithIntegerSelectorTestCase: @staticmethod def _const_value_setter(field): field['variant'].selected_option_index = 0 @@ -1279,7 +1279,7 @@ class _VariantFieldClassWithSelectorTestCase: class VariantFieldClassWithUnsignedSelectorTestCase( - _VariantFieldClassWithSelectorTestCase, unittest.TestCase + _VariantFieldClassWithIntegerSelectorTestCase, unittest.TestCase ): def _spec_set_up(self): self._ranges1 = bt2.UnsignedIntegerRangeSet([(1, 4), (18, 47)]) @@ -1290,7 +1290,7 @@ class VariantFieldClassWithUnsignedSelectorTestCase( class VariantFieldClassWithSignedSelectorTestCase( - _VariantFieldClassWithSelectorTestCase, unittest.TestCase + _VariantFieldClassWithIntegerSelectorTestCase, unittest.TestCase ): def _spec_set_up(self): self._ranges1 = bt2.SignedIntegerRangeSet([(-10, -4), (18, 47)]) diff --git a/tests/bindings/python/bt2/test_package.py b/tests/bindings/python/bt2/test_package.py index d4700af5..ea67236d 100644 --- a/tests/bindings/python/bt2/test_package.py +++ b/tests/bindings/python/bt2/test_package.py @@ -249,14 +249,14 @@ class PackageTestCase(unittest.TestCase): def test_has__VariantFieldClassWithoutSelector(self): self._assert_in_bt2('_VariantFieldClassWithoutSelector') - def test_has__VariantFieldClassWithSelector(self): - self._assert_in_bt2('_VariantFieldClassWithSelector') + def test_has__VariantFieldClassWithIntegerSelector(self): + self._assert_in_bt2('_VariantFieldClassWithIntegerSelector') - def test_has__VariantFieldClassWithUnsignedSelector(self): - self._assert_in_bt2('_VariantFieldClassWithUnsignedSelector') + def test_has__VariantFieldClassWithUnsignedIntegerSelector(self): + self._assert_in_bt2('_VariantFieldClassWithUnsignedIntegerSelector') - def test_has__VariantFieldClassWithSignedSelector(self): - self._assert_in_bt2('_VariantFieldClassWithSignedSelector') + def test_has__VariantFieldClassWithSignedIntegerSelector(self): + self._assert_in_bt2('_VariantFieldClassWithSignedIntegerSelector') def test_has__ArrayFieldClass(self): self._assert_in_bt2('_ArrayFieldClass') @@ -324,14 +324,14 @@ class PackageTestCase(unittest.TestCase): def test_has__VariantFieldClassWithoutSelectorConst(self): self._assert_in_bt2('_VariantFieldClassWithoutSelectorConst') - def test_has__VariantFieldClassWithSelectorConst(self): - self._assert_in_bt2('_VariantFieldClassWithSelectorConst') + def test_has__VariantFieldClassWithIntegerSelectorConst(self): + self._assert_in_bt2('_VariantFieldClassWithIntegerSelectorConst') - def test_has__VariantFieldClassWithUnsignedSelectorConst(self): - self._assert_in_bt2('_VariantFieldClassWithUnsignedSelectorConst') + def test_has__VariantFieldClassWithUnsignedIntegerSelectorConst(self): + self._assert_in_bt2('_VariantFieldClassWithUnsignedIntegerSelectorConst') - def test_has__VariantFieldClassWithSignedSelectorConst(self): - self._assert_in_bt2('_VariantFieldClassWithSignedSelectorConst') + def test_has__VariantFieldClassWithSignedIntegerSelectorConst(self): + self._assert_in_bt2('_VariantFieldClassWithSignedIntegerSelectorConst') def test_has__ArrayFieldClassConst(self): self._assert_in_bt2('_ArrayFieldClassConst') diff --git a/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-no-underscore.expect b/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-no-underscore.expect index 9b1cce5f..75331fe4 100644 --- a/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-no-underscore.expect +++ b/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-no-underscore.expect @@ -12,7 +12,7 @@ Trace class: COSSETTE: [0] PELCHAT: [1] VOISINE: [2] - var: Variant (unsigned selector) (3 options, Selector field path [Event payload: 0]): + var: Variant (unsigned integer selector) (3 options, Selector field path [Event payload: 0]): COSSETTE: [0]: String PELCHAT: [1]: String VOISINE: [2]: String diff --git a/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-one-underscore.expect b/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-one-underscore.expect index 073a8909..057b9974 100644 --- a/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-one-underscore.expect +++ b/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-one-underscore.expect @@ -12,7 +12,7 @@ Trace class: COSSETTE: [0] PELCHAT: [1] _VOISINE: [2] - var: Variant (unsigned selector) (3 options, Selector field path [Event payload: 0]): + var: Variant (unsigned integer selector) (3 options, Selector field path [Event payload: 0]): COSSETTE: [0]: String PELCHAT: [1]: String VOISINE: [2]: String diff --git a/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-reserved-keywords.expect b/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-reserved-keywords.expect index 4c37fec1..6aa1974c 100644 --- a/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-reserved-keywords.expect +++ b/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-reserved-keywords.expect @@ -37,7 +37,7 @@ Trace class: _unsigned: [22] _variant: [23] _void: [24] - var: Variant (unsigned selector) (28 options, Selector field path [Event payload: 0]): + var: Variant (unsigned integer selector) (28 options, Selector field path [Event payload: 0]): align: [0]: String callsite: [1]: String const: [2]: String diff --git a/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-same-with-underscore.expect b/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-same-with-underscore.expect index 019b2e2e..a4265c3a 100644 --- a/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-same-with-underscore.expect +++ b/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-same-with-underscore.expect @@ -12,7 +12,7 @@ Trace class: COSSETTE: [0] _PELCHAT: [1] __PELCHAT: [2] - var: Variant (unsigned selector) (3 options, Selector field path [Event payload: 0]): + var: Variant (unsigned integer selector) (3 options, Selector field path [Event payload: 0]): COSSETTE: [0]: String PELCHAT: [1]: String _PELCHAT: [2]: String diff --git a/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-two-underscores.expect b/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-two-underscores.expect index 62892492..3e51831e 100644 --- a/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-two-underscores.expect +++ b/tests/data/plugins/sink.ctf.fs/succeed/trace-meta-variant-two-underscores.expect @@ -12,7 +12,7 @@ Trace class: COSSETTE: [0] VOISINE: [2] __PELCHAT: [1] - var: Variant (unsigned selector) (3 options, Selector field path [Event payload: 0]): + var: Variant (unsigned integer selector) (3 options, Selector field path [Event payload: 0]): COSSETTE: [0]: String _PELCHAT: [1]: String VOISINE: [2]: String -- 2.34.1