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
c52480fd
Commit
c52480fd
authored
Feb 17, 2017
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`cl_git_exec` -> `cl_git_expect`
parent
a1dcc830
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
tests/attr/ignore.c
+1
-1
tests/clar_libgit2.h
+3
-3
tests/repo/env.c
+6
-6
tests/status/ignore.c
+1
-1
No files found.
tests/attr/ignore.c
View file @
c52480fd
...
...
@@ -21,7 +21,7 @@ static void assert_is_ignored_(
{
int
is_ignored
=
0
;
cl_git_ex
ec
(
cl_git_ex
pect
(
git_ignore_path_is_ignored
(
&
is_ignored
,
g_repo
,
filepath
),
0
,
file
,
line
);
clar__assert_equal
(
...
...
tests/clar_libgit2.h
View file @
c52480fd
...
...
@@ -12,11 +12,11 @@
*
* Use this wrapper around all `git_` library calls that return error codes!
*/
#define cl_git_pass(expr) cl_git_ex
ec
((expr), 0, __FILE__, __LINE__)
#define cl_git_pass(expr) cl_git_ex
pect
((expr), 0, __FILE__, __LINE__)
#define cl_git_fail_with(error, expr) cl_git_ex
ec
((expr), error, __FILE__, __LINE__)
#define cl_git_fail_with(error, expr) cl_git_ex
pect
((expr), error, __FILE__, __LINE__)
#define cl_git_ex
ec
(expr, expected, file, line) do { \
#define cl_git_ex
pect
(expr, expected, file, line) do { \
int _lg2_error; \
giterr_clear(); \
if ((_lg2_error = (expr)) != expected) \
...
...
tests/repo/env.c
View file @
c52480fd
...
...
@@ -56,8 +56,8 @@ static int GIT_FORMAT_PRINTF(2, 3) cl_setenv_printf(const char *name, const char
static
void
env_pass_
(
const
char
*
path
,
const
char
*
file
,
int
line
)
{
git_repository
*
repo
;
cl_git_ex
ec
(
git_repository_open_ext
(
NULL
,
path
,
GIT_REPOSITORY_OPEN_FROM_ENV
,
NULL
),
0
,
file
,
line
);
cl_git_ex
ec
(
git_repository_open_ext
(
&
repo
,
path
,
GIT_REPOSITORY_OPEN_FROM_ENV
,
NULL
),
0
,
file
,
line
);
cl_git_ex
pect
(
git_repository_open_ext
(
NULL
,
path
,
GIT_REPOSITORY_OPEN_FROM_ENV
,
NULL
),
0
,
file
,
line
);
cl_git_ex
pect
(
git_repository_open_ext
(
&
repo
,
path
,
GIT_REPOSITORY_OPEN_FROM_ENV
,
NULL
),
0
,
file
,
line
);
cl_assert_at_line
(
git__suffixcmp
(
git_repository_path
(
repo
),
"attr/.git/"
)
==
0
,
file
,
line
);
cl_assert_at_line
(
git__suffixcmp
(
git_repository_workdir
(
repo
),
"attr/"
)
==
0
,
file
,
line
);
cl_assert_at_line
(
!
git_repository_is_bare
(
repo
),
file
,
line
);
...
...
@@ -98,24 +98,24 @@ static void env_check_objects_(bool a, bool t, bool p, const char *file, int lin
cl_git_pass
(
git_oid_fromstr
(
&
oid_a
,
"45141a79a77842c59a63229403220a4e4be74e3d"
));
cl_git_pass
(
git_oid_fromstr
(
&
oid_t
,
"1385f264afb75a56a5bec74243be9b367ba4ca08"
));
cl_git_pass
(
git_oid_fromstr
(
&
oid_p
,
"0df1a5865c8abfc09f1f2182e6a31be550e99f07"
));
cl_git_ex
ec
(
git_repository_open_ext
(
&
repo
,
"attr"
,
GIT_REPOSITORY_OPEN_FROM_ENV
,
NULL
),
0
,
file
,
line
);
cl_git_ex
pect
(
git_repository_open_ext
(
&
repo
,
"attr"
,
GIT_REPOSITORY_OPEN_FROM_ENV
,
NULL
),
0
,
file
,
line
);
if
(
a
)
{
cl_git_ex
ec
(
git_object_lookup
(
&
object
,
repo
,
&
oid_a
,
GIT_OBJ_BLOB
),
0
,
file
,
line
);
cl_git_ex
pect
(
git_object_lookup
(
&
object
,
repo
,
&
oid_a
,
GIT_OBJ_BLOB
),
0
,
file
,
line
);
git_object_free
(
object
);
}
else
{
cl_git_fail_at_line
(
git_object_lookup
(
&
object
,
repo
,
&
oid_a
,
GIT_OBJ_BLOB
),
file
,
line
);
}
if
(
t
)
{
cl_git_ex
ec
(
git_object_lookup
(
&
object
,
repo
,
&
oid_t
,
GIT_OBJ_BLOB
),
0
,
file
,
line
);
cl_git_ex
pect
(
git_object_lookup
(
&
object
,
repo
,
&
oid_t
,
GIT_OBJ_BLOB
),
0
,
file
,
line
);
git_object_free
(
object
);
}
else
{
cl_git_fail_at_line
(
git_object_lookup
(
&
object
,
repo
,
&
oid_t
,
GIT_OBJ_BLOB
),
file
,
line
);
}
if
(
p
)
{
cl_git_ex
ec
(
git_object_lookup
(
&
object
,
repo
,
&
oid_p
,
GIT_OBJ_COMMIT
),
0
,
file
,
line
);
cl_git_ex
pect
(
git_object_lookup
(
&
object
,
repo
,
&
oid_p
,
GIT_OBJ_COMMIT
),
0
,
file
,
line
);
git_object_free
(
object
);
}
else
{
cl_git_fail_at_line
(
git_object_lookup
(
&
object
,
repo
,
&
oid_p
,
GIT_OBJ_COMMIT
),
file
,
line
);
...
...
tests/status/ignore.c
View file @
c52480fd
...
...
@@ -20,7 +20,7 @@ static void assert_ignored_(
bool
expected
,
const
char
*
filepath
,
const
char
*
file
,
int
line
)
{
int
is_ignored
=
0
;
cl_git_ex
ec
(
cl_git_ex
pect
(
git_status_should_ignore
(
&
is_ignored
,
g_repo
,
filepath
),
0
,
file
,
line
);
clar__assert
(
(
expected
!=
0
)
==
(
is_ignored
!=
0
),
...
...
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