*/
#define BT_ASSERT_PRE_NON_NULL_FROM_FUNC(_func, _obj_id, _obj, _obj_name) \
BT_ASSERT_PRE_FROM_FUNC(_func, "not-null:" _obj_id, (_obj), \
*/
#define BT_ASSERT_PRE_NON_NULL_FROM_FUNC(_func, _obj_id, _obj, _obj_name) \
BT_ASSERT_PRE_FROM_FUNC(_func, "not-null:" _obj_id, (_obj), \
#define BT_ASSERT_PRE_NON_NULL(_obj_id, _obj, _obj_name) \
BT_ASSERT_PRE_NON_NULL_FROM_FUNC(__func__, _obj_id, (_obj), _obj_name)
#define BT_ASSERT_PRE_NON_NULL(_obj_id, _obj, _obj_name) \
BT_ASSERT_PRE_NON_NULL_FROM_FUNC(__func__, _obj_id, (_obj), _obj_name)
-#define BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(_field_id, _field, _cls_type_id, _cls_type, _name) \
- BT_ASSERT_PRE_DEV("is-" _cls_type_id ":" _field_id, \
+#define BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE_FROM_FUNC(_func, _field_id, _field, _cls_type_id, _cls_type, _name) \
+ BT_ASSERT_PRE_DEV_FROM_FUNC(_func, "is-" _cls_type_id ":" _field_id, \
((const struct bt_field *) (_field))->class->type == (_cls_type), \
_name " has the wrong class type: expected-class-type=%s, " \
"%![field-]+f", \
bt_common_field_class_type_string(_cls_type), (_field))
((const struct bt_field *) (_field))->class->type == (_cls_type), \
_name " has the wrong class type: expected-class-type=%s, " \
"%![field-]+f", \
bt_common_field_class_type_string(_cls_type), (_field))
+#define BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE(_field_id, _field, _cls_type_id, _cls_type, _name) \
+ BT_ASSERT_PRE_DEV_FIELD_HAS_CLASS_TYPE_FROM_FUNC(__func__, \
+ _field_id, (_field), _cls_type_id, _cls_type, _name)
+
#define BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(_field_id, _field, _name) \
BT_ASSERT_PRE_DEV( \
"is-unsigned-integer-field:" _field_id, \
#define BT_ASSERT_PRE_DEV_FIELD_IS_UNSIGNED_INT(_field_id, _field, _name) \
BT_ASSERT_PRE_DEV( \
"is-unsigned-integer-field:" _field_id, \
-#define BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY(_field_id, _field, _name) \
- BT_ASSERT_PRE_DEV( \
+#define BT_ASSERT_PRE_DEV_FIELD_IS_ARRAY_FROM_FUNC(_func, _field_id, _field, _name) \
+ BT_ASSERT_PRE_DEV_FROM_FUNC(_func, \
"is-array-field:" _field_id, \
((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY || \
((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD || \
((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD, \
_name " is not an array field: %![field-]+f", (_field))
"is-array-field:" _field_id, \
((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY || \
((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD || \
((const struct bt_field *) (_field))->class->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD, \
_name " is not an array field: %![field-]+f", (_field))
#define BT_ASSERT_PRE_DEV_FIELD_IS_DYNAMIC_ARRAY(_field_id, _field, _name) \
BT_ASSERT_PRE_DEV( \
"is-dynamic-array-field:" _field_id, \
#define BT_ASSERT_PRE_DEV_FIELD_IS_DYNAMIC_ARRAY(_field_id, _field, _name) \
BT_ASSERT_PRE_DEV( \
"is-dynamic-array-field:" _field_id, \
BT_ASSERT_PRE_NON_NULL(_BT_ASSERT_PRE_FIELD_ID, (_field), \
_BT_ASSERT_PRE_FIELD_NAME)
BT_ASSERT_PRE_NON_NULL(_BT_ASSERT_PRE_FIELD_ID, (_field), \
_BT_ASSERT_PRE_FIELD_NAME)
+#define BT_ASSERT_PRE_DEV_FIELD_NON_NULL_FROM_FUNC(_func, _field) \
+ BT_ASSERT_PRE_DEV_NON_NULL_FROM_FUNC(_func, \
+ _BT_ASSERT_PRE_FIELD_ID, (_field), \
+ _BT_ASSERT_PRE_FIELD_NAME)
+
#define BT_ASSERT_PRE_DEV_FIELD_NON_NULL(_field) \
BT_ASSERT_PRE_DEV_NON_NULL(_BT_ASSERT_PRE_FIELD_ID, (_field), \
_BT_ASSERT_PRE_FIELD_NAME)
#define BT_ASSERT_PRE_DEV_FIELD_NON_NULL(_field) \
BT_ASSERT_PRE_DEV_NON_NULL(_BT_ASSERT_PRE_FIELD_ID, (_field), \
_BT_ASSERT_PRE_FIELD_NAME)
_BT_ASSERT_PRE_MSG_HAS_TYPE_ID(_msg_id, _type_id), \
_BT_ASSERT_PRE_MSG_HAS_TYPE_COND((_msg), (_type)), \
_BT_ASSERT_PRE_MSG_HAS_TYPE_FMT, \
_BT_ASSERT_PRE_MSG_HAS_TYPE_ID(_msg_id, _type_id), \
_BT_ASSERT_PRE_MSG_HAS_TYPE_COND((_msg), (_type)), \
_BT_ASSERT_PRE_MSG_HAS_TYPE_FMT, \
#define BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(_msg_id, _msg, _type_id, _type) \
BT_ASSERT_PRE_DEV( \
_BT_ASSERT_PRE_MSG_HAS_TYPE_ID(_msg_id, _type_id), \
_BT_ASSERT_PRE_MSG_HAS_TYPE_COND((_msg), (_type)), \
_BT_ASSERT_PRE_MSG_HAS_TYPE_FMT, \
#define BT_ASSERT_PRE_DEV_MSG_HAS_TYPE(_msg_id, _msg, _type_id, _type) \
BT_ASSERT_PRE_DEV( \
_BT_ASSERT_PRE_MSG_HAS_TYPE_ID(_msg_id, _type_id), \
_BT_ASSERT_PRE_MSG_HAS_TYPE_COND((_msg), (_type)), \
_BT_ASSERT_PRE_MSG_HAS_TYPE_FMT, \