diff options
| author | jvoisin | 2023-04-13 23:44:52 +0200 |
|---|---|---|
| committer | jvoisin | 2023-04-13 23:49:02 +0200 |
| commit | fa40365faea6b87288504f0d8ad39dab8ff302b4 (patch) | |
| tree | 378ad91e5bedb268e2ecc15e668830189dfe32b0 /tests/test_strcpy_static_write.c | |
| parent | 56d760c5cb1c07dfa409742d51f836792a09d824 (diff) | |
Add tests for strcat and strcpy
Diffstat (limited to 'tests/test_strcpy_static_write.c')
| -rw-r--r-- | tests/test_strcpy_static_write.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_strcpy_static_write.c b/tests/test_strcpy_static_write.c new file mode 100644 index 0000000..a3e8100 --- /dev/null +++ b/tests/test_strcpy_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 | strcpy(buffer, "1234567"); | ||
| 8 | puts(buffer); | ||
| 9 | |||
| 10 | CHK_FAIL_START | ||
| 11 | strcpy(buffer, "1234567890"); | ||
| 12 | CHK_FAIL_END | ||
| 13 | |||
| 14 | puts(buffer); | ||
| 15 | return ret; | ||
| 16 | } | ||
