validate: report: Fix the way we print 'repeat' values
authorThibault Saunier <tsaunier@igalia.com>
Mon, 4 Feb 2019 16:19:26 +0000 (13:19 -0300)
committerThibault Saunier <tsaunier@gnome.org>
Fri, 15 Feb 2019 14:19:03 +0000 (14:19 +0000)
validate/gst/validate/gst-validate-report.c
validate/tests/check/validate/expression_parser.c

index ed8b463..7bb7087 100644 (file)
@@ -769,6 +769,9 @@ _append_value (GQuark field_id, const GValue * value, GString * string)
   if (g_strcmp0 (g_quark_to_string (field_id), "sub-action") == 0)
     return TRUE;
 
+  if (g_strcmp0 (g_quark_to_string (field_id), "repeat") == 0)
+    return TRUE;
+
   if (G_VALUE_TYPE (value) == GST_TYPE_CLOCK_TIME)
     val_str = g_strdup_printf ("%" GST_TIME_FORMAT,
         GST_TIME_ARGS (g_value_get_uint64 (value)));
@@ -806,7 +809,8 @@ gst_validate_print_action (GstValidateAction * action, const gchar * message)
       g_string_append_printf (string, "(subaction)");
 
     if (gst_structure_get_int (action->structure, "repeat", &nrepeats))
-      g_string_append_printf (string, "(%d/%d)", action->repeat, nrepeats);
+      g_string_append_printf (string, "(%d/%d)", nrepeats - action->repeat + 1,
+          nrepeats);
 
     g_string_append_printf (string, "%s",
         gst_structure_get_name (action->structure));
index 76a8f2f..182730b 100644 (file)
@@ -20,7 +20,7 @@ GST_START_TEST (test_expression_parser)
           NULL, NULL, NULL), 20);
 
   fail_unless_equals_float (gst_validate_utils_parse_expression
-      ("100, (10 / 0.1)", NULL, NULL, NULL), 1);
+      ("max(100, (10 / 0.1))", NULL, NULL, NULL), 100);
 
   fail_unless_equals_float (gst_validate_utils_parse_expression
       ("min(10, (duration - 0.1) / 0.1)", get_var, GINT_TO_POINTER (1), NULL),