#include "lib/assert-cond.h"
#include "lib/func-status.h"
-#define BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(_cause, _exp_type) \
- BT_ASSERT_PRE(((const struct bt_error_cause *) (_cause))->actor_type == _exp_type, \
+#define BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(_cause, _exp_type_name, _exp_type) \
+ BT_ASSERT_PRE("error-cause-has-" _exp_type_name "-actor", \
+ ((const struct bt_error_cause *) (_cause))->actor_type == _exp_type, \
"Unexpected error cause's actor type: type=%s, exp-type=%s", \
bt_error_cause_actor_type_string(((const struct bt_error_cause *) (_cause))->actor_type), \
bt_error_cause_actor_type_string(_exp_type))
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "component",
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_name->str;
}
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "component",
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_class_id.type;
}
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "component",
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_class_id.name->str;
}
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "component",
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT);
return spec_cause->comp_class_id.plugin_name->len > 0 ?
spec_cause->comp_class_id.plugin_name->str : NULL;
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "component-class",
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS);
return spec_cause->comp_class_id.type;
}
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "component-class",
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS);
return spec_cause->comp_class_id.name->str;
}
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "component-class",
BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS);
return spec_cause->comp_class_id.plugin_name->len > 0 ?
spec_cause->comp_class_id.plugin_name->str : NULL;
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "message-iterator",
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_name->str;
}
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "message-iterator",
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->output_port_name->str;
}
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "message-iterator",
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_class_id.type;
}
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "message-iterator",
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_class_id.name->str;
}
(const void *) cause;
BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause);
- BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause,
+ BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause, "message-iterator",
BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR);
return spec_cause->comp_class_id.plugin_name->len > 0 ?
spec_cause->comp_class_id.plugin_name->str : NULL;