diff options
| author | jvoisin | 2023-07-11 00:14:13 +0200 |
|---|---|---|
| committer | jvoisin | 2023-07-11 00:18:32 +0200 |
| commit | 8b6129312db7b2405f883c4080b835c69a855627 (patch) | |
| tree | 3fae0f94c33537db91c4c8488e78f467371f12b0 /tests/test_fwrite_overwrite_static.c | |
| parent | 759cb4697e9bba06a5aabad9899d0700f57051da (diff) | |
Add more dynamic tests
Diffstat (limited to 'tests/test_fwrite_overwrite_static.c')
| -rw-r--r-- | tests/test_fwrite_overwrite_static.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_fwrite_overwrite_static.c b/tests/test_fwrite_overwrite_static.c new file mode 100644 index 0000000..b3767f8 --- /dev/null +++ b/tests/test_fwrite_overwrite_static.c | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #include <assert.h> | ||
| 2 | |||
| 3 | #include "common.h" | ||
| 4 | |||
| 5 | #include <stdio.h> | ||
| 6 | |||
| 7 | int main(int argc, char** argv) { | ||
| 8 | char buffer[12] = {0}; | ||
| 9 | |||
| 10 | assert(sizeof(buffer - 2) * 10 > sizeof(buffer)); | ||
| 11 | |||
| 12 | CHK_FAIL_START | ||
| 13 | fwrite(buffer, sizeof(buffer) - 2, 10, NULL); | ||
| 14 | CHK_FAIL_END | ||
| 15 | |||
| 16 | puts(buffer); | ||
| 17 | return ret; | ||
| 18 | } | ||
