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
17442b28
Commit
17442b28
authored
Mar 30, 2016
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
leaks: fix some leaks in the tests
parent
97054833
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
2 deletions
+19
-2
tests/config/write.c
+3
-0
tests/iterator/index.c
+2
-0
tests/iterator/tree.c
+4
-0
tests/iterator/workdir.c
+2
-0
tests/status/worktree.c
+8
-2
No files found.
tests/config/write.c
View file @
17442b28
...
...
@@ -712,10 +712,13 @@ void test_config_write__repeated(void)
cl_git_pass
(
git_config_set_string
(
cfg
,
"sample.prefix.setting2"
,
"someValue2"
));
cl_git_pass
(
git_config_set_string
(
cfg
,
"sample.prefix.setting3"
,
"someValue3"
));
cl_git_pass
(
git_config_set_string
(
cfg
,
"sample.prefix.setting4"
,
"someValue4"
));
git_config_free
(
cfg
);
cl_git_pass
(
git_config_open_ondisk
(
&
cfg
,
filename
));
cl_git_pass
(
git_futils_readbuffer
(
&
result
,
filename
));
cl_assert_equal_s
(
expected
,
result
.
ptr
);
git_buf_free
(
&
result
);
git_config_free
(
cfg
);
}
tests/iterator/index.c
View file @
17442b28
...
...
@@ -970,7 +970,9 @@ void test_iterator_index__pathlist_with_directory(void)
cl_git_pass
(
git_iterator_for_index
(
&
i
,
g_repo
,
index
,
&
i_opts
));
expect_iterator_items
(
i
,
4
,
NULL
,
4
,
NULL
);
git_iterator_free
(
i
);
git_index_free
(
index
);
git_tree_free
(
tree
);
git_vector_free
(
&
filelist
);
}
...
...
tests/iterator/tree.c
View file @
17442b28
...
...
@@ -1020,6 +1020,7 @@ void test_iterator_tree__pathlist_with_directory(void)
expect_iterator_items
(
i
,
expected_len2
,
expected2
,
expected_len2
,
expected2
);
git_iterator_free
(
i
);
git_tree_free
(
tree
);
git_vector_free
(
&
filelist
);
}
...
...
@@ -1048,6 +1049,7 @@ void test_iterator_tree__pathlist_with_directory_include_tree_nodes(void)
expect_iterator_items
(
i
,
expected_len
,
expected
,
expected_len
,
expected
);
git_iterator_free
(
i
);
git_tree_free
(
tree
);
git_vector_free
(
&
filelist
);
}
...
...
@@ -1070,7 +1072,9 @@ void test_iterator_tree__pathlist_no_match(void)
cl_git_pass
(
git_iterator_for_tree
(
&
i
,
tree
,
&
i_opts
));
cl_assert_equal_i
(
GIT_ITEROVER
,
git_iterator_current
(
&
entry
,
i
));
git_iterator_free
(
i
);
git_tree_free
(
tree
);
git_vector_free
(
&
filelist
);
}
tests/iterator/workdir.c
View file @
17442b28
...
...
@@ -1030,6 +1030,8 @@ static void create_paths(const char *root, int depth)
create_paths
(
fullpath
.
ptr
,
(
depth
-
1
));
}
}
git_buf_free
(
&
fullpath
);
}
void
test_iterator_workdir__pathlist_for_deeply_nested_item
(
void
)
...
...
tests/status/worktree.c
View file @
17442b28
...
...
@@ -1211,15 +1211,15 @@ void test_status_worktree__with_directory_in_pathlist(void)
const
git_status_entry
*
status
;
size_t
i
,
entrycount
;
bool
native_ignore_case
;
char
*
subdir_path
=
"subdir"
;
cl_git_pass
(
git_repository_index
(
&
index
,
repo
));
native_ignore_case
=
(
git_index_caps
(
index
)
&
GIT_INDEXCAP_IGNORE_CASE
)
!=
0
;
git_index_free
(
index
);
opts
.
pathspec
.
strings
=
&
subdir_path
;
opts
.
pathspec
.
count
=
1
;
opts
.
pathspec
.
strings
=
malloc
(
opts
.
pathspec
.
count
*
sizeof
(
char
*
));
opts
.
pathspec
.
strings
[
0
]
=
"subdir"
;
opts
.
flags
=
GIT_STATUS_OPT_DEFAULTS
|
GIT_STATUS_OPT_INCLUDE_UNMODIFIED
|
...
...
@@ -1240,6 +1240,8 @@ void test_status_worktree__with_directory_in_pathlist(void)
status
->
index_to_workdir
->
old_file
.
path
);
}
git_status_list_free
(
statuslist
);
opts
.
show
=
GIT_STATUS_SHOW_INDEX_ONLY
;
git_status_list_new
(
&
statuslist
,
repo
,
&
opts
);
...
...
@@ -1255,6 +1257,8 @@ void test_status_worktree__with_directory_in_pathlist(void)
status
->
head_to_index
->
old_file
.
path
);
}
git_status_list_free
(
statuslist
);
opts
.
show
=
GIT_STATUS_SHOW_INDEX_AND_WORKDIR
;
git_status_list_new
(
&
statuslist
,
repo
,
&
opts
);
...
...
@@ -1269,5 +1273,7 @@ void test_status_worktree__with_directory_in_pathlist(void)
testrepo2_subdir_paths
[
i
],
status
->
index_to_workdir
->
old_file
.
path
);
}
git_status_list_free
(
statuslist
);
}
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