mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-08 18:39:54 +00:00
check: add progress message unit test
This commit is contained in:
parent
f5b175972c
commit
5db2e45d5c
1 changed files with 24 additions and 0 deletions
|
@ -320,6 +320,30 @@ GST_START_TEST (test_parsing)
|
|||
fail_unless (processed == 1030);
|
||||
fail_unless (dropped == 65);
|
||||
|
||||
gst_message_unref (message);
|
||||
}
|
||||
/* GST_MESSAGE_PROGRESS */
|
||||
{
|
||||
GstProgressType type;
|
||||
gchar *category, *text;
|
||||
|
||||
message =
|
||||
gst_message_new_progress (NULL, GST_PROGRESS_TYPE_START, "connecting",
|
||||
"Connecting to youtbue.com");
|
||||
fail_if (message == NULL);
|
||||
fail_unless (GST_MESSAGE_TYPE (message) == GST_MESSAGE_PROGRESS);
|
||||
fail_unless (GST_MESSAGE_SRC (message) == NULL);
|
||||
|
||||
/* set some wrong values to check if the parse method overwrites them
|
||||
* with the good values */
|
||||
type = GST_PROGRESS_TYPE_ERROR;
|
||||
gst_message_parse_progress (message, &type, &category, &text);
|
||||
fail_unless (type == GST_PROGRESS_TYPE_START);
|
||||
fail_unless (!strcmp (category, "connecting"));
|
||||
fail_unless (!strcmp (text, "Connecting to youtbue.com"));
|
||||
g_free (category);
|
||||
g_free (text);
|
||||
|
||||
gst_message_unref (message);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue