diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-11-26 04:59:21 +0100 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-11-26 08:48:00 +0100 |
commit | 45e79e37012ffec58c754000c23077ecac2da753 (patch) | |
tree | 809092609a4ca641ada8990c9008c7fb96c9cc07 /tests | |
parent | 9462c471435b4de74848408bebe41d770dc49a50 (diff) | |
download | libgit2-45e79e37012ffec58c754000c23077ecac2da753.tar.gz |
Rename all `_close` methods
There's no difference between `_free` and `_close` semantics: keep
everything with the same name to avoid confusions.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/t03-objwrite.c | 14 | ||||
-rw-r--r-- | tests/t04-commit.c | 18 | ||||
-rw-r--r-- | tests/t08-tag.c | 22 | ||||
-rw-r--r-- | tests/t09-tree.c | 18 | ||||
-rw-r--r-- | tests/t10-refs.c | 8 |
5 files changed, 40 insertions, 40 deletions
diff --git a/tests/t03-objwrite.c b/tests/t03-objwrite.c index 6cf3834c2..1fc0cac5e 100644 --- a/tests/t03-objwrite.c +++ b/tests/t03-objwrite.c @@ -113,7 +113,7 @@ BEGIN_TEST(write0, "write loose commit object") must_pass(git_odb_read(&obj, db, &id1)); must_pass(cmp_objects(&obj->raw, &commit_obj)); - git_odb_object_close(obj); + git_odb_object_free(obj); git_odb_free(db); must_pass(remove_object_files(&commit)); END_TEST @@ -134,7 +134,7 @@ BEGIN_TEST(write1, "write loose tree object") must_pass(git_odb_read(&obj, db, &id1)); must_pass(cmp_objects(&obj->raw, &tree_obj)); - git_odb_object_close(obj); + git_odb_object_free(obj); git_odb_free(db); must_pass(remove_object_files(&tree)); END_TEST @@ -155,7 +155,7 @@ BEGIN_TEST(write2, "write loose tag object") must_pass(git_odb_read(&obj, db, &id1)); must_pass(cmp_objects(&obj->raw, &tag_obj)); - git_odb_object_close(obj); + git_odb_object_free(obj); git_odb_free(db); must_pass(remove_object_files(&tag)); END_TEST @@ -176,7 +176,7 @@ BEGIN_TEST(write3, "write zero-length object") must_pass(git_odb_read(&obj, db, &id1)); must_pass(cmp_objects(&obj->raw, &zero_obj)); - git_odb_object_close(obj); + git_odb_object_free(obj); git_odb_free(db); must_pass(remove_object_files(&zero)); END_TEST @@ -197,7 +197,7 @@ BEGIN_TEST(write4, "write one-byte long object") must_pass(git_odb_read(&obj, db, &id1)); must_pass(cmp_objects(&obj->raw, &one_obj)); - git_odb_object_close(obj); + git_odb_object_free(obj); git_odb_free(db); must_pass(remove_object_files(&one)); END_TEST @@ -218,7 +218,7 @@ BEGIN_TEST(write5, "write two-byte long object") must_pass(git_odb_read(&obj, db, &id1)); must_pass(cmp_objects(&obj->raw, &two_obj)); - git_odb_object_close(obj); + git_odb_object_free(obj); git_odb_free(db); must_pass(remove_object_files(&two)); END_TEST @@ -239,7 +239,7 @@ BEGIN_TEST(write6, "write an object which is several bytes long") must_pass(git_odb_read(&obj, db, &id1)); must_pass(cmp_objects(&obj->raw, &some_obj)); - git_odb_object_close(obj); + git_odb_object_free(obj); git_odb_free(db); must_pass(remove_object_files(&some)); END_TEST diff --git a/tests/t04-commit.c b/tests/t04-commit.c index d0bb1b583..a0e6037e4 100644 --- a/tests/t04-commit.c +++ b/tests/t04-commit.c @@ -609,18 +609,18 @@ BEGIN_TEST(details0, "query the details on a parsed commit") must_be_true(parents <= 2); for (p = 0;p < parents;p++) { if (old_parent != NULL) - git_commit_close(old_parent); + git_commit_free(old_parent); old_parent = parent; must_pass(git_commit_parent(&parent, commit, p)); must_be_true(parent != NULL); must_be_true(git_commit_author(parent) != NULL); // is it really a commit? } - git_commit_close(old_parent); - git_commit_close(parent); + git_commit_free(old_parent); + git_commit_free(parent); must_fail(git_commit_parent(&parent, commit, parents)); - git_commit_close(commit); + git_commit_free(commit); } git_repository_free(repo); @@ -665,8 +665,8 @@ BEGIN_TEST(write0, "write a new commit object from memory to disk") tree, 1, parent)); - git_object_close((git_object *)parent); - git_object_close((git_object *)tree); + git_object_free((git_object *)parent); + git_object_free((git_object *)tree); git_signature_free(committer); git_signature_free(author); @@ -696,7 +696,7 @@ BEGIN_TEST(write0, "write a new commit object from memory to disk") must_pass(remove_loose_object(REPOSITORY_FOLDER, (git_object *)commit)); - git_commit_close(commit); + git_commit_free(commit); git_repository_free(repo); END_TEST @@ -742,7 +742,7 @@ BEGIN_TEST(root0, "create a root commit") tree, 0)); - git_object_close((git_object *)tree); + git_object_free((git_object *)tree); git_signature_free(committer); git_signature_free(author); @@ -764,7 +764,7 @@ BEGIN_TEST(root0, "create a root commit") must_pass(git_reference_delete(branch)); must_pass(remove_loose_object(REPOSITORY_FOLDER, (git_object *)commit)); git__free(head_old); - git_commit_close(commit); + git_commit_free(commit); git_repository_free(repo); git_reference_free(head); diff --git a/tests/t08-tag.c b/tests/t08-tag.c index 44efb584d..47d7be840 100644 --- a/tests/t08-tag.c +++ b/tests/t08-tag.c @@ -60,9 +60,9 @@ BEGIN_TEST(read0, "read and parse a tag from the repository") must_be_true(git_oid_cmp(&id_commit, git_commit_id(commit)) == 0); - git_tag_close(tag1); - git_tag_close(tag2); - git_commit_close(commit); + git_tag_free(tag1); + git_tag_free(tag2); + git_commit_free(commit); git_repository_free(repo); END_TEST @@ -133,8 +133,8 @@ BEGIN_TEST(read3, "read and parse a tag without a tagger field") must_be_true(git_oid_cmp(&id_commit, git_commit_id(commit)) == 0); - git_tag_close(bad_tag); - git_commit_close(commit); + git_tag_free(bad_tag); + git_commit_free(commit); git_repository_free(repo); END_TEST @@ -170,7 +170,7 @@ BEGIN_TEST(write0, "write a tag to the repository and read it again") TAGGER_MESSAGE, 0)); - git_object_close(target); + git_object_free(target); git_signature_free(tagger); must_pass(git_tag_lookup(&tag, repo, &tag_id)); @@ -195,7 +195,7 @@ BEGIN_TEST(write0, "write a tag to the repository and read it again") must_pass(remove_loose_object(REPOSITORY_FOLDER, (git_object *)tag)); - git_tag_close(tag); + git_tag_free(tag); git_repository_free(repo); END_TEST @@ -222,7 +222,7 @@ BEGIN_TEST(write2, "Attempt to write a tag bearing the same name than an already TAGGER_MESSAGE, 0)); - git_object_close(target); + git_object_free(target); git_signature_free(tagger); git_repository_free(repo); @@ -256,7 +256,7 @@ BEGIN_TEST(write3, "Replace an already existing tag") TAGGER_MESSAGE, 1)); - git_object_close(target); + git_object_free(target); git_signature_free(tagger); must_pass(git_reference_lookup(&ref_tag, repo, "refs/tags/e90810b")); @@ -286,7 +286,7 @@ BEGIN_TEST(write4, "write a lightweight tag to the repository and read it again" target, 0)); - git_object_close(target); + git_object_free(target); must_be_true(git_oid_cmp(&object_id, &target_id) == 0); @@ -320,7 +320,7 @@ BEGIN_TEST(write5, "Attempt to write a lightweight tag bearing the same name tha git_oid_fromstr(&existing_object_id, tag2_id); must_be_true(git_oid_cmp(&object_id, &existing_object_id) == 0); - git_object_close(target); + git_object_free(target); git_repository_free(repo); END_TEST diff --git a/tests/t09-tree.c b/tests/t09-tree.c index 2341a1ca4..8995b45ef 100644 --- a/tests/t09-tree.c +++ b/tests/t09-tree.c @@ -53,13 +53,13 @@ static int print_tree(git_repository *repo, const git_oid *tree_oid, int depth) if (entry->attr == S_IFDIR) { if (print_tree(repo, &entry->oid, depth + 1) < GIT_SUCCESS) { - git_tree_close(tree); + git_tree_free(tree); return GIT_ERROR; } } } - git_tree_close(tree); + git_tree_free(tree); return GIT_SUCCESS; } #endif @@ -83,7 +83,7 @@ BEGIN_TEST(read0, "acces randomly the entries on a loaded tree") must_be_true(git_tree_entry_byindex(tree, 3) == NULL); must_be_true(git_tree_entry_byindex(tree, (unsigned int)-1) == NULL); - git_tree_close(tree); + git_tree_free(tree); git_repository_free(repo); END_TEST @@ -105,7 +105,7 @@ BEGIN_TEST(read1, "read a tree from the repository") /* GH-86: git_object_lookup() should also check the type if the object comes from the cache */ must_be_true(git_object_lookup(&obj, repo, &id, GIT_OBJ_TREE) == 0); must_be_true(obj != NULL); - git_object_close(obj); + git_object_free(obj); obj = NULL; must_be_true(git_object_lookup(&obj, repo, &id, GIT_OBJ_BLOB) == GIT_EINVALIDTYPE); must_be_true(obj == NULL); @@ -118,8 +118,8 @@ BEGIN_TEST(read1, "read a tree from the repository") must_pass(git_tree_entry_2object(&obj, repo, entry)); must_be_true(obj != NULL); - git_object_close(obj); - git_tree_close(tree); + git_object_free(obj); + git_tree_free(tree); git_repository_free(repo); END_TEST @@ -164,7 +164,7 @@ BEGIN_TEST(write2, "write a tree from a memory") must_be_true(git_oid_cmp(&rid, &id2) == 0); git_treebuilder_free(builder); - git_tree_close(tree); + git_tree_free(tree); close_temp_repo(repo); END_TEST @@ -193,7 +193,7 @@ BEGIN_TEST(write3, "write a hierarchical tree from a memory") must_pass(git_treebuilder_insert(NULL,builder,"new",&subtree_id,040000)); must_pass(git_treebuilder_write(&id_hiearar,repo,builder)); git_treebuilder_free(builder); - git_tree_close(tree); + git_tree_free(tree); must_be_true(git_oid_cmp(&id_hiearar, &id3) == 0); @@ -204,7 +204,7 @@ BEGIN_TEST(write3, "write a hierarchical tree from a memory") must_be_true((loose_object_dir_mode(TEMP_REPO_FOLDER, (git_object *)tree) & 0777) == GIT_OBJECT_DIR_MODE); must_be_true((loose_object_mode(TEMP_REPO_FOLDER, (git_object *)tree) & 0777) == GIT_OBJECT_FILE_MODE); #endif - git_tree_close(tree); + git_tree_free(tree); close_temp_repo(repo); diff --git a/tests/t10-refs.c b/tests/t10-refs.c index e5e722992..b00ccfac6 100644 --- a/tests/t10-refs.c +++ b/tests/t10-refs.c @@ -54,7 +54,7 @@ BEGIN_TEST(readtag0, "lookup a loose tag reference") git_path_join(ref_name_from_tag_name, GIT_REFS_TAGS_DIR, git_tag_name((git_tag *)object)); must_be_true(strcmp(ref_name_from_tag_name, loose_tag_ref_name) == 0); - git_object_close(object); + git_object_free(object); git_repository_free(repo); git_reference_free(reference); @@ -99,7 +99,7 @@ BEGIN_TEST(readsym0, "lookup a symbolic reference") git_oid_fromstr(&id, current_master_tip); must_be_true(git_oid_cmp(&id, git_object_id(object)) == 0); - git_object_close(object); + git_object_free(object); git_repository_free(repo); git_reference_free(reference); @@ -129,7 +129,7 @@ BEGIN_TEST(readsym1, "lookup a nested symbolic reference") git_oid_fromstr(&id, current_master_tip); must_be_true(git_oid_cmp(&id, git_object_id(object)) == 0); - git_object_close(object); + git_object_free(object); git_repository_free(repo); git_reference_free(reference); @@ -200,7 +200,7 @@ BEGIN_TEST(readpacked0, "lookup a packed reference") must_be_true(object != NULL); must_be_true(git_object_type(object) == GIT_OBJ_COMMIT); - git_object_close(object); + git_object_free(object); git_repository_free(repo); git_reference_free(reference); |