From 75356d4bbebbe2f5e4bfe78674e59ea2ce294d70 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sat, 28 Sep 2013 00:12:07 +0200 Subject: [PATCH] scenario: Error out and exit when we fail loading a scenario --- validate/gst/validate/gst-validate-scenario.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index 4f92ac6a35..51279d3542 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -597,14 +597,14 @@ _load_scenario_file (GstValidateScenario * scenario, structure = gst_structure_from_string (lines[i], NULL); if (structure == NULL) { - GST_WARNING_OBJECT (scenario, "Could not parse action %s", lines[i]); - continue; + GST_ERROR_OBJECT (scenario, "Could not parse action %s", lines[i]); + goto failed; } type = gst_structure_get_name (structure); if (!g_hash_table_lookup (action_types_table, type)) { - GST_WARNING_OBJECT (scenario, "We do not handle action types %s", type); - continue; + GST_ERROR_OBJECT (scenario, "We do not handle action types %s", type); + goto failed; } action = g_slice_new0 (GstValidateAction); @@ -693,6 +693,12 @@ done: if (lfilename) g_free (lfilename); + if (ret == FALSE) { + g_printerr ("Could not set scenario %s => EXIT\n", scenario_name); + + exit (0); + } + return ret; invalid_name: