validate: Ensure a meta structure is found in test files
authorThibault Saunier <tsaunier@igalia.com>
Thu, 7 May 2020 02:36:59 +0000 (22:36 -0400)
committerThibault Saunier <tsaunier@igalia.com>
Thu, 7 May 2020 04:31:45 +0000 (00:31 -0400)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/189>

validate/gst/validate/validate.c

index d8980ba..fa4e437 100644 (file)
@@ -537,6 +537,10 @@ gst_validate_setup_test_file (const gchar * testfile, gboolean use_fakesinks)
   if (gst_structure_has_name (testfile_structs->data, "set-globals")) {
     GstStructure *globals = testfile_structs->data;
     gst_validate_set_globals (globals);
+    if (!testfile_structs->next)
+      gst_validate_abort
+          ("Only one `set-globals` structure in %s, nothing to test here.",
+          testfile);
     res = testfile_structs->next->data;
   }