From: Sebastian Dröge Date: Wed, 16 Sep 2015 21:40:44 +0000 (+0200) Subject: uri: Add test for correct absolute URI handling in gst_uri_from_string_with_base() X-Git-Tag: 1.10.4~779 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=697093c7d405257738e8e67cbe4a14bb88fc79a2;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/tests/check/gst/gsturi.c b/tests/check/gst/gsturi.c index 3d80098..4da6aba 100644 --- a/tests/check/gst/gsturi.c +++ b/tests/check/gst/gsturi.c @@ -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");