[vlc-commits] test: url: add test_url_parse_fixup

Thomas Guillem git at videolan.org
Tue Mar 26 12:06:43 CET 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 26 12:04:39 2019 +0100| [1d83cc91e3c3cd639731dae2baf25f9b98c7dd3c] | committer: Thomas Guillem

test: url: add test_url_parse_fixup

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

 src/test/url.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/test/url.c b/src/test/url.c
index 9db8392471..b16a813a92 100644
--- a/src/test/url.c
+++ b/src/test/url.c
@@ -97,13 +97,20 @@ static inline void test_current_directory_path (const char *in, const char *cwd,
     free(expected_result);
 }
 
-static void test_url_parse(const char *in, const char *protocol,
-                           const char *user, const char *pass,
-                           const char *host, unsigned port,
-                           const char *path, const char *option)
+#define test_url_parse(in, protocol, user, pass, host, port, path, option) \
+    test_url_parse_internal(in, false, protocol, user, pass, host, port, path, option)
+
+#define test_url_parse_fixup(in, protocol, user, pass, host, port, path, option) \
+    test_url_parse_internal(in, true, protocol, user, pass, host, port, path, option)
+
+static void test_url_parse_internal(const char *in, bool fixup,
+                                    const char *protocol,
+                                    const char *user, const char *pass,
+                                    const char *host, unsigned port,
+                                    const char *path, const char *option)
 {
     vlc_url_t url;
-    int ret = vlc_UrlParse(&url, in);
+    int ret = fixup ? vlc_UrlParseFixup(&url, in) : vlc_UrlParse(&url, in);
 
     /* XXX: only checking that the port-part is parsed correctly, and
      *      equal to 0, is currently not supported due to the below. */



More information about the vlc-commits mailing list