validate: Add helper functions ti print actions

API:
  + gst_validate_scenario_get_next_action
  + gst_validate_reporter_report_simple

https://bugzilla.gnome.org/show_bug.cgi?id=743994
This commit is contained in:
Thibault Saunier 2015-02-04 15:24:35 +01:00
parent 16d52a445b
commit 8125c46122
5 changed files with 32 additions and 3 deletions

View file

@ -504,6 +504,19 @@ gst_validate_printf (gpointer source, const gchar * format, ...)
va_end (var_args);
}
/**
* gst_validate_print_action:
* @action: (allow-none): The source object to log
* @message: The message to print out in the GstValidate logging system
*
* Print @message to the GstValidate logging system
*/
void
gst_validate_print_action (GstValidateAction * action, const gchar * message)
{
gst_validate_printf_valist (action, message, NULL);
}
static void
print_action_parametter (GString * string, GstValidateActionType * type,
GstValidateActionParameter * param)
@ -637,7 +650,10 @@ gst_validate_printf_valist (gpointer source, const gchar * format, va_list args)
}
}
g_string_append_vprintf (string, format, args);
if (args)
g_string_append_vprintf (string, format, args);
else
g_string_append (string, format);
if (!newline_regex)
newline_regex =

View file

@ -32,6 +32,8 @@ typedef guintptr GstValidateIssueId;
G_BEGIN_DECLS
typedef struct _GstValidateAction GstValidateAction;
GType gst_validate_report_get_type (void);
#define GST_TYPE_VALIDATE_REPORT (gst_validate_report_get_type ())
@ -213,6 +215,7 @@ const gchar * gst_validate_report_level_get_name (GstValidateReportLevel le
void gst_validate_printf (gpointer source,
const gchar * format,
...) G_GNUC_PRINTF (2, 3) G_GNUC_NO_INSTRUMENT;
void gst_validate_print_action (GstValidateAction *action, const gchar * message);
void gst_validate_printf_valist (gpointer source,
const gchar * format,
va_list args) G_GNUC_NO_INSTRUMENT;

View file

@ -268,6 +268,13 @@ gst_validate_report (GstValidateReporter * reporter,
va_end (var_args);
}
void
gst_validate_reporter_report_simple (GstValidateReporter * reporter,
GstValidateIssueId issue_id, const gchar * message)
{
gst_validate_report (reporter, issue_id, message);
}
void
gst_validate_reporter_set_name (GstValidateReporter * reporter, gchar * name)
{

View file

@ -103,6 +103,9 @@ void gst_validate_report (GstValidateReporter * reporter,
const gchar * format, ...);
void gst_validate_report_valist (GstValidateReporter * reporter, GstValidateIssueId issue_id,
const gchar * format, va_list var_args);
void
gst_validate_reporter_report_simple (GstValidateReporter * reporter, GstValidateIssueId issue_id,
const gchar * message);
void gst_validate_reporter_set_runner (GstValidateReporter * reporter, GstValidateRunner *runner);
void gst_validate_reporter_set_handle_g_logs (GstValidateReporter * reporter);

View file

@ -166,7 +166,7 @@ _set_reporting_level_for_name (GstValidateRunner * runner,
}
static void
_replace_double_colons (gchar *word)
_replace_double_colons (gchar * word)
{
while (word) {
word = strstr (word, "::");
@ -461,7 +461,7 @@ _do_report_synthesis (GstValidateRunner * runner)
* Returns: 0 if no critical error has been found and 18 if a critical
* error has been detected. That return value is usually to be used as
* exit code of the application.
* */
*/
int
gst_validate_runner_printf (GstValidateRunner * runner)
{