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.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/string_test.cpp b/tests/string_test.cpp
index eb10c161b..63bfadb45 100644
--- a/tests/string_test.cpp
+++ b/tests/string_test.cpp
@@ -209,6 +209,13 @@ TEST(string, strcat) {
}
}
+TEST(string, strchr_with_0) {
+ char buf[10];
+ const char* s = "01234";
+ memcpy(buf, s, strlen(s) + 1);
+ EXPECT_TRUE(strchr(buf, '\0') == (buf + strlen(s)));
+}
+
TEST(string, strchr) {
int seek_char = random() & 255;