Clean up tests and do runtime test for max name length

- Remove unused code
- Use standard functions declared in common.c
- Change tests to do a runtime test for the max name length of a path
  component (aka NAME_MAX). The actual value might differ from the hard
  coded NAME_MAX depending on the file system used.
This commit is contained in:
Thomas Veerman
2011-08-26 13:16:16 +00:00
parent 8a73de51f1
commit 27a2afc1e7
22 changed files with 218 additions and 674 deletions
+9
View File
@@ -15,6 +15,7 @@ int common_test_nr = -1, errct = 0, subtest;
_PROTOTYPE(void cleanup, (void));
_PROTOTYPE(int does_fs_truncate, (void));
_PROTOTYPE(void e, (int n));
_PROTOTYPE(int name_max, (char *path));
_PROTOTYPE(void quit, (void));
_PROTOTYPE(void rm_rf_dir, (int test_nr));
_PROTOTYPE(void rm_rf_ppdir, (int test_nr));
@@ -59,6 +60,14 @@ int does_fs_truncate(void)
return(does_truncate);
}
int name_max(char *path)
{
struct statvfs stvfs;
if (statvfs(path, &stvfs) != 0) e(7779);
return(stvfs.f_namemax);
}
void rm_rf_dir(test_nr)
int test_nr;