summaryrefslogtreecommitdiffstats
path: root/libcxx/test/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp')
-rw-r--r--libcxx/test/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
index 7eb41cf2bb3..28e3c95d4b2 100644
--- a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
+++ b/libcxx/test/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
@@ -20,9 +20,11 @@
int main()
{
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ char temp[L_tmpnam];
+ tmpnam(temp);
{
- std::fstream fso("test.dat", std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
+ std::fstream fso(temp, std::ios_base::in | std::ios_base::out
+ | std::ios_base::trunc);
std::fstream fs = move(fso);
double x = 0;
fs << 3.25;
@@ -32,8 +34,8 @@ int main()
}
std::remove("test.dat");
{
- std::wfstream fso("test.dat", std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
+ std::wfstream fso(temp, std::ios_base::in | std::ios_base::out
+ | std::ios_base::trunc);
std::wfstream fs = move(fso);
double x = 0;
fs << 3.25;
@@ -41,6 +43,6 @@ int main()
fs >> x;
assert(x == 3.25);
}
- std::remove("test.dat");
+ std::remove(temp);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
OpenPOWER on IntegriCloud