diff options
Diffstat (limited to 'libcxx/test/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp')
-rw-r--r-- | libcxx/test/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp index 55aa3a2084a..7f80cfcc512 100644 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp +++ b/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp @@ -20,31 +20,33 @@ int main() { #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + char temp[L_tmpnam]; + tmpnam(temp); { - std::ofstream fso("test.dat"); + std::ofstream fso(temp); std::ofstream fs; fs = move(fso); 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 fso("test.dat"); + std::wofstream fso(temp); std::wofstream fs; fs = move(fso); 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); #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } |