aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/safe_tests.c12
-rw-r--r--tests/string_tests.c2
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/safe_tests.c b/tests/safe_tests.c
index b50b073..3c25dd5 100644
--- a/tests/safe_tests.c
+++ b/tests/safe_tests.c
@@ -13,7 +13,7 @@ TEST(test_safe_malloc) {
void *p = safe_malloc(1024);
test_assert(p != NULL, "Failed to malloc 1KiB");
- suppress_output(stderr);
+ suppress_output(STDERR_FILENO);
test_assert_exit(malloc_exit, EXIT_FAILURE);
unsuppress_outputs();
}
@@ -26,7 +26,7 @@ TEST(test_safe_calloc) {
void *p = safe_calloc(16, 16);
test_assert(p != NULL, "Failed to calloc 16 items of 16 bytes");
- suppress_output(stderr);
+ suppress_output(STDERR_FILENO);
test_assert_exit(calloc_exit, EXIT_FAILURE);
unsuppress_outputs();
}
@@ -44,7 +44,7 @@ TEST(test_safe_realloc) {
p = safe_realloc(p, 4096);
test_assert(p != NULL, "Failed to realloc 1KiB to 4KiB");
- suppress_output(stderr);
+ suppress_output(STDERR_FILENO);
test_assert_exit(realloc_exit, EXIT_FAILURE);
unsuppress_outputs();
}
@@ -57,7 +57,7 @@ TEST(test_safe_fopen) {
FILE *fp = safe_fopen(__FILE__, "r");
test_assert(fp != NULL, "Failed to fopen current file");
- suppress_output(stderr);
+ suppress_output(STDERR_FILENO);
test_assert_exit(fopen_exit, EXIT_FAILURE);
unsuppress_outputs();
}
@@ -76,7 +76,7 @@ TEST(test_safe_dup) {
test_assert(fd != -1, "Failed to dup STDOUT_FILENO");
close(fd);
- suppress_output(stderr);
+ suppress_output(STDERR_FILENO);
test_assert_exit(dup_exit, EXIT_FAILURE);
unsuppress_outputs();
}
@@ -96,7 +96,7 @@ TEST(test_safe_dup2) {
test_assert(res != -1, "Failed to restore STDOUT_FILENO");
close(fd);
- suppress_output(stderr);
+ suppress_output(STDERR_FILENO);
test_assert_exit(dup2_exit, EXIT_FAILURE);
unsuppress_outputs();
}
diff --git a/tests/string_tests.c b/tests/string_tests.c
index eaa9498..8ca0dcd 100644
--- a/tests/string_tests.c
+++ b/tests/string_tests.c
@@ -41,7 +41,7 @@ TEST(ss_print_helper) {
}
TEST(printing) {
- test_assert_out(ss_print_helper, stdout, "test");
+ test_assert_out(ss_print_helper, STDOUT_FILENO, "test");
StringSlice ss = ss_from_str("slice");
char buf[16];