tests: add a basic pre-condition assertion test
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 23 May 2023 15:44:36 +0000 (11:44 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 23 May 2023 17:51:15 +0000 (13:51 -0400)
There is currently no "basic" pre-condition assertion test, even though
we have the support for it.  Add one, so that the support code is
exercised.  The new test checks that passing a wrong MIP version to
bt_grbt_graph_create triggers an assertion.

Change-Id: Iddaa7905684e1bda3a731ab215a0e42b5eb62633
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10056
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/lib/conds/conds-triggers.c

index 810af9720d04391eeaca0ac6d5652ae049339cec..7a137052cfcbc341df5005a748d0131b20c8a13c 100644 (file)
@@ -9,6 +9,12 @@
 #include "common/assert.h"
 #include "utils.h"
 
+static
+void trigger_graph_mip_version(void)
+{
+       bt_graph_create(292);
+}
+
 static
 bt_field_class *get_uint_fc(bt_self_component *self_comp)
 {
@@ -42,6 +48,8 @@ void trigger_fc_int_set_field_value_range_null(bt_self_component *self_comp)
 
 static
 const struct cond_trigger triggers[] = {
+       COND_TRIGGER_PRE_BASIC("pre:graph-create:valid-mip-version", NULL,
+               trigger_graph_mip_version),
        COND_TRIGGER_PRE_RUN_IN_COMP_CLS_INIT(
                "pre:field-class-integer-set-field-value-range:valid-n",
                "0",
This page took 0.025107 seconds and 4 git commands to generate.