summaryrefslogtreecommitdiff
path: root/tests/test_fwrite_overwrite_dynamic.c
diff options
context:
space:
mode:
authorjvoisin2025-10-31 15:18:10 +0100
committerjvoisin2025-11-11 14:09:16 +0100
commitfe3e4269959ea7534722aa2664a3cac69d9109cf (patch)
treecfb4a11fa1c2a14798b1bf1b56facdd9ea8ea170 /tests/test_fwrite_overwrite_dynamic.c
parent558f28473a1dea3d314156f2f3c45f078433ff57 (diff)
Add a testsuite
Co-Authored-By: q66 <q66@chimera-linux.org>
Diffstat (limited to 'tests/test_fwrite_overwrite_dynamic.c')
-rw-r--r--tests/test_fwrite_overwrite_dynamic.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_fwrite_overwrite_dynamic.c b/tests/test_fwrite_overwrite_dynamic.c
new file mode 100644
index 0000000..fa249bd
--- /dev/null
+++ b/tests/test_fwrite_overwrite_dynamic.c
@@ -0,0 +1,17 @@
1#include "common.h"
2
3#include <assert.h>
4#include <stdio.h>
5
6int main(int argc, char** argv) {
7 char buffer[12] = {0};
8
9 assert((sizeof(buffer) - 2) * argc > sizeof(buffer));
10
11 CHK_FAIL_START
12 fwrite(buffer, sizeof(buffer) - 2, argc, stdin);
13 CHK_FAIL_END
14
15 puts(buffer);
16 return ret;
17}