summaryrefslogtreecommitdiffstats
path: root/libcxx/test/input.output/file.streams/fstreams/fstream.assign
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2014-12-20 01:40:03 +0000
committerEric Fiselier <eric@efcs.ca>2014-12-20 01:40:03 +0000
commit5a83710e371fe68a06e6e3876c6a2c8b820a8976 (patch)
treeafde4c82ad6704681781c5cd49baa3fbd05c85db /libcxx/test/input.output/file.streams/fstreams/fstream.assign
parentf11e8eab527fba316c64112f6e05de1a79693a3e (diff)
downloadbcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.tar.gz
bcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.zip
Move test into test/std subdirectory.
llvm-svn: 224658
Diffstat (limited to 'libcxx/test/input.output/file.streams/fstreams/fstream.assign')
-rw-r--r--libcxx/test/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp71
-rw-r--r--libcxx/test/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp50
-rw-r--r--libcxx/test/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp72
3 files changed, 0 insertions, 193 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp
deleted file mode 100644
index fcc86a13ffa..00000000000
--- a/libcxx/test/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <fstream>
-
-// template <class charT, class traits = char_traits<charT> >
-// class basic_fstream
-
-// void swap(basic_fstream& rhs);
-
-#include <fstream>
-#include <cassert>
-#include "platform_support.h"
-
-int main()
-{
- std::string temp1 = get_temp_file_name();
- std::string temp2 = get_temp_file_name();
- {
- std::fstream fs1(temp1.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- std::fstream fs2(temp2.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- fs1 << 1 << ' ' << 2;
- fs2 << 2 << ' ' << 1;
- fs1.seekg(0);
- fs1.swap(fs2);
- fs1.seekg(0);
- int i;
- fs1 >> i;
- assert(i == 2);
- fs1 >> i;
- assert(i == 1);
- i = 0;
- fs2 >> i;
- assert(i == 1);
- fs2 >> i;
- assert(i == 2);
- }
- std::remove(temp1.c_str());
- std::remove(temp2.c_str());
- {
- std::wfstream fs1(temp1.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- std::wfstream fs2(temp2.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- fs1 << 1 << ' ' << 2;
- fs2 << 2 << ' ' << 1;
- fs1.seekg(0);
- fs1.swap(fs2);
- fs1.seekg(0);
- int i;
- fs1 >> i;
- assert(i == 2);
- fs1 >> i;
- assert(i == 1);
- i = 0;
- fs2 >> i;
- assert(i == 1);
- fs2 >> i;
- assert(i == 2);
- }
- std::remove(temp1.c_str());
- std::remove(temp2.c_str());
-}
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
deleted file mode 100644
index b5157e90edc..00000000000
--- a/libcxx/test/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <fstream>
-
-// template <class charT, class traits = char_traits<charT> >
-// class basic_fstream
-
-// basic_fstream& operator=(basic_fstream&& rhs);
-
-#include <fstream>
-#include <cassert>
-#include "platform_support.h"
-
-int main()
-{
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- std::string temp = get_temp_file_name();
- {
- std::fstream fso(temp.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- std::fstream fs;
- fs = move(fso);
- double x = 0;
- fs << 3.25;
- fs.seekg(0);
- fs >> x;
- assert(x == 3.25);
- }
- std::remove(temp.c_str());
- {
- std::wfstream fso(temp.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- std::wfstream fs;
- fs = move(fso);
- double x = 0;
- fs << 3.25;
- fs.seekg(0);
- fs >> x;
- assert(x == 3.25);
- }
- std::remove(temp.c_str());
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-}
diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp
deleted file mode 100644
index 0a4f7240daa..00000000000
--- a/libcxx/test/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <fstream>
-
-// template <class charT, class traits = char_traits<charT> >
-// class basic_fstream
-
-// template <class charT, class traits>
-// void swap(basic_fstream<charT, traits>& x, basic_fstream<charT, traits>& y);
-
-#include <fstream>
-#include <cassert>
-#include "platform_support.h"
-
-int main()
-{
- std::string temp1 = get_temp_file_name();
- std::string temp2 = get_temp_file_name();
- {
- std::fstream fs1(temp1.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- std::fstream fs2(temp2.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- fs1 << 1 << ' ' << 2;
- fs2 << 2 << ' ' << 1;
- fs1.seekg(0);
- swap(fs1, fs2);
- fs1.seekg(0);
- int i;
- fs1 >> i;
- assert(i == 2);
- fs1 >> i;
- assert(i == 1);
- i = 0;
- fs2 >> i;
- assert(i == 1);
- fs2 >> i;
- assert(i == 2);
- }
- std::remove(temp1.c_str());
- std::remove(temp2.c_str());
- {
- std::wfstream fs1(temp1.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- std::wfstream fs2(temp2.c_str(), std::ios_base::in | std::ios_base::out
- | std::ios_base::trunc);
- fs1 << 1 << ' ' << 2;
- fs2 << 2 << ' ' << 1;
- fs1.seekg(0);
- swap(fs1, fs2);
- fs1.seekg(0);
- int i;
- fs1 >> i;
- assert(i == 2);
- fs1 >> i;
- assert(i == 1);
- i = 0;
- fs2 >> i;
- assert(i == 1);
- fs2 >> i;
- assert(i == 2);
- }
- std::remove(temp1.c_str());
- std::remove(temp2.c_str());
-}
OpenPOWER on IntegriCloud