diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index 65d9d2f878..bf87db70bc 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -1045,6 +1045,10 @@ test_util_strmisc(void) test_assert(!tor_memmem(haystack, 4, "cde", 3)); haystack = "ababcad"; test_eq_ptr(tor_memmem(haystack, 7, "abc", 3), haystack + 2); + test_eq_ptr(tor_memmem(haystack, 7, "ad", 2), haystack + 5); + test_eq_ptr(tor_memmem(haystack, 7, "cad", 3), haystack + 4); + test_assert(!tor_memmem(haystack, 7, "dadad", 5)); + test_assert(!tor_memmem(haystack, 7, "abcdefghij", 10)); /* memstr */ test_eq_ptr(tor_memstr(haystack, 7, "abc"), haystack + 2); test_eq_ptr(tor_memstr(haystack, 7, "cad"), haystack + 4); |