file{sink,src}: Check if non-URI characters are escaped, but only for the URI not...
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 15 Feb 2011 21:56:35 +0000 (22:56 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 15 Feb 2011 21:57:28 +0000 (22:57 +0100)
tests/check/elements/filesink.c
tests/check/elements/filesrc.c

index 672314afadbfeb0e3428334e97bb513f38b946ad..3188a7ff529b5b71bb6e78fb79b4af152523fa87 100644 (file)
@@ -285,6 +285,14 @@ GST_START_TEST (test_uri_interface)
   fail_unless_equals_string (location, "/foo/baz");
   g_free (location);
 
+  /* should escape non-uri characters for the URI but not for the location */
+  g_object_set (G_OBJECT (filesink), "location", "/foo/b?r", NULL);
+  g_object_get (G_OBJECT (filesink), "location", &location, NULL);
+  fail_unless_equals_string (location, "/foo/b?r");
+  g_free (location);
+  location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (filesink));
+  fail_unless_equals_string (location, "file:///foo/b%3Fr");
+
   /* should fail with other hostnames */
   fail_if (gst_uri_handler_set_uri (GST_URI_HANDLER (filesink),
           "file://hostname/foo/foo"));
index ea64b0823e3ff1648946d4b02a2065b4d6bcec13..71a09f0f0f3b139b236d4bfaaaced7122cb645a9 100644 (file)
@@ -364,6 +364,14 @@ GST_START_TEST (test_uri_interface)
   fail_unless_equals_string (location, "/foo/baz");
   g_free (location);
 
+  /* should escape non-uri characters for the URI but not for the location */
+  g_object_set (G_OBJECT (src), "location", "/foo/b?r", NULL);
+  g_object_get (G_OBJECT (src), "location", &location, NULL);
+  fail_unless_equals_string (location, "/foo/b?r");
+  g_free (location);
+  location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (src));
+  fail_unless_equals_string (location, "file:///foo/b%3Fr");
+
   /* should fail with other hostnames */
   fail_if (gst_uri_handler_set_uri (GST_URI_HANDLER (src),
           "file://hostname/foo/foo"));