diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2020-01-18 13:51:40 +0000 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2020-01-26 18:39:41 +0000 |
commit | 3f54ba8b61869f42b2bbd1a60091a0be640bc8fc (patch) | |
tree | d2ea442f1ab5ecb7a0f8c10d3a26664bc4c44cdc /tests/network | |
parent | 4460bf40c9e935acb853b5d61279a50014ede0b3 (diff) | |
download | libgit2-3f54ba8b61869f42b2bbd1a60091a0be640bc8fc.tar.gz |
credential: change git_cred to git_credentialethomson/credtype
We avoid abbreviations where possible; rename git_cred to
git_credential.
In addition, we have standardized on a trailing `_t` for enum types,
instead of using "type" in the name. So `git_credtype_t` has become
`git_credential_t` and its members have become `GIT_CREDENTIAL` instead
of `GIT_CREDTYPE`.
Finally, the source and header files have been renamed to `credential`
instead of `cred`.
Keep previous name and values as deprecated, and include the new header
files from the previous ones.
Diffstat (limited to 'tests/network')
-rw-r--r-- | tests/network/cred.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/network/cred.c b/tests/network/cred.c index d35e2b2ac..5e4db7599 100644 --- a/tests/network/cred.c +++ b/tests/network/cred.c @@ -4,43 +4,43 @@ void test_network_cred__stock_userpass_validates_args(void) { - git_cred_userpass_payload payload = {0}; + git_credential_userpass_payload payload = {0}; - cl_git_fail(git_cred_userpass(NULL, NULL, NULL, 0, NULL)); + cl_git_fail(git_credential_userpass(NULL, NULL, NULL, 0, NULL)); payload.username = "user"; - cl_git_fail(git_cred_userpass(NULL, NULL, NULL, 0, &payload)); + cl_git_fail(git_credential_userpass(NULL, NULL, NULL, 0, &payload)); payload.username = NULL; payload.username = "pass"; - cl_git_fail(git_cred_userpass(NULL, NULL, NULL, 0, &payload)); + cl_git_fail(git_credential_userpass(NULL, NULL, NULL, 0, &payload)); } void test_network_cred__stock_userpass_validates_that_method_is_allowed(void) { - git_cred *cred; - git_cred_userpass_payload payload = {"user", "pass"}; + git_credential *cred; + git_credential_userpass_payload payload = {"user", "pass"}; - cl_git_fail(git_cred_userpass(&cred, NULL, NULL, 0, &payload)); - cl_git_pass(git_cred_userpass(&cred, NULL, NULL, GIT_CREDTYPE_USERPASS_PLAINTEXT, &payload)); - git_cred_free(cred); + cl_git_fail(git_credential_userpass(&cred, NULL, NULL, 0, &payload)); + cl_git_pass(git_credential_userpass(&cred, NULL, NULL, GIT_CREDENTIAL_USERPASS_PLAINTEXT, &payload)); + git_credential_free(cred); } void test_network_cred__stock_userpass_properly_handles_username_in_url(void) { - git_cred *cred; - git_cred_userpass_payload payload = {"alice", "password"}; + git_credential *cred; + git_credential_userpass_payload payload = {"alice", "password"}; - cl_git_pass(git_cred_userpass(&cred, NULL, NULL, GIT_CREDTYPE_USERPASS_PLAINTEXT, &payload)); - cl_assert_equal_s("alice", git_cred_get_username(cred)); - git_cred_free(cred); + cl_git_pass(git_credential_userpass(&cred, NULL, NULL, GIT_CREDENTIAL_USERPASS_PLAINTEXT, &payload)); + cl_assert_equal_s("alice", git_credential_get_username(cred)); + git_credential_free(cred); - cl_git_pass(git_cred_userpass(&cred, NULL, "bob", GIT_CREDTYPE_USERPASS_PLAINTEXT, &payload)); - cl_assert_equal_s("alice", git_cred_get_username(cred)); - git_cred_free(cred); + cl_git_pass(git_credential_userpass(&cred, NULL, "bob", GIT_CREDENTIAL_USERPASS_PLAINTEXT, &payload)); + cl_assert_equal_s("alice", git_credential_get_username(cred)); + git_credential_free(cred); payload.username = NULL; - cl_git_pass(git_cred_userpass(&cred, NULL, "bob", GIT_CREDTYPE_USERPASS_PLAINTEXT, &payload)); - cl_assert_equal_s("bob", git_cred_get_username(cred)); - git_cred_free(cred); + cl_git_pass(git_credential_userpass(&cred, NULL, "bob", GIT_CREDENTIAL_USERPASS_PLAINTEXT, &payload)); + cl_assert_equal_s("bob", git_credential_get_username(cred)); + git_credential_free(cred); } |