diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Makefile | 6 | ||||
| -rw-r--r-- | tests/test_memchr_null.c | 13 | ||||
| -rw-r--r-- | tests/test_memcpy_null_dst.c | 16 | ||||
| -rw-r--r-- | tests/test_memcpy_null_src.c | 16 | ||||
| -rw-r--r-- | tests/test_memmove_null_dst.c | 16 | ||||
| -rw-r--r-- | tests/test_memmove_null_src.c | 16 | ||||
| -rw-r--r-- | tests/test_memset_null.c | 13 |
7 files changed, 96 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile index 352e6f8..b1223ea 100644 --- a/tests/Makefile +++ b/tests/Makefile | |||
| @@ -48,10 +48,15 @@ RUNTIME_TARGETS= \ | |||
| 48 | test_mbstowcs_static \ | 48 | test_mbstowcs_static \ |
| 49 | test_memchr_dynamic_read \ | 49 | test_memchr_dynamic_read \ |
| 50 | test_memchr_static_read \ | 50 | test_memchr_static_read \ |
| 51 | test_memchr_null \ | ||
| 51 | test_memcpy_dynamic_read \ | 52 | test_memcpy_dynamic_read \ |
| 52 | test_memcpy_dynamic_write \ | 53 | test_memcpy_dynamic_write \ |
| 53 | test_memcpy_overwrite_over \ | 54 | test_memcpy_overwrite_over \ |
| 54 | test_memcpy_static_read \ | 55 | test_memcpy_static_read \ |
| 56 | test_memcpy_null_src \ | ||
| 57 | test_memcpy_null_dst \ | ||
| 58 | test_memmove_null_src \ | ||
| 59 | test_memmove_null_dst \ | ||
| 55 | test_memmove_dynamic_read \ | 60 | test_memmove_dynamic_read \ |
| 56 | test_memmove_dynamic_write \ | 61 | test_memmove_dynamic_write \ |
| 57 | test_memmove_static_read \ | 62 | test_memmove_static_read \ |
| @@ -62,6 +67,7 @@ RUNTIME_TARGETS= \ | |||
| 62 | test_mempcpy_static_write \ | 67 | test_mempcpy_static_write \ |
| 63 | test_memset_dynamic_write \ | 68 | test_memset_dynamic_write \ |
| 64 | test_memset_static_write \ | 69 | test_memset_static_write \ |
| 70 | test_memset_null \ | ||
| 65 | test_poll_dynamic \ | 71 | test_poll_dynamic \ |
| 66 | test_poll_static \ | 72 | test_poll_static \ |
| 67 | test_ppoll_dynamic \ | 73 | test_ppoll_dynamic \ |
diff --git a/tests/test_memchr_null.c b/tests/test_memchr_null.c new file mode 100644 index 0000000..02b994d --- /dev/null +++ b/tests/test_memchr_null.c | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | #ifndef __GNUC__ | ||
| 7 | CHK_FAIL_START | ||
| 8 | memchr(NULL, (int)'A', 0); | ||
| 9 | CHK_FAIL_END | ||
| 10 | #endif | ||
| 11 | |||
| 12 | return ret; | ||
| 13 | } | ||
diff --git a/tests/test_memcpy_null_dst.c b/tests/test_memcpy_null_dst.c new file mode 100644 index 0000000..9def69c --- /dev/null +++ b/tests/test_memcpy_null_dst.c | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | #ifndef __GNUC__ | ||
| 7 | char buffer[12] = {0}; | ||
| 8 | |||
| 9 | CHK_FAIL_START | ||
| 10 | memcpy(buffer, NULL, 0); | ||
| 11 | CHK_FAIL_END | ||
| 12 | |||
| 13 | puts(buffer); | ||
| 14 | #endif | ||
| 15 | return ret; | ||
| 16 | } | ||
diff --git a/tests/test_memcpy_null_src.c b/tests/test_memcpy_null_src.c new file mode 100644 index 0000000..42f99a9 --- /dev/null +++ b/tests/test_memcpy_null_src.c | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | #ifndef __GNUC__ | ||
| 7 | char buffer[12] = {0}; | ||
| 8 | |||
| 9 | CHK_FAIL_START | ||
| 10 | memcpy(NULL, buffer, 0); | ||
| 11 | CHK_FAIL_END | ||
| 12 | |||
| 13 | puts(buffer); | ||
| 14 | #endif | ||
| 15 | return ret; | ||
| 16 | } | ||
diff --git a/tests/test_memmove_null_dst.c b/tests/test_memmove_null_dst.c new file mode 100644 index 0000000..9455a5a --- /dev/null +++ b/tests/test_memmove_null_dst.c | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | #ifndef __GNUC__ | ||
| 7 | char buffer[12] = {0}; | ||
| 8 | |||
| 9 | CHK_FAIL_START | ||
| 10 | memmove(buffer, NULL, 0); | ||
| 11 | CHK_FAIL_END | ||
| 12 | |||
| 13 | puts(buffer); | ||
| 14 | #endif | ||
| 15 | return ret; | ||
| 16 | } | ||
diff --git a/tests/test_memmove_null_src.c b/tests/test_memmove_null_src.c new file mode 100644 index 0000000..e03b97a --- /dev/null +++ b/tests/test_memmove_null_src.c | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | #ifndef __GNUC__ | ||
| 7 | char buffer[12] = {0}; | ||
| 8 | |||
| 9 | CHK_FAIL_START | ||
| 10 | memmove(NULL, buffer, 0); | ||
| 11 | CHK_FAIL_END | ||
| 12 | |||
| 13 | puts(buffer); | ||
| 14 | #endif | ||
| 15 | return ret; | ||
| 16 | } | ||
diff --git a/tests/test_memset_null.c b/tests/test_memset_null.c new file mode 100644 index 0000000..0a2398b --- /dev/null +++ b/tests/test_memset_null.c | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #include "common.h" | ||
| 2 | |||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | int main(int argc, char** argv) { | ||
| 6 | #ifndef __GNUC__ | ||
| 7 | CHK_FAIL_START | ||
| 8 | memset(NULL, 0, 0); | ||
| 9 | CHK_FAIL_END | ||
| 10 | #endif | ||
| 11 | |||
| 12 | return ret; | ||
| 13 | } | ||
