diff options
| author | jvoisin | 2023-07-05 15:41:58 +0200 |
|---|---|---|
| committer | jvoisin | 2023-07-05 15:41:58 +0200 |
| commit | e16b7ad1168ec48c6e5cf5e5d8e2b2c83815b3ea (patch) | |
| tree | d3ecb53190629f5c67af3685e2d48cbbdfe00e49 /tests/test_bzero_dynamic_write.c | |
| parent | b1c35c95f1384747b53cb5bdd8d5030068a39602 (diff) | |
Add tests for bzero
Diffstat (limited to 'tests/test_bzero_dynamic_write.c')
| -rw-r--r-- | tests/test_bzero_dynamic_write.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_bzero_dynamic_write.c b/tests/test_bzero_dynamic_write.c new file mode 100644 index 0000000..6e68d46 --- /dev/null +++ b/tests/test_bzero_dynamic_write.c | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #define _GNU_SOURCE | ||
| 2 | |||
| 3 | #include "common.h" | ||
| 4 | |||
| 5 | #include <strings.h> | ||
| 6 | |||
| 7 | int main(int argc, char** argv) { | ||
| 8 | char buffer[8] = {0}; | ||
| 9 | bzero(buffer, sizeof(buffer) - 1); | ||
| 10 | puts(buffer); | ||
| 11 | |||
| 12 | CHK_FAIL_START | ||
| 13 | bzero(buffer, argc); | ||
| 14 | CHK_FAIL_END | ||
| 15 | |||
| 16 | puts(buffer); | ||
| 17 | return ret; | ||
| 18 | } | ||
