diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-07 23:03:04 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-07 23:03:04 -0400 |
commit | 595303fd1e1998e12c51901f1aea77311e973a44 (patch) | |
tree | 84b18b086564584369b02f7f735a0f98dd4679eb /src/test | |
parent | 84df7d73c9f8892220184e301627d5bddb9c3f79 (diff) | |
parent | 6d9c332757c96e691ddeb024bd41035490a505d7 (diff) | |
download | tor-595303fd1e1998e12c51901f1aea77311e973a44.tar.gz tor-595303fd1e1998e12c51901f1aea77311e973a44.zip |
Merge remote-tracking branch 'public/bug10363_024_squashed'
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 a471b8eb19..877fa840ce 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -1212,6 +1212,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); |