mirror of
https://git.proxmox.com/git/libgit2
synced 2025-12-29 16:39:12 +00:00
Add a test to verify FILENAME_MAX
Since we now rely on it (at least under Solaris), I figured we probably want to make sure it's accurate. The new test makes sure that creating a file with a name of length FILENAME_MAX+1 fails.
This commit is contained in:
parent
6fb1c0b489
commit
212eb09d5f
@ -222,3 +222,14 @@ void test_core_dirent__traverse_weird_filenames(void)
|
||||
|
||||
check_counts(&odd);
|
||||
}
|
||||
|
||||
/* test filename length limits */
|
||||
void test_core_dirent__length_limits(void)
|
||||
{
|
||||
char *big_filename = (char *)git__malloc(FILENAME_MAX + 1);
|
||||
memset(big_filename, 'a', FILENAME_MAX + 1);
|
||||
big_filename[FILENAME_MAX] = 0;
|
||||
|
||||
cl_must_fail(p_creat(big_filename, 0666));
|
||||
git__free(big_filename);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user