diff options
| author | Kirill A. Shutemov <kirill@shutemov.name> | 2011-07-15 18:34:20 +0300 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-07-25 21:12:47 +0200 |
| commit | 84ef7f3636ce163f8e5954a0541f76b8852b1a22 (patch) | |
| tree | 2b8aecd9f6043b68bce3432ffd3ae105fcafb06f /tests/t04-commit.c | |
| parent | b75bec94f816a97a3e610bed9f813112e9f316a9 (diff) | |
| download | libgit2-84ef7f3636ce163f8e5954a0541f76b8852b1a22.tar.gz | |
tests: fix cast warnings
/home/kas/git/public/libgit2/tests/t00-core.c: In function ‘test_cmp’:
/home/kas/git/public/libgit2/tests/t00-core.c:78:10: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/tests/t00-core.c:78:22: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/tests/t07-hashtable.c: In function ‘hash_func’:
/home/kas/git/public/libgit2/tests/t07-hashtable.c:42:7: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/tests/t08-tag.c: In function ‘_gittest__write0’:
/home/kas/git/public/libgit2/tests/t08-tag.c:141:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/tests/t08-tag.c: In function ‘_gittest__write2’:
/home/kas/git/public/libgit2/tests/t08-tag.c:192:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/tests/t08-tag.c: In function ‘_gittest__write3’:
/home/kas/git/public/libgit2/tests/t08-tag.c:227:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/tests/t04-commit.c: In function ‘_gittest__write0’:
/home/kas/git/public/libgit2/tests/t04-commit.c:650:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/tests/t04-commit.c:651:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/tests/t04-commit.c: In function ‘_gittest__root0’:
/home/kas/git/public/libgit2/tests/t04-commit.c:723:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/tests/t04-commit.c:724:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/tests/t12-repo.c: In function ‘write_file’:
/home/kas/git/public/libgit2/tests/t12-repo.c:360:24: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Diffstat (limited to 'tests/t04-commit.c')
| -rw-r--r-- | tests/t04-commit.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/tests/t04-commit.c b/tests/t04-commit.c index 1c390824a..53f0faefb 100644 --- a/tests/t04-commit.c +++ b/tests/t04-commit.c @@ -615,7 +615,8 @@ BEGIN_TEST(write0, "write a new commit object from memory to disk") git_repository *repo; git_commit *commit; git_oid tree_id, parent_id, commit_id; - const git_signature *author, *committer; + git_signature *author, *committer; + const git_signature *author1, *committer1; git_commit *parent; git_tree *tree; @@ -647,25 +648,25 @@ BEGIN_TEST(write0, "write a new commit object from memory to disk") git_object_close((git_object *)parent); git_object_close((git_object *)tree); - git_signature_free((git_signature *)committer); - git_signature_free((git_signature *)author); + git_signature_free(committer); + git_signature_free(author); must_pass(git_commit_lookup(&commit, repo, &commit_id)); /* Check attributes were set correctly */ - author = git_commit_author(commit); - must_be_true(author != NULL); - must_be_true(strcmp(author->name, COMMITTER_NAME) == 0); - must_be_true(strcmp(author->email, COMMITTER_EMAIL) == 0); - must_be_true(author->when.time == 987654321); - must_be_true(author->when.offset == 90); - - committer = git_commit_committer(commit); - must_be_true(committer != NULL); - must_be_true(strcmp(committer->name, COMMITTER_NAME) == 0); - must_be_true(strcmp(committer->email, COMMITTER_EMAIL) == 0); - must_be_true(committer->when.time == 123456789); - must_be_true(committer->when.offset == 60); + author1 = git_commit_author(commit); + must_be_true(author1 != NULL); + must_be_true(strcmp(author1->name, COMMITTER_NAME) == 0); + must_be_true(strcmp(author1->email, COMMITTER_EMAIL) == 0); + must_be_true(author1->when.time == 987654321); + must_be_true(author1->when.offset == 90); + + committer1 = git_commit_committer(commit); + must_be_true(committer1 != NULL); + must_be_true(strcmp(committer1->name, COMMITTER_NAME) == 0); + must_be_true(strcmp(committer1->email, COMMITTER_EMAIL) == 0); + must_be_true(committer1->when.time == 123456789); + must_be_true(committer1->when.offset == 60); must_be_true(strcmp(git_commit_message(commit), COMMIT_MESSAGE) == 0); @@ -683,7 +684,7 @@ BEGIN_TEST(root0, "create a root commit") git_commit *commit; git_oid tree_id, commit_id; const git_oid *branch_oid; - const git_signature *author, *committer; + git_signature *author, *committer; const char *branch_name = "refs/heads/root-commit-branch"; git_reference *head, *branch; char *head_old; @@ -720,8 +721,8 @@ BEGIN_TEST(root0, "create a root commit") 0)); git_object_close((git_object *)tree); - git_signature_free((git_signature *)committer); - git_signature_free((git_signature *)author); + git_signature_free(committer); + git_signature_free(author); /* * The fact that creating a commit works has already been |
