summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2017-02-17 13:01:49 +0000
committerEdward Thomson <ethomson@github.com>2017-02-17 13:01:49 +0000
commitc52480fde52c6d65b8ded9ba65bce0b15ff312df (patch)
tree7c333ad53439b97c389efe72cbf1cb2808bb2e21
parenta1dcc83030f9073fe29054ecaf7647dca1fec2ec (diff)
downloadlibgit2-ethomson/clar_messages.tar.gz
`cl_git_exec` -> `cl_git_expect`ethomson/clar_messages
-rw-r--r--tests/attr/ignore.c2
-rw-r--r--tests/clar_libgit2.h6
-rw-r--r--tests/repo/env.c12
-rw-r--r--tests/status/ignore.c2
4 files changed, 11 insertions, 11 deletions
diff --git a/tests/attr/ignore.c b/tests/attr/ignore.c
index a8845e463..3a193890a 100644
--- a/tests/attr/ignore.c
+++ b/tests/attr/ignore.c
@@ -21,7 +21,7 @@ static void assert_is_ignored_(
{
int is_ignored = 0;
- cl_git_exec(
+ cl_git_expect(
git_ignore_path_is_ignored(&is_ignored, g_repo, filepath), 0, file, line);
clar__assert_equal(
diff --git a/tests/clar_libgit2.h b/tests/clar_libgit2.h
index 1d77bc6d6..c72d37db3 100644
--- a/tests/clar_libgit2.h
+++ b/tests/clar_libgit2.h
@@ -12,11 +12,11 @@
*
* Use this wrapper around all `git_` library calls that return error codes!
*/
-#define cl_git_pass(expr) cl_git_exec((expr), 0, __FILE__, __LINE__)
+#define cl_git_pass(expr) cl_git_expect((expr), 0, __FILE__, __LINE__)
-#define cl_git_fail_with(error, expr) cl_git_exec((expr), error, __FILE__, __LINE__)
+#define cl_git_fail_with(error, expr) cl_git_expect((expr), error, __FILE__, __LINE__)
-#define cl_git_exec(expr, expected, file, line) do { \
+#define cl_git_expect(expr, expected, file, line) do { \
int _lg2_error; \
giterr_clear(); \
if ((_lg2_error = (expr)) != expected) \
diff --git a/tests/repo/env.c b/tests/repo/env.c
index 235f787ab..6404f88e9 100644
--- a/tests/repo/env.c
+++ b/tests/repo/env.c
@@ -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_exec(git_repository_open_ext(NULL, path, GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, line);
- cl_git_exec(git_repository_open_ext(&repo, path, GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, line);
+ cl_git_expect(git_repository_open_ext(NULL, path, GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, line);
+ cl_git_expect(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_exec(git_repository_open_ext(&repo, "attr", GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, line);
+ cl_git_expect(git_repository_open_ext(&repo, "attr", GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, line);
if (a) {
- cl_git_exec(git_object_lookup(&object, repo, &oid_a, GIT_OBJ_BLOB), 0, file, line);
+ cl_git_expect(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_exec(git_object_lookup(&object, repo, &oid_t, GIT_OBJ_BLOB), 0, file, line);
+ cl_git_expect(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_exec(git_object_lookup(&object, repo, &oid_p, GIT_OBJ_COMMIT), 0, file, line);
+ cl_git_expect(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);
diff --git a/tests/status/ignore.c b/tests/status/ignore.c
index a9b96114b..251de39dd 100644
--- a/tests/status/ignore.c
+++ b/tests/status/ignore.c
@@ -20,7 +20,7 @@ static void assert_ignored_(
bool expected, const char *filepath, const char *file, int line)
{
int is_ignored = 0;
- cl_git_exec(
+ cl_git_expect(
git_status_should_ignore(&is_ignored, g_repo, filepath), 0, file, line);
clar__assert(
(expected != 0) == (is_ignored != 0),