diff options
| author | jvoisin | 2023-08-20 17:59:13 +0200 |
|---|---|---|
| committer | jvoisin | 2023-08-20 17:59:13 +0200 |
| commit | f0305fb85796cc4dcc537123d6b9b3152cf0c4be (patch) | |
| tree | 3539188b667f82577fa227e22f1f34095c44581e /tests/test_memchr_dynamic_read.c | |
| parent | fea08b7aef9cd235d6ae384c1fd6e9578dc952c4 (diff) | |
Add two tests for memchr
Diffstat (limited to 'tests/test_memchr_dynamic_read.c')
| -rw-r--r-- | tests/test_memchr_dynamic_read.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_memchr_dynamic_read.c b/tests/test_memchr_dynamic_read.c new file mode 100644 index 0000000..2f8d214 --- /dev/null +++ b/tests/test_memchr_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 | const char* buffer = "12345"; | ||
| 7 | memchr(buffer, (int)'4', strlen(buffer) - 1); | ||
| 8 | puts(buffer); | ||
| 9 | |||
| 10 | CHK_FAIL_START | ||
| 11 | memchr(buffer, (int)'A', argc); | ||
| 12 | CHK_FAIL_END | ||
| 13 | |||
| 14 | puts(buffer); | ||
| 15 | return ret; | ||
| 16 | } | ||
