lib: allow a single mapped clock class within a stream class
[babeltrace.git] / lib / ctf-ir / utils.c
index fba66fd5af7141c399e4097e310cf937f671aa7d..8690f0255385bb2cc4204a7a7f1a01713ae1ac88 100644 (file)
@@ -34,6 +34,7 @@
 #include <glib.h>
 #include <babeltrace/ctf-ir/utils.h>
 #include <babeltrace/ctf-ir/field-types.h>
+#include <babeltrace/ctf-ir/clock-class.h>
 #include <babeltrace/ref.h>
 
 static
@@ -130,7 +131,11 @@ int bt_validate_single_clock_class(struct bt_field_type *field_type,
                struct bt_clock_class **expected_clock_class)
 {
        int ret = 0;
-       assert(field_type);
+
+       if (!field_type) {
+               goto end;
+       }
+
        assert(expected_clock_class);
 
        switch (bt_field_type_get_type_id(field_type)) {
@@ -155,9 +160,13 @@ int bt_validate_single_clock_class(struct bt_field_type *field_type,
                                BT_LOGW("Integer field type is not mapped to "
                                        "the expected clock class: "
                                        "mapped-clock-class-addr=%p, "
-                                       "expected-clock-class-addr=%p",
+                                       "mapped-clock-class-name=\"%s\", "
+                                       "expected-clock-class-addr=%p, "
+                                       "expected-clock-class-name=\"%s\"",
                                        mapped_clock_class,
-                                       *expected_clock_class);
+                                       bt_clock_class_get_name(mapped_clock_class),
+                                       *expected_clock_class,
+                                       bt_clock_class_get_name(*expected_clock_class));
                                bt_put(mapped_clock_class);
                                ret = -1;
                                goto end;
This page took 0.027255 seconds and 4 git commands to generate.