libs/gst/check/gstcheck.c: if we get the wrong message, give us the types as string

Original commit message from CVS:
* libs/gst/check/gstcheck.c: (gst_check_message_error),
(gst_check_run_suite):
if we get the wrong message, give us the types as string
* plugins/elements/gstfilesrc.c: (gst_file_src_start):
Fix a translatable
* tests/check/elements/filesrc.c: (GST_START_TEST):
add a test for trying to open a non-existing file
This commit is contained in:
Thomas Vander Stichele 2006-07-02 23:22:31 +00:00
parent 163cbcf957
commit 904f7041d0
5 changed files with 34 additions and 3 deletions

View file

@ -1,3 +1,13 @@
2006-07-03 Thomas Vander Stichele <thomas at apestaart dot org>
* libs/gst/check/gstcheck.c: (gst_check_message_error),
(gst_check_run_suite):
if we get the wrong message, give us the types as string
* plugins/elements/gstfilesrc.c: (gst_file_src_start):
Fix a translatable
* tests/check/elements/filesrc.c: (GST_START_TEST):
add a test for trying to open a non-existing file
2006-07-03 Thomas Vander Stichele <thomas at apestaart dot org>
* tests/check/gst/gstbin.c: (GST_START_TEST), (gst_bin_suite):

2
common

@ -1 +1 @@
Subproject commit f411695f3e009b4d348a8fa2dd32c0171f1ff683
Subproject commit a98b370bd49bc3f3225bbd9013cda5a53789f53d

View file

@ -108,7 +108,10 @@ gst_check_message_error (GstMessage * message, GstMessageType type,
GError *error;
gchar *debug;
fail_unless_equals_int (GST_MESSAGE_TYPE (message), type);
fail_unless (GST_MESSAGE_TYPE (message) == type,
"message is of type %s instead of expected type %s",
gst_message_type_get_name (GST_MESSAGE_TYPE (message)),
gst_message_type_get_name (type));
gst_message_parse_error (message, &error, &debug);
fail_unless_equals_int (error->domain, domain);
fail_unless_equals_int (error->code, code);

View file

@ -948,7 +948,7 @@ open_failed:
no_stat:
{
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
(_("could not get info on \"%s\"."), src->filename), (NULL));
(_("Could not get info on \"%s\"."), src->filename), (NULL));
close (src->fd);
return FALSE;
}

View file

@ -104,18 +104,36 @@ GST_START_TEST (test_coverage)
{
GstElement *src;
gchar *location;
GstBus *bus;
GstMessage *message;
src = setup_filesrc ();
bus = gst_bus_new ();
gst_element_set_bus (src, bus);
g_object_set (G_OBJECT (src), "location", "/i/do/not/exist", NULL);
g_object_get (G_OBJECT (src), "location", &location, NULL);
fail_unless_equals_string (location, "/i/do/not/exist");
g_free (location);
fail_unless (gst_element_set_state (src,
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE,
"could set to playing with wrong location");
/* a state change and an error */
fail_if ((message = gst_bus_pop (bus)) == NULL);
gst_message_unref (message);
fail_if ((message = gst_bus_pop (bus)) == NULL);
fail_unless_message_error (message, RESOURCE, NOT_FOUND);
gst_message_unref (message);
g_object_set (G_OBJECT (src), "location", NULL, NULL);
g_object_get (G_OBJECT (src), "location", &location, NULL);
fail_if (location);
/* cleanup */
gst_element_set_bus (src, NULL);
gst_object_unref (GST_OBJECT (bus));
cleanup_filesrc (src);
}