libs/gst/check/gstcheck.c: if we get the wrong message, give us the types as string
authorThomas Vander Stichele <thomas@apestaart.org>
Sun, 2 Jul 2006 23:22:31 +0000 (23:22 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Sun, 2 Jul 2006 23:22:31 +0000 (23:22 +0000)
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

ChangeLog
common
libs/gst/check/gstcheck.c
plugins/elements/gstfilesrc.c
tests/check/elements/filesrc.c

index da08338..8ebebe0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 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):
          add a test for adding self
 
diff --git a/common b/common
index f411695..a98b370 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit f411695f3e009b4d348a8fa2dd32c0171f1ff683
+Subproject commit a98b370bd49bc3f3225bbd9013cda5a53789f53d
index fbcabd6..d81e271 100644 (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);
index b1a5aa5..1a3fc7b 100644 (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;
   }
index 734107d..ae0ffea 100644 (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);
 }