[libcxx] [test] Use the correct type from strlen. Include correct header.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include <strstream>
|
#include <strstream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@@ -71,7 +72,7 @@ int main()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
char buf[10] = "abcd";
|
char buf[10] = "abcd";
|
||||||
int s = std::strlen(buf);
|
std::size_t s = std::strlen(buf);
|
||||||
std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
|
std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
|
||||||
assert(sb.sgetc() == 'a');
|
assert(sb.sgetc() == 'a');
|
||||||
assert(sb.snextc() == 'b');
|
assert(sb.snextc() == 'b');
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include <strstream>
|
#include <strstream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@@ -71,7 +72,7 @@ int main()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
signed char buf[10] = "abcd";
|
signed char buf[10] = "abcd";
|
||||||
int s = std::strlen((char*)buf);
|
std::size_t s = std::strlen((char*)buf);
|
||||||
std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
|
std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
|
||||||
assert(sb.sgetc() == 'a');
|
assert(sb.sgetc() == 'a');
|
||||||
assert(sb.snextc() == 'b');
|
assert(sb.snextc() == 'b');
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include <strstream>
|
#include <strstream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@@ -71,7 +72,7 @@ int main()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
unsigned char buf[10] = "abcd";
|
unsigned char buf[10] = "abcd";
|
||||||
int s = std::strlen((char*)buf);
|
std::size_t s = std::strlen((char*)buf);
|
||||||
std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
|
std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
|
||||||
assert(sb.sgetc() == 'a');
|
assert(sb.sgetc() == 'a');
|
||||||
assert(sb.snextc() == 'b');
|
assert(sb.snextc() == 'b');
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ protected:
|
|||||||
{
|
{
|
||||||
if (ch != base::traits_type::eof())
|
if (ch != base::traits_type::eof())
|
||||||
{
|
{
|
||||||
int n = str_.size();
|
std::size_t n = str_.size();
|
||||||
str_.push_back(static_cast<CharT>(ch));
|
str_.push_back(static_cast<CharT>(ch));
|
||||||
str_.resize(str_.capacity());
|
str_.resize(str_.capacity());
|
||||||
base::setp(const_cast<CharT*>(str_.data()),
|
base::setp(const_cast<CharT*>(str_.data()),
|
||||||
|
|||||||
Reference in New Issue
Block a user