diff options
author | Billy Robert O'Neal III <bion@microsoft.com> | 2018-04-10 03:04:07 +0000 |
---|---|---|
committer | Billy Robert O'Neal III <bion@microsoft.com> | 2018-04-10 03:04:07 +0000 |
commit | 34ab26d62a886c5c5bea740d02b8a9b5be85e2b5 (patch) | |
tree | 29e296f92256d580fa16a21a6dd33c8db4509d2b /libcxx/test/std/depr | |
parent | 8a13f6d4a7d5b6b037a6e6f6a5453a114352151d (diff) | |
download | bcm5719-llvm-34ab26d62a886c5c5bea740d02b8a9b5be85e2b5.tar.gz bcm5719-llvm-34ab26d62a886c5c5bea740d02b8a9b5be85e2b5.zip |
[libcxx] [test] Use the correct type from strlen. Include correct header.
llvm-svn: 329665
Diffstat (limited to 'libcxx/test/std/depr')
3 files changed, 9 insertions, 6 deletions
diff --git a/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp b/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp index 5d345f13dd4..1bac82d303c 100644 --- a/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp +++ b/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <cstring> int main() { @@ -71,8 +72,8 @@ int main() } { char buf[10] = "abcd"; - int s = std::strlen(buf); - std::strstreambuf sb(buf, sizeof(buf)-s, buf + s); + std::size_t s = std::strlen(buf); + std::strstreambuf sb(buf, sizeof(buf) - s, buf + s); assert(sb.sgetc() == 'a'); assert(sb.snextc() == 'b'); assert(sb.snextc() == 'c'); diff --git a/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp b/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp index c827850abf3..289b61f4399 100644 --- a/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp +++ b/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <cstring> int main() { @@ -71,8 +72,8 @@ int main() } { signed char buf[10] = "abcd"; - int s = std::strlen((char*)buf); - std::strstreambuf sb(buf, sizeof(buf)-s, buf + s); + std::size_t s = std::strlen((char*)buf); + std::strstreambuf sb(buf, sizeof(buf) - s, buf + s); assert(sb.sgetc() == 'a'); assert(sb.snextc() == 'b'); assert(sb.snextc() == 'c'); diff --git a/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp b/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp index 46c11e4afaf..b0920f7a76f 100644 --- a/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp +++ b/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp @@ -15,6 +15,7 @@ #include <strstream> #include <cassert> +#include <cstring> int main() { @@ -71,8 +72,8 @@ int main() } { unsigned char buf[10] = "abcd"; - int s = std::strlen((char*)buf); - std::strstreambuf sb(buf, sizeof(buf)-s, buf + s); + std::size_t s = std::strlen((char*)buf); + std::strstreambuf sb(buf, sizeof(buf) - s, buf + s); assert(sb.sgetc() == 'a'); assert(sb.snextc() == 'b'); assert(sb.snextc() == 'c'); |