summaryrefslogtreecommitdiff
path: root/tools/tests/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/tests/test.c')
-rw-r--r--tools/tests/test.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/tests/test.c b/tools/tests/test.c
index 56e65cd..9407817 100644
--- a/tools/tests/test.c
+++ b/tools/tests/test.c
@@ -116,7 +116,7 @@ test_check_data_msg (CuTest *tc,
if (filelen != reflen || memcmp (filedata, refdata, reflen) != 0)
CuFail_Line (tc, file, line, "File contents not as expected", filename);
- unlink (filename);
+ CuAssert_Line (tc, file, line, "couldn't remove file", unlink (filename) >= 0);
free (filename);
free (filedata);
}
@@ -142,7 +142,7 @@ test_check_symlink_msg (CuTest *tc,
CuAssertStrEquals_LineMsg (tc, file, line, "symlink contents wrong", destination, buf);
- unlink (filename);
+ CuAssert_Line (tc, file, line, "couldn't remove symlink", unlink (filename) >= 0);
free (filename);
}
@@ -197,6 +197,10 @@ test_check_directory_msg (CuTest *tc,
closedir (dir);
+#if OS_UNIX
+ CuAssert_Line (tc, file, line, "couldn't chown directory", chmod (directory, S_IRWXU) >= 0);
+#endif
+
p11_dict_iterate (files, &iter);
while (p11_dict_next (&iter, (void **)&name, NULL))
CuFail_Line (tc, file, line, "Couldn't find file in directory", name);