tests/uri: fix test after GHashTable changes in GLib 2.59

Maybe the implementation should not be dependent on a "random" hash-table
ordering, but at least this shows the problem clearly.
This commit is contained in:
Havard Graff 2018-10-31 10:27:23 +01:00 committed by Tim-Philipp Müller
parent ef58a84571
commit 4a7739f4b6

View file

@ -414,7 +414,11 @@ static const struct URITest url_presenting_tests[] = {
{.uri = {"scheme", "user:pass", "host", 1234, "/path/to/dir",
{{"query", NULL}, {"key", "value"}}, "fragment"},
.str =
#if GLIB_CHECK_VERSION(2, 59, 0)
"scheme://user:pass@host:1234/path/to/dir?key=value&query#fragment"},
#else
"scheme://user:pass@host:1234/path/to/dir?query&key=value#fragment"},
#endif
/* IPv6 literal should render in square brackets */
{.uri = {"scheme", "user:pass", "12:34:56:78:9a:bc:de:f0", 1234,
@ -977,14 +981,24 @@ GST_START_TEST (test_url_get_set)
fail_unless (gst_uri_set_query_value (url, "key", "value"));
tmp_str = gst_uri_to_string (url);
#if GLIB_CHECK_VERSION(2, 59, 0)
fail_unless_equals_string (tmp_str,
"//example.com/path/to/file/there/segment?key=value&query#fragment");
#else
fail_unless_equals_string (tmp_str,
"//example.com/path/to/file/there/segment?query&key=value#fragment");
#endif
g_free (tmp_str);
fail_unless (gst_uri_set_query_value (url, "key", NULL));
tmp_str = gst_uri_to_string (url);
#if GLIB_CHECK_VERSION(2, 59, 0)
fail_unless_equals_string (tmp_str,
"//example.com/path/to/file/there/segment?key&query#fragment");
#else
fail_unless_equals_string (tmp_str,
"//example.com/path/to/file/there/segment?query&key#fragment");
#endif
g_free (tmp_str);
fail_unless (!gst_uri_set_query_value (NULL, "key", "value"));