diff options
| author | jvoisin | 2023-06-22 18:20:38 +0200 |
|---|---|---|
| committer | jvoisin | 2023-06-22 18:20:38 +0200 |
| commit | 79447cbb8dc30e2335e3bb186de8e1172b3dff90 (patch) | |
| tree | 79832d6222ad0b0f1eed59b62339c3aaa8df9937 /tests/test_mempcpy_static_read.c | |
| parent | b714dbd77f79262b00298fcdb3f69bf518dcd242 (diff) | |
Add tests for mempcpy
Diffstat (limited to 'tests/test_mempcpy_static_read.c')
| -rw-r--r-- | tests/test_mempcpy_static_read.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_mempcpy_static_read.c b/tests/test_mempcpy_static_read.c new file mode 100644 index 0000000..8aeec17 --- /dev/null +++ b/tests/test_mempcpy_static_read.c | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #define _GNU_SOURCE | ||
| 4 | #include <string.h> | ||
| 5 | |||
| 6 | int main(int argc, char** argv) { | ||
| 7 | char buffer[8] = {0}; | ||
| 8 | mempcpy(buffer, "123456", 4); | ||
| 9 | puts(buffer); | ||
| 10 | |||
| 11 | CHK_FAIL_START | ||
| 12 | mempcpy(buffer, "123456", sizeof(buffer)); | ||
| 13 | CHK_FAIL_END | ||
| 14 | |||
| 15 | puts(buffer); | ||
| 16 | return ret; | ||
| 17 | } | ||
