[libc++][test] Portability fix of std::strstreambuf constructor test

The standard does not require the constructor `strstreambuf(streamsize alsize_arg = 0)`
leave the stream array unallocated when called with parameter `alsize_arg > 0`.
Conformant implementations of this constructor may allocate minimal `alsize_arg`
number of bytes forcing `str()` method to return non-null pointer.

Thanks to Andrey Maksimov for the patch.

Differential Revision: https://reviews.llvm.org/D72465
This commit is contained in:
Louis Dionne 2020-09-14 17:05:49 -04:00
parent 1dac073bdd
commit b3445c839f
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ int main(int, char**)
}
{
std::strstreambuf s(1024);
assert(s.str() == nullptr);
LIBCPP_ASSERT(s.str() == nullptr);
assert(s.pcount() == 0);
}