mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
file{sink,src}: Check if non-URI characters are escaped, but only for the URI not the location property
This commit is contained in:
parent
39eeab382c
commit
c1c0c86bba
2 changed files with 16 additions and 0 deletions
|
@ -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"));
|
||||
|
|
|
@ -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"));
|
||||
|
|
Loading…
Reference in a new issue