mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 07:44:49 +00:00
tests: object: create sandbox
The object::lookup tests do use the "testrepo.git" repository in a read-only way, so we do not set up the repository as a sandbox but simply open it. But in a future commit, we will want to test looking up objects which are corrupted in some way, which requires us to modify the on-disk data. Doing this in a repository without creating the sandbox will modify contents of our libgit2 repository, though. Create the repository in a sandbox to avoid this.
This commit is contained in:
parent
e29e802966
commit
86c035526d
@ -6,13 +6,12 @@ static git_repository *g_repo;
|
|||||||
|
|
||||||
void test_object_lookup__initialize(void)
|
void test_object_lookup__initialize(void)
|
||||||
{
|
{
|
||||||
cl_git_pass(git_repository_open(&g_repo, cl_fixture("testrepo.git")));
|
g_repo = cl_git_sandbox_init("testrepo.git");
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_object_lookup__cleanup(void)
|
void test_object_lookup__cleanup(void)
|
||||||
{
|
{
|
||||||
git_repository_free(g_repo);
|
cl_git_sandbox_cleanup();
|
||||||
g_repo = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_object_lookup__lookup_wrong_type_returns_enotfound(void)
|
void test_object_lookup__lookup_wrong_type_returns_enotfound(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user