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 | 14 |
1 files changed, 8 insertions, 6 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 b685c660fe7..192e65f55ff 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 @@ -16,34 +16,36 @@ int main() { + char temp[L_tmpnam]; + tmpnam(temp); { std::filebuf f; - assert(f.open("test.dat", std::ios_base::out) != 0); + assert(f.open(temp, std::ios_base::out) != 0); assert(f.is_open()); assert(f.sputn("123", 3) == 3); } { std::filebuf f; - assert(f.open("test.dat", std::ios_base::in) != 0); + assert(f.open(temp, std::ios_base::in) != 0); assert(f.is_open()); assert(f.sbumpc() == '1'); assert(f.sbumpc() == '2'); assert(f.sbumpc() == '3'); } - remove("test.dat"); + remove(temp); { std::wfilebuf f; - assert(f.open("test.dat", std::ios_base::out) != 0); + assert(f.open(temp, std::ios_base::out) != 0); assert(f.is_open()); assert(f.sputn(L"123", 3) == 3); } { std::wfilebuf f; - assert(f.open("test.dat", std::ios_base::in) != 0); + assert(f.open(temp, 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("test.dat"); + remove(temp); } |

