summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2023-05-05 16:13:40 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2023-05-06 14:33:49 +0100
commitf1ef8ebee3ee21afba3ad1ad1335d34371a61d05 (patch)
treeec81af6928f2a37403ae2bb385c96af528f1f2c4 /tests
parent30917576ad5236885774816da1be26aa231355b0 (diff)
downloadlibgit2-f1ef8ebee3ee21afba3ad1ad1335d34371a61d05.tar.gz
odb: test object lookups from git_repository_wrap_odb
Diffstat (limited to 'tests')
-rw-r--r--tests/libgit2/odb/backend/loose.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/libgit2/odb/backend/loose.c b/tests/libgit2/odb/backend/loose.c
index 781b61d9f..f5a0b4f5c 100644
--- a/tests/libgit2/odb/backend/loose.c
+++ b/tests/libgit2/odb/backend/loose.c
@@ -32,7 +32,7 @@ void test_odb_backend_loose__cleanup(void)
cl_fixture_cleanup("testrepo.git");
}
-void test_odb_backend_loose__read(void)
+void test_odb_backend_loose__read_from_odb(void)
{
git_oid oid;
git_odb_object *obj;
@@ -40,4 +40,23 @@ void test_odb_backend_loose__read(void)
cl_git_pass(git_oid__fromstr(&oid, "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OID_SHA1));
cl_git_pass(git_odb_read(&obj, _odb, &oid));
git_odb_object_free(obj);
+
+ cl_git_pass(git_oid__fromstr(&oid, "fd093bff70906175335656e6ce6ae05783708765", GIT_OID_SHA1));
+ cl_git_pass(git_odb_read(&obj, _odb, &oid));
+ git_odb_object_free(obj);
+}
+
+void test_odb_backend_loose__read_from_repo(void)
+{
+ git_oid oid;
+ git_blob *blob;
+ git_tree *tree;
+
+ cl_git_pass(git_oid__fromstr(&oid, "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OID_SHA1));
+ cl_git_pass(git_blob_lookup(&blob, _repo, &oid));
+ git_blob_free(blob);
+
+ cl_git_pass(git_oid__fromstr(&oid, "fd093bff70906175335656e6ce6ae05783708765", GIT_OID_SHA1));
+ cl_git_pass(git_tree_lookup(&tree, _repo, &oid));
+ git_tree_free(tree);
}