summaryrefslogtreecommitdiff
path: root/tests-clar/index/addall.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-09-05 11:45:29 -0700
committerRussell Belfer <rb@github.com>2013-09-05 11:45:29 -0700
commitc97d407d9cc54fc99af0a57e09e04e9e0bc68cb6 (patch)
treef3944ca9441705d03922766d5fb7b0872818bafe /tests-clar/index/addall.c
parentf240acce865ec14df0d517d5000316a933e7ffed (diff)
downloadlibgit2-c97d407d9cc54fc99af0a57e09e04e9e0bc68cb6.tar.gz
Fix tests of file modes
This fixes an issue checking file modes in the tests that initialize a repo from a template directory when a symlink is used in the template. Also, this updates some other places where we are examining file modes to use the new macros.
Diffstat (limited to 'tests-clar/index/addall.c')
-rw-r--r--tests-clar/index/addall.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests-clar/index/addall.c b/tests-clar/index/addall.c
index fca6e77fa..e6ce463a3 100644
--- a/tests-clar/index/addall.c
+++ b/tests-clar/index/addall.c
@@ -1,6 +1,7 @@
#include "clar_libgit2.h"
#include "../status/status_helpers.h"
#include "posix.h"
+#include "fileops.h"
git_repository *g_repo = NULL;
@@ -108,8 +109,10 @@ static void check_stat_data(git_index *index, const char *path, bool match)
cl_assert(st.st_size == entry->file_size);
cl_assert(st.st_uid == entry->uid);
cl_assert(st.st_gid == entry->gid);
- cl_assert_equal_b(st.st_mode & ~0777, entry->mode & ~0777);
- cl_assert_equal_b(st.st_mode & 0111, entry->mode & 0111);
+ cl_assert_equal_i_fmt(
+ GIT_MODE_TYPE(st.st_mode), GIT_MODE_TYPE(entry->mode), "%07o");
+ cl_assert_equal_b(
+ GIT_PERMS_EXECUTABLE(st.st_mode), GIT_PERMS_EXECUTABLE(entry->mode));
} else {
/* most things will still match */
cl_assert(st.st_size != entry->file_size);