aboutsummaryrefslogtreecommitdiffstats
path: root/tests/string_test.cpp
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-04-19 16:54:22 -0700
committerNick Kralevich <nnk@google.com>2013-05-02 13:58:03 -0700
commit4f40e511b0612ea099ab5b0843977fe7a49372fd (patch)
treec0118aed430408fa8bf803ffabccb377eaefbb0b /tests/string_test.cpp
parent5e3b502b6b56634953ea152409363088974fa5e9 (diff)
downloadandroid_bionic-4f40e511b0612ea099ab5b0843977fe7a49372fd.tar.gz
android_bionic-4f40e511b0612ea099ab5b0843977fe7a49372fd.tar.bz2
android_bionic-4f40e511b0612ea099ab5b0843977fe7a49372fd.zip
libc: cleanup strchr
Move strchr to a .cpp file, and change to bionic directory. Change-Id: I64ade7df326c0a9a714aca4caf5647b6833b1c97
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;