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
f6fded8f
Commit
f6fded8f
authored
Jan 03, 2013
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proper cleanup jeez
parent
600d8dbf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
tests-clar/config/read.c
+7
-5
tests-clar/index/tests.c
+8
-11
No files found.
tests-clar/config/read.c
View file @
f6fded8f
#include "clar_libgit2.h"
void
test_config_read__cleanup
(
void
)
{
cl_fixture_cleanup
(
"./empty"
);
}
void
test_config_read__simple_read
(
void
)
{
git_config
*
cfg
;
...
...
@@ -436,11 +431,18 @@ void test_config_read__simple_read_from_specific_level(void)
git_config_free
(
cfg
);
}
static
void
clean_empty_config
(
void
*
unused
)
{
GIT_UNUSED
(
unused
);
cl_fixture_cleanup
(
"./empty"
);
}
void
test_config_read__can_load_and_parse_an_empty_config_file
(
void
)
{
git_config
*
cfg
;
int
i
;
cl_set_cleanup
(
&
clean_empty_config
,
NULL
);
cl_git_mkfile
(
"./empty"
,
""
);
cl_git_pass
(
git_config_open_ondisk
(
&
cfg
,
"./empty"
));
cl_assert_equal_i
(
GIT_ENOTFOUND
,
git_config_get_int32
(
&
i
,
cfg
,
"nope.neither"
));
...
...
tests-clar/index/tests.c
View file @
f6fded8f
...
...
@@ -24,8 +24,6 @@ static struct test_entry test_entries[] = {
{
48
,
"src/revobject.h"
,
1448
,
0x4C3F7FE2
}
};
static
char
*
path_to_cleanup
=
NULL
;
// Helpers
static
void
copy_file
(
const
char
*
src
,
const
char
*
dst
)
{
...
...
@@ -73,14 +71,6 @@ void test_index_tests__initialize(void)
{
}
void
test_index_tests__cleanup
(
void
)
{
if
(
path_to_cleanup
)
cl_fixture_cleanup
(
path_to_cleanup
);
path_to_cleanup
=
NULL
;
}
void
test_index_tests__empty_index
(
void
)
{
git_index
*
index
;
...
...
@@ -207,6 +197,12 @@ void test_index_tests__sort1(void)
git_index_free
(
index
);
}
static
void
cleanup_myrepo
(
void
*
opaque
)
{
GIT_UNUSED
(
opaque
);
cl_fixture_cleanup
(
"myrepo"
);
}
void
test_index_tests__add
(
void
)
{
git_index
*
index
;
...
...
@@ -215,6 +211,8 @@ void test_index_tests__add(void)
const
git_index_entry
*
entry
;
git_oid
id1
;
cl_set_cleanup
(
&
cleanup_myrepo
,
NULL
);
/* Intialize a new repository */
cl_git_pass
(
git_repository_init
(
&
repo
,
"./myrepo"
,
0
));
...
...
@@ -250,7 +248,6 @@ void test_index_tests__add(void)
git_index_free
(
index
);
git_repository_free
(
repo
);
path_to_cleanup
=
"myrepo"
;
}
void
test_index_tests__add_from_workdir_to_a_bare_repository_returns_EBAREPO
(
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