summaryrefslogtreecommitdiffstats
path: root/libcxx/test/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2011-07-18 23:51:21 +0000
committerAlexis Hunt <alercah@gmail.com>2011-07-18 23:51:21 +0000
commit483cf2454756d623ea202c8ae733d9a954b9a8d7 (patch)
treebc242419f5b4c7a9918ae4f2029fb30694de2ed6 /libcxx/test/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
parent353404d924602c1af78315114e67328036d26f94 (diff)
downloadbcm5719-llvm-483cf2454756d623ea202c8ae733d9a954b9a8d7.tar.gz
bcm5719-llvm-483cf2454756d623ea202c8ae733d9a954b9a8d7.zip
Make all fstream tests use tmpnam if creating files, rather than
hard-coded names. llvm-svn: 135444
Diffstat (limited to 'libcxx/test/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp')
-rw-r--r--libcxx/test/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
index 9504aeae303..09b4f7460d7 100644
--- a/libcxx/test/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
+++ b/libcxx/test/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
@@ -20,9 +20,10 @@
int main()
{
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ char temp[L_tmpnam];
{
- 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;
fs = move(fso);
double x = 0;
@@ -31,10 +32,10 @@ int main()
fs >> x;
assert(x == 3.25);
}
- std::remove("test.dat");
+ std::remove(temp);
{
- 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;
fs = move(fso);
double x = 0;
@@ -43,6 +44,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