summaryrefslogtreecommitdiffstats
path: root/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-03-22 20:05:40 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-03-22 20:05:40 +0000
commit7c5b88b134b0141c3ffda62534572a89d5a9640e (patch)
treec8e8b66f42f35f8d2249a4dc62dbcf9275bf688e /libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
parent7c8dbc12bb73c1d42307e784410a1d5383461732 (diff)
downloadbcm5719-llvm-7c5b88b134b0141c3ffda62534572a89d5a9640e.tar.gz
bcm5719-llvm-7c5b88b134b0141c3ffda62534572a89d5a9640e.zip
Test cleanup with respect to use of deprecated tmpnam function. Also Windows port for these tests to use _tempnam. The bulk of this patch was donated anonymously. I've tested it on OS X and accept responsibility for it. If I've broken anyone's platform by switching from tmpnam to mktemp for the generation of temporary file names, just let me know. Should be easy to fix in test/support/platform_support.h
llvm-svn: 177755
Diffstat (limited to 'libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp')
-rw-r--r--libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
index 7d899e776bb..bd5832abeb5 100644
--- a/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
+++ b/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
@@ -16,31 +16,31 @@
#include <fstream>
#include <cassert>
+#include "platform_support.h"
int main()
{
- char temp[L_tmpnam];
- tmpnam(temp);
+ std::string temp = get_temp_file_name();
{
- std::ofstream fs(temp);
+ std::ofstream fs(temp.c_str());
fs << 3.25;
}
{
- std::ifstream fs(temp);
+ std::ifstream fs(temp.c_str());
double x = 0;
fs >> x;
assert(x == 3.25);
}
- remove(temp);
+ std::remove(temp.c_str());
{
- std::wofstream fs(temp);
+ std::wofstream fs(temp.c_str());
fs << 3.25;
}
{
- std::wifstream fs(temp);
+ std::wifstream fs(temp.c_str());
double x = 0;
fs >> x;
assert(x == 3.25);
}
- remove(temp);
+ std::remove(temp.c_str());
}
OpenPOWER on IntegriCloud