summaryrefslogtreecommitdiff
path: root/tests/path
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2018-05-22 15:21:08 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2018-05-22 15:27:29 +0200
commit02c80ad75d3c3d2246f4f36660281d73648d79aa (patch)
treee40e8faae52cf68882b1c527a9dc97804854e56f /tests/path
parenta145f2b642e41dec3522dc449a2ef947ccd7a337 (diff)
downloadlibgit2-02c80ad75d3c3d2246f4f36660281d73648d79aa.tar.gz
path: accept the name length as a parameter
We may take in names from the middle of a string so we want the caller to let us know how long the path component is that we should be checking.
Diffstat (limited to 'tests/path')
-rw-r--r--tests/path/dotgit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/path/dotgit.c b/tests/path/dotgit.c
index 7a011d4f6..038e849c2 100644
--- a/tests/path/dotgit.c
+++ b/tests/path/dotgit.c
@@ -90,18 +90,18 @@ static char *gitmodules_not_altnames[] = {
void test_path_dotgit__dotgit_modules(void)
{
size_t i;
- cl_assert_equal_i(1, git_path_is_dotgit_modules(".gitmodules"));
- cl_assert_equal_i(1, git_path_is_dotgit_modules(".git\xe2\x80\x8cmodules"));
+ cl_assert_equal_i(1, git_path_is_dotgit_modules(".gitmodules", strlen(".gitmodules")));
+ cl_assert_equal_i(1, git_path_is_dotgit_modules(".git\xe2\x80\x8cmodules", strlen(".git\xe2\x80\x8cmodules")));
for (i = 0; i < ARRAY_SIZE(gitmodules_altnames); i++) {
const char *name = gitmodules_altnames[i];
- if (!git_path_is_dotgit_modules(name))
+ if (!git_path_is_dotgit_modules(name, strlen(name)))
cl_fail(name);
}
for (i = 0; i < ARRAY_SIZE(gitmodules_not_altnames); i++) {
const char *name = gitmodules_not_altnames[i];
- if (git_path_is_dotgit_modules(name))
+ if (git_path_is_dotgit_modules(name, strlen(name)))
cl_fail(name);
}