From 8b6129312db7b2405f883c4080b835c69a855627 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 11 Jul 2023 00:14:13 +0200 Subject: Add more dynamic tests --- tests/test_fwrite_overwrite_dynamic.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/test_fwrite_overwrite_dynamic.c (limited to 'tests/test_fwrite_overwrite_dynamic.c') diff --git a/tests/test_fwrite_overwrite_dynamic.c b/tests/test_fwrite_overwrite_dynamic.c new file mode 100644 index 0000000..e5545f3 --- /dev/null +++ b/tests/test_fwrite_overwrite_dynamic.c @@ -0,0 +1,18 @@ +#include + +#include "common.h" + +#include + +int main(int argc, char** argv) { + char buffer[12] = {0}; + + assert(sizeof(buffer - 2) * argc > sizeof(buffer)); + + CHK_FAIL_START + fwrite(buffer, sizeof(buffer) - 2, argc, NULL); + CHK_FAIL_END + + puts(buffer); + return ret; +} -- cgit v1.3