diff options
Diffstat (limited to 'libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp')
-rw-r--r-- | libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp index 044fdc8cd31..7d899e776bb 100644 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp +++ b/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp @@ -19,26 +19,28 @@ int main() { + char temp[L_tmpnam]; + tmpnam(temp); { - std::ofstream fs("test.dat"); + std::ofstream fs(temp); fs << 3.25; } { - std::ifstream fs("test.dat"); + std::ifstream fs(temp); double x = 0; fs >> x; assert(x == 3.25); } - remove("test.dat"); + remove(temp); { - std::wofstream fs("test.dat"); + std::wofstream fs(temp); fs << 3.25; } { - std::wifstream fs("test.dat"); + std::wifstream fs(temp); double x = 0; fs >> x; assert(x == 3.25); } - remove("test.dat"); + remove(temp); } |