diff options
| author | jvoisin | 2023-06-22 18:14:24 +0200 |
|---|---|---|
| committer | jvoisin | 2023-06-22 18:14:24 +0200 |
| commit | b714dbd77f79262b00298fcdb3f69bf518dcd242 (patch) | |
| tree | 143567b7ca04389f6a5b80a24afa0139e32be5b5 /tests/test_strncat_static_write.c | |
| parent | 532f4bfd0ba906e5a1410b9d2a46cf8a4992f062 (diff) | |
Add a test for strncat
Diffstat (limited to 'tests/test_strncat_static_write.c')
| -rw-r--r-- | tests/test_strncat_static_write.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_strncat_static_write.c b/tests/test_strncat_static_write.c new file mode 100644 index 0000000..9332adc --- /dev/null +++ b/tests/test_strncat_static_write.c | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | char buffer[8] = {0}; | ||
| 7 | strncat(buffer, "1234567", 5); | ||
| 8 | puts(buffer); | ||
| 9 | |||
| 10 | CHK_FAIL_START | ||
| 11 | strncat(buffer, "1234567890", 10); | ||
| 12 | CHK_FAIL_END | ||
| 13 | |||
| 14 | puts(buffer); | ||
| 15 | return ret; | ||
| 16 | } | ||
