webrtc test: Print content of error GstMessage
authorOlivier Crête <olivier.crete@collabora.com>
Thu, 13 May 2021 19:25:57 +0000 (15:25 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Thu, 13 May 2021 20:37:31 +0000 (16:37 -0400)
Makes it easier to interpret the result of the CI!

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>

tests/check/elements/webrtcbin.c

index 2f4ff64..405886e 100644 (file)
@@ -455,6 +455,14 @@ _bus_no_errors (struct test_webrtc *t, GstBus * bus, GstMessage * msg,
 {
   switch (GST_MESSAGE_TYPE (msg)) {
     case GST_MESSAGE_ERROR:{
+      GError *err = NULL;
+      gchar *dbg = NULL;
+
+      gst_message_parse_error (msg, &err, &dbg);
+      g_error ("ERROR from element %s: %s (Debugging info: %s)",
+          GST_OBJECT_NAME (msg->src), err->message, (dbg) ? dbg : "none");
+      g_error_free (err);
+      g_free (dbg);
       g_assert_not_reached ();
       break;
     }