aboutsummaryrefslogtreecommitdiffstats
path: root/tests/string_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/string_test.cpp')
-rw-r--r--tests/string_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/string_test.cpp b/tests/string_test.cpp
index bc2c05b40..73c94c602 100644
--- a/tests/string_test.cpp
+++ b/tests/string_test.cpp
@@ -763,6 +763,14 @@ TEST(string, memchr) {
}
}
+TEST(string, memchr_zero) {
+ uint8_t* buffer;
+ ASSERT_EQ(0, posix_memalign(reinterpret_cast<void**>(&buffer), 64, 64));
+ memset(buffer, 10, 64);
+ ASSERT_TRUE(NULL == memchr(buffer, 5, 0));
+ ASSERT_TRUE(NULL == memchr(buffer, 10, 0));
+}
+
TEST(string, memrchr) {
int seek_char = random() & 255;
StringTestState<char> state(SMALL);