mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
tests: filesrc: fix for windows
Location paths have backslashes on windows when converted from URI.
This commit is contained in:
parent
88dfd9ee48
commit
4a5aa8dba0
1 changed files with 21 additions and 2 deletions
|
@ -367,26 +367,45 @@ GST_START_TEST (test_uri_interface)
|
||||||
fail_unless_equals_string (location, "file:///i/do/not/exist");
|
fail_unless_equals_string (location, "file:///i/do/not/exist");
|
||||||
g_free (location);
|
g_free (location);
|
||||||
|
|
||||||
|
#define DSEP G_DIR_SEPARATOR_S
|
||||||
|
|
||||||
/* should accept file:///foo/bar URIs */
|
/* should accept file:///foo/bar URIs */
|
||||||
fail_unless (gst_uri_handler_set_uri (GST_URI_HANDLER (src),
|
fail_unless (gst_uri_handler_set_uri (GST_URI_HANDLER (src),
|
||||||
"file:///foo/bar", NULL));
|
"file:///foo/bar", NULL));
|
||||||
location = gst_uri_handler_get_uri (GST_URI_HANDLER (src));
|
location = gst_uri_handler_get_uri (GST_URI_HANDLER (src));
|
||||||
fail_unless_equals_string (location, "file:///foo/bar");
|
fail_unless_equals_string (location, "file:///foo/bar");
|
||||||
g_free (location);
|
g_free (location);
|
||||||
|
location = NULL;
|
||||||
g_object_get (G_OBJECT (src), "location", &location, NULL);
|
g_object_get (G_OBJECT (src), "location", &location, NULL);
|
||||||
fail_unless_equals_string (location, "/foo/bar");
|
fail_unless_equals_string (location, DSEP "foo" DSEP "bar");
|
||||||
g_free (location);
|
g_free (location);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
/* should accept file:///c:/foo/bar.txt URIs */
|
||||||
|
fail_unless (gst_uri_handler_set_uri (GST_URI_HANDLER (src),
|
||||||
|
"file://c:/foo/bar", NULL));
|
||||||
|
location = gst_uri_handler_get_uri (GST_URI_HANDLER (src));
|
||||||
|
fail_unless_equals_string (location, "file://c:/foo/bar");
|
||||||
|
g_free (location);
|
||||||
|
location = NULL;
|
||||||
|
g_object_get (G_OBJECT (src), "location", &location, NULL);
|
||||||
|
fail_unless_equals_string (location, "c:" DSEP "foo" DSEP "bar");
|
||||||
|
g_free (location);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* should accept file://localhost/foo/bar URIs */
|
/* should accept file://localhost/foo/bar URIs */
|
||||||
fail_unless (gst_uri_handler_set_uri (GST_URI_HANDLER (src),
|
fail_unless (gst_uri_handler_set_uri (GST_URI_HANDLER (src),
|
||||||
"file://localhost/foo/baz", NULL));
|
"file://localhost/foo/baz", NULL));
|
||||||
location = gst_uri_handler_get_uri (GST_URI_HANDLER (src));
|
location = gst_uri_handler_get_uri (GST_URI_HANDLER (src));
|
||||||
fail_unless_equals_string (location, "file:///foo/baz");
|
fail_unless_equals_string (location, "file:///foo/baz");
|
||||||
g_free (location);
|
g_free (location);
|
||||||
|
location = NULL;
|
||||||
g_object_get (G_OBJECT (src), "location", &location, NULL);
|
g_object_get (G_OBJECT (src), "location", &location, NULL);
|
||||||
fail_unless_equals_string (location, "/foo/baz");
|
fail_unless_equals_string (location, DSEP "foo" DSEP "baz");
|
||||||
g_free (location);
|
g_free (location);
|
||||||
|
|
||||||
|
#undef DSEP
|
||||||
|
|
||||||
/* should escape non-uri characters for the URI but not for the 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_set (G_OBJECT (src), "location", "/foo/b?r", NULL);
|
||||||
g_object_get (G_OBJECT (src), "location", &location, NULL);
|
g_object_get (G_OBJECT (src), "location", &location, NULL);
|
||||||
|
|
Loading…
Reference in a new issue