diff options
Diffstat (limited to 'libcxx/test/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp')
| -rw-r--r-- | libcxx/test/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp index 192e65f55ff..9d2d56782a3 100644 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp +++ b/libcxx/test/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp @@ -13,39 +13,39 @@ #include <fstream> #include <cassert> +#include "platform_support.h" int main() { - char temp[L_tmpnam]; - tmpnam(temp); + std::string temp = get_temp_file_name(); { std::filebuf f; - assert(f.open(temp, std::ios_base::out) != 0); + assert(f.open(temp.c_str(), std::ios_base::out) != 0); assert(f.is_open()); assert(f.sputn("123", 3) == 3); } { std::filebuf f; - assert(f.open(temp, std::ios_base::in) != 0); + assert(f.open(temp.c_str(), std::ios_base::in) != 0); assert(f.is_open()); assert(f.sbumpc() == '1'); assert(f.sbumpc() == '2'); assert(f.sbumpc() == '3'); } - remove(temp); + std::remove(temp.c_str()); { std::wfilebuf f; - assert(f.open(temp, std::ios_base::out) != 0); + assert(f.open(temp.c_str(), std::ios_base::out) != 0); assert(f.is_open()); assert(f.sputn(L"123", 3) == 3); } { std::wfilebuf f; - assert(f.open(temp, std::ios_base::in) != 0); + assert(f.open(temp.c_str(), std::ios_base::in) != 0); assert(f.is_open()); assert(f.sbumpc() == L'1'); assert(f.sbumpc() == L'2'); assert(f.sbumpc() == L'3'); } - remove(temp); + remove(temp.c_str()); } |

