diff options
| author | jvoisin | 2023-04-13 22:46:49 +0200 |
|---|---|---|
| committer | jvoisin | 2023-04-13 23:49:02 +0200 |
| commit | aceef734bdfe4f68e2227fc9ac636aae8235fa12 (patch) | |
| tree | ab149e47157fc9f167d92685b586235d2fb60d3d /tests/test_memmove_dynamic_read.c | |
| parent | 476fbfc29fe843cf362a2e203818cbe1a97130bb (diff) | |
Add tests for memmove
Diffstat (limited to 'tests/test_memmove_dynamic_read.c')
| -rw-r--r-- | tests/test_memmove_dynamic_read.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_memmove_dynamic_read.c b/tests/test_memmove_dynamic_read.c new file mode 100644 index 0000000..1a01925 --- /dev/null +++ b/tests/test_memmove_dynamic_read.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[12] = {0}; | ||
| 7 | memmove(buffer, "1234567890", sizeof(buffer) - 1); | ||
| 8 | puts(buffer); | ||
| 9 | |||
| 10 | CHK_FAIL_START | ||
| 11 | memmove(buffer, "123456", argc); | ||
| 12 | CHK_FAIL_END | ||
| 13 | |||
| 14 | puts(buffer); | ||
| 15 | return ret; | ||
| 16 | } | ||
