[vlc-commits] url: mark test skipped if IDN is not supported

Rémi Denis-Courmont git at videolan.org
Mon Oct 24 10:44:44 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Oct 24 11:44:24 2016 +0300| [f1f363fb37aae825457ae7bac26f826f1f88c43d] | committer: Rémi Denis-Courmont

url: mark test skipped if IDN is not supported

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f1f363fb37aae825457ae7bac26f826f1f88c43d
---

 src/test/url.c | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/src/test/url.c b/src/test/url.c
index 96efd65..bb5a59c 100644
--- a/src/test/url.c
+++ b/src/test/url.c
@@ -25,13 +25,16 @@
 
 #undef NDEBUG
 
-#include <vlc_common.h>
-#include "vlc_url.h"
-#include "vlc_strings.h"
-
+#include <assert.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <assert.h>
+
+#include <vlc_common.h>
+#include <vlc_url.h>
+#include <vlc_strings.h>
+
+static int exitcode = 0;
 
 typedef char * (*conv_t) (const char *);
 
@@ -101,11 +104,20 @@ static void test_url_parse(const char* in, const char* protocol, const char* use
         assert(b != NULL && !strcmp((a), (b)))
 
     vlc_url_t url;
-    vlc_UrlParse( &url, in );
+    int ret = vlc_UrlParse(&url, in);
+
     CHECK( url.psz_protocol, protocol );
     CHECK( url.psz_username, user );
     CHECK( url.psz_password, pass );
-    CHECK( url.psz_host, host );
+
+    if (ret != 0 && errno == ENOSYS)
+    {
+        assert(url.psz_host == NULL);
+        exitcode = 77;
+    }
+    else
+        CHECK(url.psz_host, host);
+
     CHECK( url.psz_path, path );
     assert( url.i_port == i_port );
     CHECK( url.psz_option, option );
@@ -363,5 +375,5 @@ int main (void)
     for (size_t i = 0; i < ARRAY_SIZE(valid_uris); i++)
         test_fixup_noop(valid_uris[i]);
 
-    return 0;
+    return exitcode;
 }



More information about the vlc-commits mailing list