diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2016-02-29 19:58:52 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2016-02-29 19:58:52 +0900 |
commit | 01406297a23201b3f99dfb316e7bb4e64b0472c3 (patch) | |
tree | 0fa52f39836c1b8b42d94161e5910a11a36e6733 /strutil_test.cc | |
parent | 07550475d31e64e76a12a689a6dd6de327849272 (diff) | |
download | android_build_kati-01406297a23201b3f99dfb316e7bb4e64b0472c3.tar.gz android_build_kati-01406297a23201b3f99dfb316e7bb4e64b0472c3.tar.bz2 android_build_kati-01406297a23201b3f99dfb316e7bb4e64b0472c3.zip |
[C++] Finish FindEndOfLine at NULL characeter
Diffstat (limited to 'strutil_test.cc')
-rw-r--r-- | strutil_test.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/strutil_test.cc b/strutil_test.cc index 4d31c51..960c89a 100644 --- a/strutil_test.cc +++ b/strutil_test.cc @@ -130,6 +130,13 @@ void TestEscapeShell() { ASSERT_EQ(EscapeShell("\\\n"), "\\\\\n"); } +void TestFindEndOfLine() { + size_t lf_cnt = 0; + ASSERT_EQ(FindEndOfLine("foo", 0, &lf_cnt), 3); + char buf[10] = {'f', 'o', 'o', '\0', 'x', 'y'}; + ASSERT_EQ(FindEndOfLine(StringPiece(buf, 6), 0, &lf_cnt), 3); +} + } // namespace int main() { @@ -141,5 +148,6 @@ int main() { TestHasWord(); TestNormalizePath(); TestEscapeShell(); + TestFindEndOfLine(); assert(!g_failed); } |