soup-uri: revert some of the previously-added return-if-fails
authorDan Winship <danw@gnome.org>
Thu, 9 Feb 2012 14:35:00 +0000 (09:35 -0500)
committerDan Winship <danw@gnome.org>
Fri, 10 Feb 2012 14:11:25 +0000 (09:11 -0500)
commit6a8814e232f4c1e8f1bc4bf31f6899c1968dfe5e
tree67765798bebc6fd86fc9cdc39bca456935bf05ae
parent6fd3387c84e2440ae7fd375b6d1d464a02ddd8d5
soup-uri: revert some of the previously-added return-if-fails

Although it has always been documented that a SoupURI must have a
non-NULL path, nothing ever enforced this, and most methods checked
whether it was NULL before looking at it anyway. So lots of existing
code was getting this wrong, and is now breaking because of the
"g_return_if_fail (SOUP_URI_IS_VALID (uri))" checks.

So, change most of those to just g_warn_if_fail() (while adding back
the old return-if-fail !NULL checks), but also fix soup_uri_set_path()
and soup_uri_new_with_base() to handle NULL paths more sanely (after
warning). Also, allow calling the getters on invalid URIs.

Add a new test to uri-testing to make sure that URIs created with
soup_uri_new(NULL) behave as expected at each step of the way...

https://bugzilla.gnome.org/show_bug.cgi?id=667637
libsoup/soup-uri.c
tests/uri-parsing.c