lib1560: test CURLU_DEFAULT_PORT more

Closes #22314
This commit is contained in:
Daniel Stenberg 2026-07-13 21:52:53 +02:00
parent d0545d223a
commit f2fda908f9
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 62 additions and 1 deletions

View file

@ -36,7 +36,7 @@ lib%TESTNUMBER
success
</stdout>
<limits>
Allocations: 3450
Allocations: 3550
</limits>
</verify>
</testcase>

View file

@ -554,9 +554,70 @@ static const struct testcase get_parts_list[] = {
{"file:///hello.html",
"file | [11] | [12] | [13] | [14] | [15] | /hello.html | [16] | [17]",
0, 0, CURLUE_OK},
/* verify that we get the right default ports */
{"https://127.0.0.1",
"https | [11] | [12] | [13] | 127.0.0.1 | 443 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"http://127.0.0.1",
"http | [11] | [12] | [13] | 127.0.0.1 | 80 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"ftp://127.0.0.1",
"ftp | [11] | [12] | [13] | 127.0.0.1 | 21 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"ftps://127.0.0.1",
"ftps | [11] | [12] | [13] | 127.0.0.1 | 990 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"scp://127.0.0.1",
"scp | [11] | [12] | [13] | 127.0.0.1 | 22 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"sftp://127.0.0.1",
"sftp | [11] | [12] | [13] | 127.0.0.1 | 22 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"imap://127.0.0.1",
"imap | [11] | [12] | [13] | 127.0.0.1 | 143 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"imaps://127.0.0.1",
"imaps | [11] | [12] | [13] | 127.0.0.1 | 993 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"smtp://127.0.0.1",
"smtp | [11] | [12] | [13] | 127.0.0.1 | 25 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"smtps://127.0.0.1",
"smtps | [11] | [12] | [13] | 127.0.0.1 | 465 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"pop3://127.0.0.1",
"pop3 | [11] | [12] | [13] | 127.0.0.1 | 110 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"pop3s://127.0.0.1",
"pop3s | [11] | [12] | [13] | 127.0.0.1 | 995 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
#ifndef CURL_DISABLE_WEBSOCKETS
{"ws://127.0.0.1",
"ws | [11] | [12] | [13] | 127.0.0.1 | 80 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"wss://127.0.0.1",
"wss | [11] | [12] | [13] | 127.0.0.1 | 443 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
#endif
{"telnet://127.0.0.1",
"telnet | [11] | [12] | [13] | 127.0.0.1 | 23 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"gopher://127.0.0.1",
"gopher | [11] | [12] | [13] | 127.0.0.1 | 70 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"gophers://127.0.0.1",
"gophers | [11] | [12] | [13] | 127.0.0.1 | 70 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
#ifndef CURL_DISABLE_LDAP
{"ldap://127.0.0.1",
"ldap | [11] | [12] | [13] | 127.0.0.1 | 389 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
{"ldaps://127.0.0.1",
"ldaps | [11] | [12] | [13] | 127.0.0.1 | 636 | / | [16] | [17]",
0, CURLU_DEFAULT_PORT, CURLUE_OK},
#endif
{"https://127.0.0.1",
"https | [11] | [12] | [13] | 127.0.0.1 | [15] | / | [16] | [17]",
CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},