file{src,sink}: Fix unit tests

filesink and filesrc should return exactly the same URI as passed
and must not escape path separators.
This commit is contained in:
Sebastian Dröge 2011-02-15 22:49:26 +01:00
parent c4be9526eb
commit 39eeab382c
2 changed files with 6 additions and 6 deletions

View file

@ -265,13 +265,13 @@ GST_START_TEST (test_uri_interface)
g_free (location); g_free (location);
location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (filesink)); location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (filesink));
fail_unless_equals_string (location, "file://%2Fi%2Fdo%2Fnot%2Fexist"); fail_unless_equals_string (location, "file:///i/do/not/exist");
/* should accept file:///foo/bar URIs */ /* should accept file:///foo/bar URIs */
fail_unless (gst_uri_handler_set_uri (GST_URI_HANDLER (filesink), fail_unless (gst_uri_handler_set_uri (GST_URI_HANDLER (filesink),
"file:///foo/bar")); "file:///foo/bar"));
location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (filesink)); location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (filesink));
fail_unless_equals_string (location, "file://%2Ffoo%2Fbar"); fail_unless_equals_string (location, "file:///foo/bar");
g_object_get (G_OBJECT (filesink), "location", &location, NULL); g_object_get (G_OBJECT (filesink), "location", &location, NULL);
fail_unless_equals_string (location, "/foo/bar"); fail_unless_equals_string (location, "/foo/bar");
g_free (location); g_free (location);
@ -280,7 +280,7 @@ GST_START_TEST (test_uri_interface)
fail_unless (gst_uri_handler_set_uri (GST_URI_HANDLER (filesink), fail_unless (gst_uri_handler_set_uri (GST_URI_HANDLER (filesink),
"file://localhost/foo/baz")); "file://localhost/foo/baz"));
location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (filesink)); location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (filesink));
fail_unless_equals_string (location, "file://%2Ffoo%2Fbaz"); fail_unless_equals_string (location, "file:///foo/baz");
g_object_get (G_OBJECT (filesink), "location", &location, NULL); g_object_get (G_OBJECT (filesink), "location", &location, NULL);
fail_unless_equals_string (location, "/foo/baz"); fail_unless_equals_string (location, "/foo/baz");
g_free (location); g_free (location);

View file

@ -344,13 +344,13 @@ GST_START_TEST (test_uri_interface)
g_free (location); g_free (location);
location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (src)); location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (src));
fail_unless_equals_string (location, "file://%2Fi%2Fdo%2Fnot%2Fexist"); fail_unless_equals_string (location, "file:///i/do/not/exist");
/* 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")); "file:///foo/bar"));
location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (src)); location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (src));
fail_unless_equals_string (location, "file://%2Ffoo%2Fbar"); fail_unless_equals_string (location, "file:///foo/bar");
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, "/foo/bar");
g_free (location); g_free (location);
@ -359,7 +359,7 @@ GST_START_TEST (test_uri_interface)
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")); "file://localhost/foo/baz"));
location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (src)); location = (gchar *) gst_uri_handler_get_uri (GST_URI_HANDLER (src));
fail_unless_equals_string (location, "file://%2Ffoo%2Fbaz"); fail_unless_equals_string (location, "file:///foo/baz");
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, "/foo/baz");
g_free (location); g_free (location);