mirror of
https://github.com/curl/curl.git
synced 2026-05-30 14:57:32 +03:00
parent
4f1646ef8a
commit
d8e3376c18
1 changed files with 8 additions and 4 deletions
|
|
@ -56,44 +56,48 @@ static CURLcode test_unit1304(const char *arg)
|
|||
/*
|
||||
* Test a non existent login in our netrc file.
|
||||
*/
|
||||
login = (char *)CURL_UNCONST("me");
|
||||
login = curlx_strdup("me");
|
||||
Curl_netrc_init(&store);
|
||||
result = Curl_parsenetrc(&store, "example.com", &login, &password, arg);
|
||||
fail_unless(result == 0, "Host should have been found");
|
||||
abort_unless(password == NULL, "password is not NULL!");
|
||||
Curl_netrc_cleanup(&store);
|
||||
curlx_free(login);
|
||||
|
||||
/*
|
||||
* Test a non existent login and host in our netrc file.
|
||||
*/
|
||||
login = (char *)CURL_UNCONST("me");
|
||||
login = curlx_strdup("me");
|
||||
Curl_netrc_init(&store);
|
||||
result = Curl_parsenetrc(&store, "test.example.com", &login, &password, arg);
|
||||
fail_unless(result == 1, "Host not found should return 1");
|
||||
abort_unless(password == NULL, "password is not NULL!");
|
||||
Curl_netrc_cleanup(&store);
|
||||
curlx_free(login);
|
||||
|
||||
/*
|
||||
* Test a non existent login (substring of an existing one) in our
|
||||
* netrc file.
|
||||
*/
|
||||
login = (char *)CURL_UNCONST("admi"); /* spellchecker:disable-line */
|
||||
login = curlx_strdup("admi"); /* spellchecker:disable-line */
|
||||
Curl_netrc_init(&store);
|
||||
result = Curl_parsenetrc(&store, "example.com", &login, &password, arg);
|
||||
fail_unless(result == 0, "Host should have been found");
|
||||
abort_unless(password == NULL, "password is not NULL!");
|
||||
Curl_netrc_cleanup(&store);
|
||||
curlx_free(login);
|
||||
|
||||
/*
|
||||
* Test a non existent login (superstring of an existing one)
|
||||
* in our netrc file.
|
||||
*/
|
||||
login = (char *)CURL_UNCONST("adminn");
|
||||
login = curlx_strdup("adminn");
|
||||
Curl_netrc_init(&store);
|
||||
result = Curl_parsenetrc(&store, "example.com", &login, &password, arg);
|
||||
fail_unless(result == 0, "Host should have been found");
|
||||
abort_unless(password == NULL, "password is not NULL!");
|
||||
Curl_netrc_cleanup(&store);
|
||||
curlx_free(login);
|
||||
|
||||
/*
|
||||
* Test for the first existing host in our netrc file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue