summaryrefslogtreecommitdiffstats
path: root/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp')
-rw-r--r--libcxx/test/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp
index 84060337ff4..9a9b28ce483 100644
--- a/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp
+++ b/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp
@@ -21,10 +21,12 @@
int main()
{
+ char temp[L_tmpnam];
+ tmpnam(temp);
{
std::filebuf f;
- assert(f.open("test.dat", std::ios_base::out | std::ios_base::in
- | std::ios_base::trunc) != 0);
+ assert(f.open(temp, std::ios_base::out | std::ios_base::in
+ | std::ios_base::trunc) != 0);
assert(f.is_open());
assert(f.sputn("123", 3) == 3);
f.pubseekoff(1, std::ios_base::beg);
@@ -35,11 +37,11 @@ int main()
assert(f2.is_open());
assert(f2.sgetc() == '2');
}
- remove("test.dat");
+ remove(temp);
{
std::wfilebuf f;
- assert(f.open("test.dat", std::ios_base::out | std::ios_base::in
- | std::ios_base::trunc) != 0);
+ assert(f.open(temp, std::ios_base::out | std::ios_base::in
+ | std::ios_base::trunc) != 0);
assert(f.is_open());
assert(f.sputn(L"123", 3) == 3);
f.pubseekoff(1, std::ios_base::beg);
@@ -50,5 +52,5 @@ int main()
assert(f2.is_open());
assert(f2.sgetc() == L'2');
}
- remove("test.dat");
+ remove(temp);
}
OpenPOWER on IntegriCloud