Commit f1ef8ebe by Edward Thomson

odb: test object lookups from git_repository_wrap_odb

parent 30917576
...@@ -32,7 +32,7 @@ void test_odb_backend_loose__cleanup(void) ...@@ -32,7 +32,7 @@ void test_odb_backend_loose__cleanup(void)
cl_fixture_cleanup("testrepo.git"); 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_oid oid;
git_odb_object *obj; git_odb_object *obj;
...@@ -40,4 +40,23 @@ void test_odb_backend_loose__read(void) ...@@ -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_oid__fromstr(&oid, "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OID_SHA1));
cl_git_pass(git_odb_read(&obj, _odb, &oid)); cl_git_pass(git_odb_read(&obj, _odb, &oid));
git_odb_object_free(obj); 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);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment