Skip to content

Commit c52480f

Browse files
author
Edward Thomson
committed
cl_git_exec -> cl_git_expect
1 parent a1dcc83 commit c52480f

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

tests/attr/ignore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static void assert_is_ignored_(
2121
{
2222
int is_ignored = 0;
2323

24-
cl_git_exec(
24+
cl_git_expect(
2525
git_ignore_path_is_ignored(&is_ignored, g_repo, filepath), 0, file, line);
2626

2727
clar__assert_equal(

tests/clar_libgit2.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
*
1313
* Use this wrapper around all `git_` library calls that return error codes!
1414
*/
15-
#define cl_git_pass(expr) cl_git_exec((expr), 0, __FILE__, __LINE__)
15+
#define cl_git_pass(expr) cl_git_expect((expr), 0, __FILE__, __LINE__)
1616

17-
#define cl_git_fail_with(error, expr) cl_git_exec((expr), error, __FILE__, __LINE__)
17+
#define cl_git_fail_with(error, expr) cl_git_expect((expr), error, __FILE__, __LINE__)
1818

19-
#define cl_git_exec(expr, expected, file, line) do { \
19+
#define cl_git_expect(expr, expected, file, line) do { \
2020
int _lg2_error; \
2121
giterr_clear(); \
2222
if ((_lg2_error = (expr)) != expected) \

tests/repo/env.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ static int GIT_FORMAT_PRINTF(2, 3) cl_setenv_printf(const char *name, const char
5656
static void env_pass_(const char *path, const char *file, int line)
5757
{
5858
git_repository *repo;
59-
cl_git_exec(git_repository_open_ext(NULL, path, GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, line);
60-
cl_git_exec(git_repository_open_ext(&repo, path, GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, line);
59+
cl_git_expect(git_repository_open_ext(NULL, path, GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, line);
60+
cl_git_expect(git_repository_open_ext(&repo, path, GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, line);
6161
cl_assert_at_line(git__suffixcmp(git_repository_path(repo), "attr/.git/") == 0, file, line);
6262
cl_assert_at_line(git__suffixcmp(git_repository_workdir(repo), "attr/") == 0, file, line);
6363
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
9898
cl_git_pass(git_oid_fromstr(&oid_a, "45141a79a77842c59a63229403220a4e4be74e3d"));
9999
cl_git_pass(git_oid_fromstr(&oid_t, "1385f264afb75a56a5bec74243be9b367ba4ca08"));
100100
cl_git_pass(git_oid_fromstr(&oid_p, "0df1a5865c8abfc09f1f2182e6a31be550e99f07"));
101-
cl_git_exec(git_repository_open_ext(&repo, "attr", GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, line);
101+
cl_git_expect(git_repository_open_ext(&repo, "attr", GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, line);
102102

103103
if (a) {
104-
cl_git_exec(git_object_lookup(&object, repo, &oid_a, GIT_OBJ_BLOB), 0, file, line);
104+
cl_git_expect(git_object_lookup(&object, repo, &oid_a, GIT_OBJ_BLOB), 0, file, line);
105105
git_object_free(object);
106106
} else {
107107
cl_git_fail_at_line(git_object_lookup(&object, repo, &oid_a, GIT_OBJ_BLOB), file, line);
108108
}
109109

110110
if (t) {
111-
cl_git_exec(git_object_lookup(&object, repo, &oid_t, GIT_OBJ_BLOB), 0, file, line);
111+
cl_git_expect(git_object_lookup(&object, repo, &oid_t, GIT_OBJ_BLOB), 0, file, line);
112112
git_object_free(object);
113113
} else {
114114
cl_git_fail_at_line(git_object_lookup(&object, repo, &oid_t, GIT_OBJ_BLOB), file, line);
115115
}
116116

117117
if (p) {
118-
cl_git_exec(git_object_lookup(&object, repo, &oid_p, GIT_OBJ_COMMIT), 0, file, line);
118+
cl_git_expect(git_object_lookup(&object, repo, &oid_p, GIT_OBJ_COMMIT), 0, file, line);
119119
git_object_free(object);
120120
} else {
121121
cl_git_fail_at_line(git_object_lookup(&object, repo, &oid_p, GIT_OBJ_COMMIT), file, line);

tests/status/ignore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static void assert_ignored_(
2020
bool expected, const char *filepath, const char *file, int line)
2121
{
2222
int is_ignored = 0;
23-
cl_git_exec(
23+
cl_git_expect(
2424
git_status_should_ignore(&is_ignored, g_repo, filepath), 0, file, line);
2525
clar__assert(
2626
(expected != 0) == (is_ignored != 0),

0 commit comments

Comments
 (0)