[totem-pl-parser] tests: Add checks in resolution test
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem-pl-parser] tests: Add checks in resolution test
- Date: Wed, 8 Dec 2010 12:42:07 +0000 (UTC)
commit 57b47813b5fb2978537ed21d2050c5fad44fd106
Author: Bastien Nocera <hadess hadess net>
Date: Wed Dec 8 12:38:04 2010 +0000
tests: Add checks in resolution test
We need http support so that gvfs's http handling is used to
do the resolution, otherwise it will silently fail.
plparse/tests/parser.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/plparse/tests/parser.c b/plparse/tests/parser.c
index ba1390e..d584200 100644
--- a/plparse/tests/parser.c
+++ b/plparse/tests/parser.c
@@ -91,6 +91,26 @@ test_resolution_real (const char *base_uri,
static void
test_resolution (void)
{
+ const char * const *schemes;
+ gboolean http_supported = FALSE;
+ GVfs *vfs;
+ guint i;
+
+ vfs = g_vfs_get_default ();
+ if (vfs == NULL)
+ g_error ("gvfs with http support is required to test link resolution");
+ schemes = g_vfs_get_supported_uri_schemes (vfs);
+ if (schemes == NULL)
+ g_error ("gvfs with http support is required to test link resolution");
+ for (i = 0; schemes[i] != NULL; i++) {
+ if (g_str_equal (schemes[i], "http")) {
+ http_supported = TRUE;
+ break;
+ }
+ }
+ if (http_supported == FALSE)
+ g_error ("gvfs is installed but does not support http");
+
/* http://bugzilla.gnome.org/show_bug.cgi?id=555417 */
g_assert_cmpstr (test_resolution_real ("http://www.yle.fi/player/player.jsp", "288629.asx?s=1000"), ==, "http://www.yle.fi/player/288629.asx?s=1000");
g_assert_cmpstr (test_resolution_real ("http://www.yle.fi/player/player.jsp?actionpage=3&id=288629&locale", "288629.asx?s=1000"), ==, "http://www.yle.fi/player/288629.asx?s=1000");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]