diff options
Diffstat (limited to 'libcxx/test/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp')
-rw-r--r-- | libcxx/test/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp index 45b8f0a1ff8..a31f9a1d543 100644 --- a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp +++ b/libcxx/test/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp @@ -19,24 +19,26 @@ int main() { + char temp[L_tmpnam]; + tmpnam(temp); { - std::fstream fs("test.dat", std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); + std::fstream fs(temp, std::ios_base::in | std::ios_base::out + | std::ios_base::trunc); double x = 0; fs << 3.25; fs.seekg(0); fs >> x; assert(x == 3.25); } - std::remove("test.dat"); + std::remove(temp); { - std::wfstream fs("test.dat", std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); + std::wfstream fs(temp, std::ios_base::in | std::ios_base::out + | std::ios_base::trunc); double x = 0; fs << 3.25; fs.seekg(0); fs >> x; assert(x == 3.25); } - std::remove("test.dat"); + std::remove(temp); } |