summaryrefslogtreecommitdiffstats
path: root/libcxx/test/input.output/file.streams/fstreams/fstream.members/close.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/input.output/file.streams/fstreams/fstream.members/close.pass.cpp')
-rw-r--r--libcxx/test/input.output/file.streams/fstreams/fstream.members/close.pass.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.members/close.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.members/close.pass.cpp
index 1aa37dfa4d5..94b91806f81 100644
--- a/libcxx/test/input.output/file.streams/fstreams/fstream.members/close.pass.cpp
+++ b/libcxx/test/input.output/file.streams/fstreams/fstream.members/close.pass.cpp
@@ -19,22 +19,24 @@
int main()
{
+ char temp[L_tmpnam];
+ tmpnam(temp);
{
std::fstream fs;
assert(!fs.is_open());
- fs.open("test.dat", std::ios_base::out);
+ fs.open(temp, std::ios_base::out);
assert(fs.is_open());
fs.close();
assert(!fs.is_open());
}
- remove("test.dat");
+ remove(temp);
{
std::wfstream fs;
assert(!fs.is_open());
- fs.open("test.dat", std::ios_base::out);
+ fs.open(temp, std::ios_base::out);
assert(fs.is_open());
fs.close();
assert(!fs.is_open());
}
- remove("test.dat");
+ remove(temp);
}
OpenPOWER on IntegriCloud