uri: Add test for correct absolute URI handling in gst_uri_from_string_with_base()

If the second parameter is an absolute URI, the base should have no effect and
the second parameter should be returned again.

https://bugzilla.gnome.org/show_bug.cgi?id=755134
This commit is contained in:
Sebastian Dröge 2015-09-16 23:40:44 +02:00
parent 8421a1453c
commit 697093c7d4

View file

@ -782,6 +782,20 @@ GST_START_TEST (test_url_constructors)
g_free (tmp_str);
gst_uri_unref (url2);
url2 = gst_uri_from_string_with_base (url1, "http://foobar.com/bla");
fail_unless_equals_string (gst_uri_get_scheme (url2), "http");
fail_unless_equals_string (gst_uri_get_host (url2), "foobar.com");
fail_unless (gst_uri_get_port (url2) == 0);
tmp_str = gst_uri_get_path (url2);
fail_unless_equals_string (tmp_str, "/bla");
g_free (tmp_str);
fail_unless (gst_uri_get_query_table (url2) == NULL);
fail_unless (gst_uri_get_fragment (url2) == NULL);
tmp_str = gst_uri_to_string (url2);
fail_unless_equals_string (tmp_str, "http://foobar.com/bla");
g_free (tmp_str);
gst_uri_unref (url2);
url2 = gst_uri_copy (url1);
fail_unless (gst_uri_equal (url1, url2));
gst_uri_set_query_value (url2, "key", "value");