Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
bffbeebb
Commit
bffbeebb
authored
Jan 03, 2013
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup after tests
parent
6fef1ab3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
tests-clar/config/read.c
+1
-0
tests-clar/pack/packbuilder.c
+22
-0
tests-clar/stash/save.c
+1
-0
No files found.
tests-clar/config/read.c
View file @
bffbeebb
...
...
@@ -441,6 +441,7 @@ void test_config_read__can_load_and_parse_an_empty_config_file(void)
cl_assert_equal_i
(
GIT_ENOTFOUND
,
git_config_get_int32
(
&
i
,
cfg
,
"nope.neither"
));
git_config_free
(
cfg
);
cl_fixture_cleanup
(
"./empty"
);
}
void
test_config_read__cannot_load_a_non_existing_config_file
(
void
)
...
...
tests-clar/pack/packbuilder.c
View file @
bffbeebb
#include "clar_libgit2.h"
#include "iterator.h"
#include "vector.h"
#include "posix.h"
static
git_repository
*
_repo
;
static
git_revwalk
*
_revwalker
;
...
...
@@ -72,6 +73,21 @@ static void seed_packbuilder(void)
}
}
static
void
cleanup_pack
(
const
git_oid
*
oid
)
{
char
*
hash
,
path
[
1024
]
=
{
0
};
hash
=
git_oid_allocfmt
(
oid
);
sprintf
(
path
,
"pack-%s.idx"
,
hash
);
p_unlink
(
path
);
sprintf
(
path
,
"pack-%s.pack"
,
hash
);
p_unlink
(
path
);
git__free
(
hash
);
}
void
test_pack_packbuilder__create_pack
(
void
)
{
git_transfer_progress
stats
;
...
...
@@ -82,6 +98,9 @@ void test_pack_packbuilder__create_pack(void)
cl_git_pass
(
git_indexer_new
(
&
_indexer
,
"testpack.pack"
));
cl_git_pass
(
git_indexer_run
(
_indexer
,
&
stats
));
cl_git_pass
(
git_indexer_write
(
_indexer
));
cl_fixture_cleanup
(
"testpack.pack"
);
cleanup_pack
(
git_indexer_hash
(
_indexer
));
}
static
git_transfer_progress
stats
;
...
...
@@ -97,10 +116,13 @@ static int foreach_cb(void *buf, size_t len, void *payload)
void
test_pack_packbuilder__foreach
(
void
)
{
git_indexer_stream
*
idx
;
git_oid
oid
;
seed_packbuilder
();
cl_git_pass
(
git_indexer_stream_new
(
&
idx
,
"."
,
NULL
,
NULL
));
cl_git_pass
(
git_packbuilder_foreach
(
_packbuilder
,
foreach_cb
,
idx
));
cl_git_pass
(
git_indexer_stream_finalize
(
idx
,
&
stats
));
git_oid_cpy
(
&
oid
,
git_indexer_stream_hash
(
idx
));
git_indexer_stream_free
(
idx
);
cleanup_pack
(
&
oid
);
}
tests-clar/stash/save.c
View file @
bffbeebb
...
...
@@ -211,6 +211,7 @@ void test_stash_save__cannot_stash_against_a_bare_repository(void)
git_stash_save
(
&
stash_tip_oid
,
local
,
signature
,
NULL
,
GIT_STASH_DEFAULT
));
git_repository_free
(
local
);
cl_fixture_cleanup
(
"sorry-it-is-a-non-bare-only-party"
);
}
void
test_stash_save__can_stash_against_a_detached_head
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment