diff options
Diffstat (limited to 'libcxx/test/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp')
-rw-r--r-- | libcxx/test/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp index 23795f010a5..4b0819f8af4 100644 --- a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp +++ b/libcxx/test/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp @@ -16,13 +16,13 @@ #include <fstream> #include <cassert> +#include "platform_support.h" int main() { - char temp[L_tmpnam]; - tmpnam(temp); + std::string temp = get_temp_file_name(); { - std::fstream fs(std::string(temp), + std::fstream fs(temp, std::ios_base::in | std::ios_base::out | std::ios_base::trunc); double x = 0; @@ -31,9 +31,9 @@ int main() fs >> x; assert(x == 3.25); } - std::remove(temp); + std::remove(temp.c_str()); { - std::wfstream fs(std::string(temp), + std::wfstream fs(temp, std::ios_base::in | std::ios_base::out | std::ios_base::trunc); double x = 0; @@ -42,5 +42,5 @@ int main() fs >> x; assert(x == 3.25); } - std::remove(temp); + std::remove(temp.c_str()); } |