ports/devel/libgit2/files/patch-tests_network_url_parse.c
Daniel Engberg 5c8d1c24f8 devel/libgit2: Update to 1.3.0
Use DISTVERSION and USE_GIT to follow Porter's Handbook more closely
Use PCRE2 by default instead of PCRE(1)
Use http-parser library from ports rather than bundled version as per recommendation in Porter's Handbook
Import patch to remove incompatible tests

Reference:
https://github.com/archlinux/svntogit-packages/blob/packages/libgit2/trunk/libgit2-1.2.0-remove_http-parse_incompatible_tests.patch (see commit history)

PR:		258484
2021-12-04 13:07:23 +01:00

116 lines
4.4 KiB
C

--- tests/network/url/parse.c.orig 2021-09-27 20:09:50 UTC
+++ tests/network/url/parse.c
@@ -63,18 +63,6 @@ void test_network_url_parse__hostname_implied_root_cus
cl_assert_equal_i(git_net_url_is_default_port(&conndata), 0);
}
-void test_network_url_parse__hostname_implied_root_empty_port(void)
-{
- cl_git_pass(git_net_url_parse(&conndata, "http://example.com:"));
- cl_assert_equal_s(conndata.scheme, "http");
- cl_assert_equal_s(conndata.host, "example.com");
- cl_assert_equal_s(conndata.port, "80");
- cl_assert_equal_s(conndata.path, "/");
- cl_assert_equal_p(conndata.username, NULL);
- cl_assert_equal_p(conndata.password, NULL);
- cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
-}
-
void test_network_url_parse__hostname_encoded_password(void)
{
cl_git_pass(git_net_url_parse(&conndata,
@@ -129,18 +117,6 @@ void test_network_url_parse__hostname_port(void)
cl_assert_equal_i(git_net_url_is_default_port(&conndata), 0);
}
-void test_network_url_parse__hostname_empty_port(void)
-{
- cl_git_pass(git_net_url_parse(&conndata, "http://example.com:/resource"));
- cl_assert_equal_s(conndata.scheme, "http");
- cl_assert_equal_s(conndata.host, "example.com");
- cl_assert_equal_s(conndata.port, "80");
- cl_assert_equal_s(conndata.path, "/resource");
- cl_assert_equal_p(conndata.username, NULL);
- cl_assert_equal_p(conndata.password, NULL);
- cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
-}
-
void test_network_url_parse__hostname_user_port(void)
{
/* user@hostname.tld:port/resource */
@@ -219,18 +195,6 @@ void test_network_url_parse__ipv4_implied_root_custom_
cl_assert_equal_i(git_net_url_is_default_port(&conndata), 0);
}
-void test_network_url_parse__ipv4_implied_root_empty_port(void)
-{
- cl_git_pass(git_net_url_parse(&conndata, "http://192.168.1.1:"));
- cl_assert_equal_s(conndata.scheme, "http");
- cl_assert_equal_s(conndata.host, "192.168.1.1");
- cl_assert_equal_s(conndata.port, "80");
- cl_assert_equal_s(conndata.path, "/");
- cl_assert_equal_p(conndata.username, NULL);
- cl_assert_equal_p(conndata.password, NULL);
- cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
-}
-
void test_network_url_parse__ipv4_encoded_password(void)
{
cl_git_pass(git_net_url_parse(&conndata,
@@ -283,18 +247,6 @@ void test_network_url_parse__ipv4_port(void)
cl_assert_equal_i(git_net_url_is_default_port(&conndata), 0);
}
-void test_network_url_parse__ipv4_empty_port(void)
-{
- cl_git_pass(git_net_url_parse(&conndata, "http://192.168.1.1:/resource"));
- cl_assert_equal_s(conndata.scheme, "http");
- cl_assert_equal_s(conndata.host, "192.168.1.1");
- cl_assert_equal_s(conndata.port, "80");
- cl_assert_equal_s(conndata.path, "/resource");
- cl_assert_equal_p(conndata.username, NULL);
- cl_assert_equal_p(conndata.password, NULL);
- cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
-}
-
void test_network_url_parse__ipv4_user_port(void)
{
cl_git_pass(git_net_url_parse(&conndata,
@@ -371,18 +323,6 @@ void test_network_url_parse__ipv6_implied_root_custom_
cl_assert_equal_i(git_net_url_is_default_port(&conndata), 0);
}
-void test_network_url_parse__ipv6_implied_root_empty_port(void)
-{
- cl_git_pass(git_net_url_parse(&conndata, "http://[fe80::dcad:beff:fe00:0001]:"));
- cl_assert_equal_s(conndata.scheme, "http");
- cl_assert_equal_s(conndata.host, "fe80::dcad:beff:fe00:0001");
- cl_assert_equal_s(conndata.port, "80");
- cl_assert_equal_s(conndata.path, "/");
- cl_assert_equal_p(conndata.username, NULL);
- cl_assert_equal_p(conndata.password, NULL);
- cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
-}
-
void test_network_url_parse__ipv6_encoded_password(void)
{
cl_git_pass(git_net_url_parse(&conndata,
@@ -433,18 +373,6 @@ void test_network_url_parse__ipv6_port(void)
cl_assert_equal_p(conndata.username, NULL);
cl_assert_equal_p(conndata.password, NULL);
cl_assert_equal_i(git_net_url_is_default_port(&conndata), 0);
-}
-
-void test_network_url_parse__ipv6_empty_port(void)
-{
- cl_git_pass(git_net_url_parse(&conndata, "http://[fe80::dcad:beff:fe00:0001]:/resource"));
- cl_assert_equal_s(conndata.scheme, "http");
- cl_assert_equal_s(conndata.host, "fe80::dcad:beff:fe00:0001");
- cl_assert_equal_s(conndata.port, "80");
- cl_assert_equal_s(conndata.path, "/resource");
- cl_assert_equal_p(conndata.username, NULL);
- cl_assert_equal_p(conndata.password, NULL);
- cl_assert_equal_i(git_net_url_is_default_port(&conndata), 1);
}
void test_network_url_parse__ipv6_user_port(void)