aboutsummaryrefslogtreecommitdiffstats
path: root/test_utils/test_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'test_utils/test_main.c')
-rw-r--r--test_utils/test_main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test_utils/test_main.c b/test_utils/test_main.c
index 40dfa52f08f1..ef066eb67d99 100644
--- a/test_utils/test_main.c
+++ b/test_utils/test_main.c
@@ -597,6 +597,19 @@ assertion_chdir(const char *file, int line, const char *pathname)
}
+/* change file/directory permissions and errors if it fails */
+int
+assertion_chmod(const char *file, int line, const char *pathname, int mode)
+{
+ assertion_count(file, line);
+ if (chmod(pathname, mode) == 0)
+ return (1);
+ failure_start(file, line, "chmod(\"%s\", %4.o)", pathname, mode);
+ failure_finish(NULL);
+ return (0);
+
+}
+
/* Verify two integers are equal. */
int
assertion_equal_int(const char *file, int line,