summaryrefslogtreecommitdiffstats
path: root/libcxx/test/input.output/file.streams/fstreams/ofstream.members/open_string.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/ofstream.members/open_string.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/ofstream.members/open_string.pass.cpp')
-rw-r--r--libcxx/test/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp
index 6687a400464..b33114d9725 100644
--- a/libcxx/test/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp
+++ b/libcxx/test/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp
@@ -19,38 +19,40 @@
int main()
{
+ char temp[L_tmpnam];
+ tmpnam(temp);
{
std::ofstream fs;
assert(!fs.is_open());
char c = 'a';
fs << c;
assert(fs.fail());
- fs.open(std::string("test.dat"));
+ fs.open(std::string(temp));
assert(fs.is_open());
fs << c;
}
{
- std::ifstream fs("test.dat");
+ std::ifstream fs(temp);
char c = 0;
fs >> c;
assert(c == 'a');
}
- remove("test.dat");
+ remove(temp);
{
std::wofstream fs;
assert(!fs.is_open());
wchar_t c = L'a';
fs << c;
assert(fs.fail());
- fs.open(std::string("test.dat"));
+ fs.open(std::string(temp));
assert(fs.is_open());
fs << c;
}
{
- std::wifstream fs("test.dat");
+ std::wifstream fs(temp);
wchar_t c = 0;
fs >> c;
assert(c == L'a');
}
- remove("test.dat");
+ remove(temp);
}
OpenPOWER on IntegriCloud