diff options
| author | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
| commit | 5a83710e371fe68a06e6e3876c6a2c8b820a8976 (patch) | |
| tree | afde4c82ad6704681781c5cd49baa3fbd05c85db /libcxx/test/input.output/file.streams/fstreams | |
| parent | f11e8eab527fba316c64112f6e05de1a79693a3e (diff) | |
| download | bcm5719-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')
54 files changed, 0 insertions, 2399 deletions
diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp deleted file mode 100644 index 86844343ecd..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp +++ /dev/null @@ -1,54 +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_filebuf - -// void swap(basic_filebuf& rhs); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::filebuf f; - assert(f.open(temp.c_str(), 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); - assert(f.sgetc() == '2'); - std::filebuf f2; - f2.swap(f); - assert(!f.is_open()); - assert(f2.is_open()); - assert(f2.sgetc() == '2'); - } - std::remove(temp.c_str()); - { - std::wfilebuf f; - assert(f.open(temp.c_str(), 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); - assert(f.sgetc() == L'2'); - std::wfilebuf f2; - f2.swap(f); - assert(!f.is_open()); - assert(f2.is_open()); - assert(f2.sgetc() == L'2'); - } - std::remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp deleted file mode 100644 index a92ec872a54..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp +++ /dev/null @@ -1,56 +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_filebuf - -// basic_filebuf& operator=(basic_filebuf&& 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::filebuf f; - assert(f.open(temp.c_str(), 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); - assert(f.sgetc() == '2'); - std::filebuf f2; - f2 = move(f); - assert(!f.is_open()); - assert(f2.is_open()); - assert(f2.sgetc() == '2'); - } - std::remove(temp.c_str()); - { - std::wfilebuf f; - assert(f.open(temp.c_str(), 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); - assert(f.sgetc() == L'2'); - std::wfilebuf f2; - f2 = move(f); - assert(!f.is_open()); - assert(f2.is_open()); - assert(f2.sgetc() == L'2'); - } - std::remove(temp.c_str()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -} 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 deleted file mode 100644 index 084d001031d..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp +++ /dev/null @@ -1,56 +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_filebuf - -// template <class charT, class traits> -// void -// swap(basic_filebuf<charT, traits>& x, basic_filebuf<charT, traits>& y); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::filebuf f; - assert(f.open(temp.c_str(), 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); - assert(f.sgetc() == '2'); - std::filebuf f2; - swap(f2, f); - assert(!f.is_open()); - assert(f2.is_open()); - assert(f2.sgetc() == '2'); - } - std::remove(temp.c_str()); - { - std::wfilebuf f; - assert(f.open(temp.c_str(), 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); - assert(f.sgetc() == L'2'); - std::wfilebuf f2; - swap(f2, f); - assert(!f.is_open()); - assert(f2.is_open()); - assert(f2.sgetc() == L'2'); - } - std::remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp deleted file mode 100644 index f4fbbf69e69..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp +++ /dev/null @@ -1,30 +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_filebuf - -// basic_filebuf(); - -#include <fstream> -#include <cassert> - -int main() -{ - { - std::filebuf f; - assert(!f.is_open()); - } - { - std::wfilebuf f; - assert(!f.is_open()); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp deleted file mode 100644 index f13ee44700f..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp +++ /dev/null @@ -1,54 +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_filebuf - -// basic_filebuf(basic_filebuf&& 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::filebuf f; - assert(f.open(temp.c_str(), 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); - assert(f.sgetc() == '2'); - std::filebuf f2(move(f)); - assert(!f.is_open()); - assert(f2.is_open()); - assert(f2.sgetc() == '2'); - } - std::remove(temp.c_str()); - { - std::wfilebuf f; - assert(f.open(temp.c_str(), 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); - assert(f.sgetc() == L'2'); - std::wfilebuf f2(move(f)); - assert(!f.is_open()); - assert(f2.is_open()); - assert(f2.sgetc() == L'2'); - } - std::remove(temp.c_str()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -} diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp deleted file mode 100644 index 9d2d56782a3..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp +++ /dev/null @@ -1,51 +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> - -// basic_filebuf<charT,traits>* open(const char* s, ios_base::openmode mode); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::filebuf f; - assert(f.open(temp.c_str(), std::ios_base::out) != 0); - assert(f.is_open()); - assert(f.sputn("123", 3) == 3); - } - { - std::filebuf f; - assert(f.open(temp.c_str(), std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.sbumpc() == '1'); - assert(f.sbumpc() == '2'); - assert(f.sbumpc() == '3'); - } - std::remove(temp.c_str()); - { - std::wfilebuf f; - assert(f.open(temp.c_str(), std::ios_base::out) != 0); - assert(f.is_open()); - assert(f.sputn(L"123", 3) == 3); - } - { - std::wfilebuf f; - assert(f.open(temp.c_str(), std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.sbumpc() == L'1'); - assert(f.sbumpc() == L'2'); - assert(f.sbumpc() == L'3'); - } - remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp deleted file mode 100644 index 1da38569821..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp +++ /dev/null @@ -1,142 +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> - -// int_type overflow(int_type c = traits::eof()); - -// This test is not entirely portable - -#include <fstream> -#include <cassert> - -#include "platform_support.h" // locale name macros - -template <class CharT> -struct test_buf - : public std::basic_filebuf<CharT> -{ - typedef std::basic_filebuf<CharT> base; - typedef typename base::char_type char_type; - typedef typename base::int_type int_type; - typedef typename base::traits_type traits_type; - - char_type* pbase() const {return base::pbase();} - char_type* pptr() const {return base::pptr();} - char_type* epptr() const {return base::epptr();} - void gbump(int n) {base::gbump(n);} - - virtual int_type overflow(int_type c = traits_type::eof()) {return base::overflow(c);} -}; - -int main() -{ - { - test_buf<char> f; - assert(f.open("overflow.dat", std::ios_base::out) != 0); - assert(f.is_open()); - assert(f.pbase() == 0); - assert(f.pptr() == 0); - assert(f.epptr() == 0); - assert(f.overflow('a') == 'a'); - assert(f.pbase() != 0); - assert(f.pptr() == f.pbase()); - assert(f.epptr() - f.pbase() == 4095); - } - { - test_buf<char> f; - assert(f.open("overflow.dat", std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.sgetc() == 'a'); - } - std::remove("overflow.dat"); - { - test_buf<char> f; - f.pubsetbuf(0, 0); - assert(f.open("overflow.dat", std::ios_base::out) != 0); - assert(f.is_open()); - assert(f.pbase() == 0); - assert(f.pptr() == 0); - assert(f.epptr() == 0); - assert(f.overflow('a') == 'a'); - assert(f.pbase() == 0); - assert(f.pptr() == 0); - assert(f.epptr() == 0); - } - { - test_buf<char> f; - assert(f.open("overflow.dat", std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.sgetc() == 'a'); - } - std::remove("overflow.dat"); - { - test_buf<wchar_t> f; - assert(f.open("overflow.dat", std::ios_base::out) != 0); - assert(f.is_open()); - assert(f.pbase() == 0); - assert(f.pptr() == 0); - assert(f.epptr() == 0); - assert(f.overflow(L'a') == L'a'); - assert(f.pbase() != 0); - assert(f.pptr() == f.pbase()); - assert(f.epptr() - f.pbase() == 4095); - } - { - test_buf<wchar_t> f; - assert(f.open("overflow.dat", std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.sgetc() == L'a'); - } - std::remove("overflow.dat"); - { - test_buf<wchar_t> f; - f.pubsetbuf(0, 0); - assert(f.open("overflow.dat", std::ios_base::out) != 0); - assert(f.is_open()); - assert(f.pbase() == 0); - assert(f.pptr() == 0); - assert(f.epptr() == 0); - assert(f.overflow(L'a') == L'a'); - assert(f.pbase() == 0); - assert(f.pptr() == 0); - assert(f.epptr() == 0); - } - { - test_buf<wchar_t> f; - assert(f.open("overflow.dat", std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.sgetc() == L'a'); - } - std::remove("overflow.dat"); - { - test_buf<wchar_t> f; - f.pubimbue(std::locale(LOCALE_en_US_UTF_8)); - assert(f.open("overflow.dat", std::ios_base::out) != 0); - assert(f.sputc(0x4E51) == 0x4E51); - assert(f.sputc(0x4E52) == 0x4E52); - assert(f.sputc(0x4E53) == 0x4E53); - } - { - test_buf<char> f; - assert(f.open("overflow.dat", std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.sbumpc() == 0xE4); - assert(f.sbumpc() == 0xB9); - assert(f.sbumpc() == 0x91); - assert(f.sbumpc() == 0xE4); - assert(f.sbumpc() == 0xB9); - assert(f.sbumpc() == 0x92); - assert(f.sbumpc() == 0xE4); - assert(f.sbumpc() == 0xB9); - assert(f.sbumpc() == 0x93); - assert(f.sbumpc() == -1); - } - std::remove("overflow.dat"); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp deleted file mode 100644 index 4419cb51a6d..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp +++ /dev/null @@ -1,56 +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> - -// int_type pbackfail(int_type c = traits::eof()); - -// This test is not entirely portable - -#include <fstream> -#include <cassert> - -template <class CharT> -struct test_buf - : public std::basic_filebuf<CharT> -{ - typedef std::basic_filebuf<CharT> base; - typedef typename base::char_type char_type; - typedef typename base::int_type int_type; - typedef typename base::traits_type traits_type; - - char_type* eback() const {return base::eback();} - char_type* gptr() const {return base::gptr();} - char_type* egptr() const {return base::egptr();} - void gbump(int n) {base::gbump(n);} - - virtual int_type pbackfail(int_type c = traits_type::eof()) {return base::pbackfail(c);} -}; - -int main() -{ - { - test_buf<char> f; - assert(f.open("underflow.dat", std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.sbumpc() == '1'); - assert(f.sgetc() == '2'); - assert(f.pbackfail('a') == -1); - } - { - test_buf<char> f; - assert(f.open("underflow.dat", std::ios_base::in | std::ios_base::out) != 0); - assert(f.is_open()); - assert(f.sbumpc() == '1'); - assert(f.sgetc() == '2'); - assert(f.pbackfail('a') == 'a'); - assert(f.sbumpc() == 'a'); - assert(f.sgetc() == '2'); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp deleted file mode 100644 index eb15facad5b..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp +++ /dev/null @@ -1,66 +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> - -// pos_type seekoff(off_type off, ios_base::seekdir way, -// ios_base::openmode which = ios_base::in | ios_base::out); -// pos_type seekpos(pos_type sp, -// ios_base::openmode which = ios_base::in | ios_base::out); - -// This test is not entirely portable - -#include <fstream> -#include <cassert> - -int main() -{ - { - char buf[10]; - typedef std::filebuf::pos_type pos_type; - std::filebuf f; - f.pubsetbuf(buf, sizeof(buf)); - assert(f.open("seekoff.dat", std::ios_base::in | std::ios_base::out - | std::ios_base::trunc) != 0); - assert(f.is_open()); - f.sputn("abcdefghijklmnopqrstuvwxyz", 26); - assert(buf[0] == 'v'); - pos_type p = f.pubseekoff(-15, std::ios_base::cur); - assert(p == 11); - assert(f.sgetc() == 'l'); - f.pubseekoff(0, std::ios_base::beg); - assert(f.sgetc() == 'a'); - f.pubseekoff(-1, std::ios_base::end); - assert(f.sgetc() == 'z'); - assert(f.pubseekpos(p) == p); - assert(f.sgetc() == 'l'); - } - std::remove("seekoff.dat"); - { - wchar_t buf[10]; - typedef std::filebuf::pos_type pos_type; - std::wfilebuf f; - f.pubsetbuf(buf, sizeof(buf)/sizeof(buf[0])); - assert(f.open("seekoff.dat", std::ios_base::in | std::ios_base::out - | std::ios_base::trunc) != 0); - assert(f.is_open()); - f.sputn(L"abcdefghijklmnopqrstuvwxyz", 26); - assert(buf[0] == L'v'); - pos_type p = f.pubseekoff(-15, std::ios_base::cur); - assert(p == 11); - assert(f.sgetc() == L'l'); - f.pubseekoff(0, std::ios_base::beg); - assert(f.sgetc() == L'a'); - f.pubseekoff(-1, std::ios_base::end); - assert(f.sgetc() == L'z'); - assert(f.pubseekpos(p) == p); - assert(f.sgetc() == L'l'); - } - std::remove("seekoff.dat"); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.dat b/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.dat deleted file mode 100644 index e2e107ac61a..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.dat +++ /dev/null @@ -1 +0,0 @@ -123456789
\ No newline at end of file diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp deleted file mode 100644 index e34bc844bd2..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp +++ /dev/null @@ -1,121 +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> - -// int_type underflow(); - -// This test is not entirely portable - -#include <fstream> -#include <cassert> - -#include "platform_support.h" // locale name macros - -template <class CharT> -struct test_buf - : public std::basic_filebuf<CharT> -{ - typedef std::basic_filebuf<CharT> base; - typedef typename base::char_type char_type; - typedef typename base::int_type int_type; - - char_type* eback() const {return base::eback();} - char_type* gptr() const {return base::gptr();} - char_type* egptr() const {return base::egptr();} - void gbump(int n) {base::gbump(n);} - - virtual int_type underflow() {return base::underflow();} -}; - -int main() -{ - { - test_buf<char> f; - assert(f.open("underflow.dat", std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.eback() == 0); - assert(f.gptr() == 0); - assert(f.egptr() == 0); - assert(f.underflow() == '1'); - assert(f.eback() != 0); - assert(f.eback() == f.gptr()); - assert(*f.gptr() == '1'); - assert(f.egptr() - f.eback() == 9); - } - { - test_buf<char> f; - assert(f.open("underflow.dat", std::ios_base::in) != 0); - assert(f.pubsetbuf(0, 0)); - assert(f.is_open()); - assert(f.eback() == 0); - assert(f.gptr() == 0); - assert(f.egptr() == 0); - assert(f.underflow() == '1'); - assert(f.eback() != 0); - assert(f.eback() == f.gptr()); - assert(*f.gptr() == '1'); - assert(f.egptr() - f.eback() == 8); - f.gbump(8); - assert(f.sgetc() == '9'); - assert(f.eback()[0] == '5'); - assert(f.eback()[1] == '6'); - assert(f.eback()[2] == '7'); - assert(f.eback()[3] == '8'); - assert(f.gptr() - f.eback() == 4); - assert(*f.gptr() == '9'); - assert(f.egptr() - f.gptr() == 1); - } - { - test_buf<wchar_t> f; - assert(f.open("underflow.dat", std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.eback() == 0); - assert(f.gptr() == 0); - assert(f.egptr() == 0); - assert(f.underflow() == L'1'); - assert(f.eback() != 0); - assert(f.eback() == f.gptr()); - assert(*f.gptr() == L'1'); - assert(f.egptr() - f.eback() == 9); - } - { - test_buf<wchar_t> f; - assert(f.pubsetbuf(0, 0)); - assert(f.open("underflow.dat", std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.eback() == 0); - assert(f.gptr() == 0); - assert(f.egptr() == 0); - assert(f.underflow() == L'1'); - assert(f.eback() != 0); - assert(f.eback() == f.gptr()); - assert(*f.gptr() == L'1'); - assert(f.egptr() - f.eback() == 8); - f.gbump(8); - assert(f.sgetc() == L'9'); - assert(f.eback()[0] == L'5'); - assert(f.eback()[1] == L'6'); - assert(f.eback()[2] == L'7'); - assert(f.eback()[3] == L'8'); - assert(f.gptr() - f.eback() == 4); - assert(*f.gptr() == L'9'); - assert(f.egptr() - f.gptr() == 1); - } - { - test_buf<wchar_t> f; - f.pubimbue(std::locale(LOCALE_en_US_UTF_8)); - assert(f.open("underflow_utf8.dat", std::ios_base::in) != 0); - assert(f.is_open()); - assert(f.sbumpc() == 0x4E51); - assert(f.sbumpc() == 0x4E52); - assert(f.sbumpc() == 0x4E53); - assert(f.sbumpc() == -1); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow_utf8.dat b/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow_utf8.dat deleted file mode 100644 index ee7063e1207..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf.virtuals/underflow_utf8.dat +++ /dev/null @@ -1 +0,0 @@ -乑乒乓
\ No newline at end of file diff --git a/libcxx/test/input.output/file.streams/fstreams/filebuf/types.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/filebuf/types.pass.cpp deleted file mode 100644 index 5d77e0054b7..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/filebuf/types.pass.cpp +++ /dev/null @@ -1,34 +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_filebuf -// : public basic_streambuf<charT, traits> -// { -// public: -// typedef charT char_type; -// typedef traits traits_type; -// typedef typename traits_type::int_type int_type; -// typedef typename traits_type::pos_type pos_type; -// typedef typename traits_type::off_type off_type; - -#include <fstream> -#include <type_traits> - -int main() -{ - static_assert((std::is_base_of<std::basic_streambuf<char>, std::basic_filebuf<char> >::value), ""); - static_assert((std::is_same<std::basic_filebuf<char>::char_type, char>::value), ""); - static_assert((std::is_same<std::basic_filebuf<char>::traits_type, std::char_traits<char> >::value), ""); - static_assert((std::is_same<std::basic_filebuf<char>::int_type, std::char_traits<char>::int_type>::value), ""); - static_assert((std::is_same<std::basic_filebuf<char>::pos_type, std::char_traits<char>::pos_type>::value), ""); - static_assert((std::is_same<std::basic_filebuf<char>::off_type, std::char_traits<char>::off_type>::value), ""); -} 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()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp deleted file mode 100644 index cfd5a031f0f..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp +++ /dev/null @@ -1,28 +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(); - -#include <fstream> -#include <type_traits> - -int main() -{ - { - std::fstream fs; - } - { - std::wfstream fs; - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp deleted file mode 100644 index d2ae3028606..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp +++ /dev/null @@ -1,48 +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(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, std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); - std::fstream 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, std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); - std::wfstream 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.cons/pointer.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp deleted file mode 100644 index 06a6b77943a..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp +++ /dev/null @@ -1,44 +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 - -// explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in | ios_base::out); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::fstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); - double x = 0; - fs << 3.25; - fs.seekg(0); - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); - { - std::wfstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); - double x = 0; - fs << 3.25; - fs.seekg(0); - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp deleted file mode 100644 index 4b0819f8af4..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp +++ /dev/null @@ -1,46 +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 - -// explicit basic_fstream(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::fstream fs(temp, - std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); - double x = 0; - fs << 3.25; - fs.seekg(0); - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); - { - std::wfstream fs(temp, - std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); - double x = 0; - fs << 3.25; - fs.seekg(0); - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); -} 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 deleted file mode 100644 index 0e4bc7177b8..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/fstream.members/close.pass.cpp +++ /dev/null @@ -1,42 +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 close(); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::fstream fs; - assert(!fs.is_open()); - fs.open(temp.c_str(), std::ios_base::out); - assert(fs.is_open()); - fs.close(); - assert(!fs.is_open()); - } - std::remove(temp.c_str()); - { - std::wfstream fs; - assert(!fs.is_open()); - fs.open(temp.c_str(), std::ios_base::out); - assert(fs.is_open()); - fs.close(); - assert(!fs.is_open()); - } - std::remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp deleted file mode 100644 index 231bb82c743..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/fstream.members/open_pointer.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 - -// void open(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::fstream fs; - assert(!fs.is_open()); - fs.open(temp.c_str(), std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); - assert(fs.is_open()); - double x = 0; - fs << 3.25; - fs.seekg(0); - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); - { - std::wfstream fs; - assert(!fs.is_open()); - fs.open(temp.c_str(), std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); - assert(fs.is_open()); - double x = 0; - fs << 3.25; - fs.seekg(0); - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp deleted file mode 100644 index 182f12c47d1..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/fstream.members/open_string.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 - -// void open(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::fstream fs; - assert(!fs.is_open()); - fs.open(temp, std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); - assert(fs.is_open()); - double x = 0; - fs << 3.25; - fs.seekg(0); - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); - { - std::wfstream fs; - assert(!fs.is_open()); - fs.open(temp, std::ios_base::in | std::ios_base::out - | std::ios_base::trunc); - assert(fs.is_open()); - double x = 0; - fs << 3.25; - fs.seekg(0); - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp deleted file mode 100644 index d8398326910..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp +++ /dev/null @@ -1,30 +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_filebuf<charT,traits>* rdbuf() const; - -#include <fstream> -#include <cassert> - -int main() -{ - { - std::fstream fs; - assert(fs.rdbuf()); - } - { - std::wfstream fs; - assert(fs.rdbuf()); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/fstream/types.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/fstream/types.pass.cpp deleted file mode 100644 index 6ced241f75f..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/fstream/types.pass.cpp +++ /dev/null @@ -1,34 +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 -// : public basic_iostream<charT,traits> -// { -// public: -// typedef charT char_type; -// typedef traits traits_type; -// typedef typename traits_type::int_type int_type; -// typedef typename traits_type::pos_type pos_type; -// typedef typename traits_type::off_type off_type; - -#include <fstream> -#include <type_traits> - -int main() -{ - static_assert((std::is_base_of<std::basic_iostream<char>, std::basic_fstream<char> >::value), ""); - static_assert((std::is_same<std::basic_fstream<char>::char_type, char>::value), ""); - static_assert((std::is_same<std::basic_fstream<char>::traits_type, std::char_traits<char> >::value), ""); - static_assert((std::is_same<std::basic_fstream<char>::int_type, std::char_traits<char>::int_type>::value), ""); - static_assert((std::is_same<std::basic_fstream<char>::pos_type, std::char_traits<char>::pos_type>::value), ""); - static_assert((std::is_same<std::basic_fstream<char>::off_type, std::char_traits<char>::off_type>::value), ""); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp deleted file mode 100644 index 18443cedb8d..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp +++ /dev/null @@ -1,42 +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_ifstream - -// void swap(basic_ifstream& rhs); - -#include <fstream> -#include <cassert> - -int main() -{ - { - std::ifstream fs1("test.dat"); - std::ifstream fs2("test2.dat"); - fs1.swap(fs2); - double x = 0; - fs1 >> x; - assert(x == 4.5); - fs2 >> x; - assert(x == 3.25); - } - { - std::wifstream fs1("test.dat"); - std::wifstream fs2("test2.dat"); - fs1.swap(fs2); - double x = 0; - fs1 >> x; - assert(x == 4.5); - fs2 >> x; - assert(x == 3.25); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp deleted file mode 100644 index 9c2fcad33a3..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp +++ /dev/null @@ -1,40 +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_ifstream - -// basic_ifstream& operator=(basic_ifstream&& rhs); - -#include <fstream> -#include <cassert> - -int main() -{ -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - { - std::ifstream fso("test.dat"); - std::ifstream fs; - fs = move(fso); - double x = 0; - fs >> x; - assert(x == 3.25); - } - { - std::wifstream fso("test.dat"); - std::wifstream fs; - fs = move(fso); - double x = 0; - fs >> x; - assert(x == 3.25); - } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp deleted file mode 100644 index 5700720a064..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp +++ /dev/null @@ -1,43 +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_ifstream - -// template <class charT, class traits> -// void swap(basic_ifstream<charT, traits>& x, basic_ifstream<charT, traits>& y); - -#include <fstream> -#include <cassert> - -int main() -{ - { - std::ifstream fs1("test.dat"); - std::ifstream fs2("test2.dat"); - swap(fs1, fs2); - double x = 0; - fs1 >> x; - assert(x == 4.5); - fs2 >> x; - assert(x == 3.25); - } - { - std::wifstream fs1("test.dat"); - std::wifstream fs2("test2.dat"); - swap(fs1, fs2); - double x = 0; - fs1 >> x; - assert(x == 4.5); - fs2 >> x; - assert(x == 3.25); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/test.dat b/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/test.dat deleted file mode 100644 index 64064d34a8e..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/test.dat +++ /dev/null @@ -1 +0,0 @@ -3.25
\ No newline at end of file diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/test2.dat b/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/test2.dat deleted file mode 100644 index 958d30d86d0..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.assign/test2.dat +++ /dev/null @@ -1 +0,0 @@ -4.5
\ No newline at end of file diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp deleted file mode 100644 index 41e6780e807..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp +++ /dev/null @@ -1,28 +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_ifstream - -// basic_ifstream(); - -#include <fstream> -#include <type_traits> - -int main() -{ - { - std::ifstream fs; - } - { - std::wifstream fs; - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp deleted file mode 100644 index aaac1212262..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp +++ /dev/null @@ -1,38 +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_ifstream - -// basic_ifstream(basic_ifstream&& rhs); - -#include <fstream> -#include <cassert> - -int main() -{ -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - { - std::ifstream fso("test.dat"); - std::ifstream fs = move(fso); - double x = 0; - fs >> x; - assert(x == 3.25); - } - { - std::wifstream fso("test.dat"); - std::wifstream fs = move(fso); - double x = 0; - fs >> x; - assert(x == 3.25); - } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp deleted file mode 100644 index f43df3c9f84..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp +++ /dev/null @@ -1,46 +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_ifstream - -// explicit basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in); - -#include <fstream> -#include <cassert> - -int main() -{ - { - std::ifstream fs("test.dat"); - double x = 0; - fs >> x; - assert(x == 3.25); - } - { - std::ifstream fs("test.dat", std::ios_base::out); - double x = 0; - fs >> x; - assert(x == 3.25); - } - { - std::wifstream fs("test.dat"); - double x = 0; - fs >> x; - assert(x == 3.25); - } - { - std::wifstream fs("test.dat", std::ios_base::out); - double x = 0; - fs >> x; - assert(x == 3.25); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp deleted file mode 100644 index ad5fe5149df..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp +++ /dev/null @@ -1,46 +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_ifstream - -// explicit basic_ifstream(const string& s, ios_base::openmode mode = ios_base::in); - -#include <fstream> -#include <cassert> - -int main() -{ - { - std::ifstream fs(std::string("test.dat")); - double x = 0; - fs >> x; - assert(x == 3.25); - } - { - std::ifstream fs(std::string("test.dat"), std::ios_base::out); - double x = 0; - fs >> x; - assert(x == 3.25); - } - { - std::wifstream fs(std::string("test.dat")); - double x = 0; - fs >> x; - assert(x == 3.25); - } - { - std::wifstream fs(std::string("test.dat"), std::ios_base::out); - double x = 0; - fs >> x; - assert(x == 3.25); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/test.dat b/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/test.dat deleted file mode 100644 index 64064d34a8e..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.cons/test.dat +++ /dev/null @@ -1 +0,0 @@ -3.25
\ No newline at end of file diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp deleted file mode 100644 index 3e393324085..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp +++ /dev/null @@ -1,38 +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_ifstream - -// void close(); - -#include <fstream> -#include <cassert> - -int main() -{ - { - std::ifstream fs; - assert(!fs.is_open()); - fs.open("test.dat"); - assert(fs.is_open()); - fs.close(); - assert(!fs.is_open()); - } - { - std::wifstream fs; - assert(!fs.is_open()); - fs.open("test.dat"); - assert(fs.is_open()); - fs.close(); - assert(!fs.is_open()); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp deleted file mode 100644 index 47dc85fac60..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp +++ /dev/null @@ -1,46 +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_ifstream - -// void open(const char* s, ios_base::openmode mode = ios_base::in); - -#include <fstream> -#include <cassert> - -int main() -{ - { - std::ifstream fs; - assert(!fs.is_open()); - char c = 'a'; - fs >> c; - assert(fs.fail()); - assert(c == 'a'); - fs.open("test.dat"); - assert(fs.is_open()); - fs >> c; - assert(c == 'r'); - } - { - std::wifstream fs; - assert(!fs.is_open()); - wchar_t c = L'a'; - fs >> c; - assert(fs.fail()); - assert(c == L'a'); - fs.open("test.dat"); - assert(fs.is_open()); - fs >> c; - assert(c == L'r'); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp deleted file mode 100644 index 619694e2736..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp +++ /dev/null @@ -1,46 +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_ifstream - -// void open(const string& s, ios_base::openmode mode = ios_base::in); - -#include <fstream> -#include <cassert> - -int main() -{ - { - std::ifstream fs; - assert(!fs.is_open()); - char c = 'a'; - fs >> c; - assert(fs.fail()); - assert(c == 'a'); - fs.open(std::string("test.dat")); - assert(fs.is_open()); - fs >> c; - assert(c == 'r'); - } - { - std::wifstream fs; - assert(!fs.is_open()); - wchar_t c = L'a'; - fs >> c; - assert(fs.fail()); - assert(c == L'a'); - fs.open(std::string("test.dat")); - assert(fs.is_open()); - fs >> c; - assert(c == L'r'); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp deleted file mode 100644 index 53fd294e71f..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp +++ /dev/null @@ -1,32 +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_ifstream - -// basic_filebuf<charT,traits>* rdbuf() const; - -#include <fstream> -#include <cassert> - -int main() -{ - { - std::ifstream fs("test.dat"); - std::filebuf* fb = fs.rdbuf(); - assert(fb->sgetc() == 'r'); - } - { - std::wifstream fs("test.dat"); - std::wfilebuf* fb = fs.rdbuf(); - assert(fb->sgetc() == L'r'); - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream.members/test.dat b/libcxx/test/input.output/file.streams/fstreams/ifstream.members/test.dat deleted file mode 100644 index 1d2f01491f7..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream.members/test.dat +++ /dev/null @@ -1 +0,0 @@ -r
\ No newline at end of file diff --git a/libcxx/test/input.output/file.streams/fstreams/ifstream/types.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ifstream/types.pass.cpp deleted file mode 100644 index dd39eee1a17..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ifstream/types.pass.cpp +++ /dev/null @@ -1,34 +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_ifstream -// : public basic_istream<charT,traits> -// { -// public: -// typedef charT char_type; -// typedef traits traits_type; -// typedef typename traits_type::int_type int_type; -// typedef typename traits_type::pos_type pos_type; -// typedef typename traits_type::off_type off_type; - -#include <fstream> -#include <type_traits> - -int main() -{ - static_assert((std::is_base_of<std::basic_istream<char>, std::basic_ifstream<char> >::value), ""); - static_assert((std::is_same<std::basic_ifstream<char>::char_type, char>::value), ""); - static_assert((std::is_same<std::basic_ifstream<char>::traits_type, std::char_traits<char> >::value), ""); - static_assert((std::is_same<std::basic_ifstream<char>::int_type, std::char_traits<char>::int_type>::value), ""); - static_assert((std::is_same<std::basic_ifstream<char>::pos_type, std::char_traits<char>::pos_type>::value), ""); - static_assert((std::is_same<std::basic_ifstream<char>::off_type, std::char_traits<char>::off_type>::value), ""); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp deleted file mode 100644 index 519b84fb1ab..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp +++ /dev/null @@ -1,79 +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_ofstream - -// void swap(basic_ofstream& 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::ofstream fs1(temp1.c_str()); - std::ofstream fs2(temp2.c_str()); - fs1 << 3.25; - fs2 << 4.5; - fs1.swap(fs2); - fs1 << ' ' << 3.25; - fs2 << ' ' << 4.5; - } - { - std::ifstream fs(temp1.c_str()); - double x = 0; - fs >> x; - assert(x == 3.25); - fs >> x; - assert(x == 4.5); - } - std::remove(temp1.c_str()); - { - std::ifstream fs(temp2.c_str()); - double x = 0; - fs >> x; - assert(x == 4.5); - fs >> x; - assert(x == 3.25); - } - std::remove(temp2.c_str()); - { - std::wofstream fs1(temp1.c_str()); - std::wofstream fs2(temp2.c_str()); - fs1 << 3.25; - fs2 << 4.5; - fs1.swap(fs2); - fs1 << ' ' << 3.25; - fs2 << ' ' << 4.5; - } - { - std::wifstream fs(temp1.c_str()); - double x = 0; - fs >> x; - assert(x == 3.25); - fs >> x; - assert(x == 4.5); - } - std::remove(temp1.c_str()); - { - std::wifstream fs(temp2.c_str()); - double x = 0; - fs >> x; - assert(x == 4.5); - fs >> x; - assert(x == 3.25); - } - std::remove(temp2.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp deleted file mode 100644 index 0f21eb81d07..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp +++ /dev/null @@ -1,52 +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_ofstream - -// basic_ofstream& operator=(basic_ofstream&& 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::ofstream fso(temp.c_str()); - std::ofstream fs; - fs = move(fso); - fs << 3.25; - } - { - std::ifstream fs(temp.c_str()); - double x = 0; - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); - { - std::wofstream fso(temp.c_str()); - std::wofstream fs; - fs = move(fso); - fs << 3.25; - } - { - std::wifstream fs(temp.c_str()); - double x = 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/ofstream.assign/nonmember_swap.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp deleted file mode 100644 index d58f5f25600..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp +++ /dev/null @@ -1,80 +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_ofstream - -// template <class charT, class traits> -// void swap(basic_ofstream<charT, traits>& x, basic_ofstream<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::ofstream fs1(temp1.c_str()); - std::ofstream fs2(temp2.c_str()); - fs1 << 3.25; - fs2 << 4.5; - swap(fs1, fs2); - fs1 << ' ' << 3.25; - fs2 << ' ' << 4.5; - } - { - std::ifstream fs(temp1.c_str()); - double x = 0; - fs >> x; - assert(x == 3.25); - fs >> x; - assert(x == 4.5); - } - std::remove(temp1.c_str()); - { - std::ifstream fs(temp2.c_str()); - double x = 0; - fs >> x; - assert(x == 4.5); - fs >> x; - assert(x == 3.25); - } - std::remove(temp2.c_str()); - { - std::wofstream fs1(temp1.c_str()); - std::wofstream fs2(temp2.c_str()); - fs1 << 3.25; - fs2 << 4.5; - swap(fs1, fs2); - fs1 << ' ' << 3.25; - fs2 << ' ' << 4.5; - } - { - std::wifstream fs(temp1.c_str()); - double x = 0; - fs >> x; - assert(x == 3.25); - fs >> x; - assert(x == 4.5); - } - std::remove(temp1.c_str()); - { - std::wifstream fs(temp2.c_str()); - double x = 0; - fs >> x; - assert(x == 4.5); - fs >> x; - assert(x == 3.25); - } - std::remove(temp2.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp deleted file mode 100644 index f8308ab06bf..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp +++ /dev/null @@ -1,28 +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_ofstream - -// basic_ofstream(); - -#include <fstream> -#include <type_traits> - -int main() -{ - { - std::ofstream fs; - } - { - std::wofstream fs; - } -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp deleted file mode 100644 index 8645358cbd4..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/move.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_ofstream - -// basic_ofstream(basic_ofstream&& 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::ofstream fso(temp.c_str()); - std::ofstream fs = move(fso); - fs << 3.25; - } - { - std::ifstream fs(temp.c_str()); - double x = 0; - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); - { - std::wofstream fso(temp.c_str()); - std::wofstream fs = move(fso); - fs << 3.25; - } - { - std::wifstream fs(temp.c_str()); - double x = 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/ofstream.cons/pointer.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp deleted file mode 100644 index bd5832abeb5..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp +++ /dev/null @@ -1,46 +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_ofstream - -// explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::ofstream fs(temp.c_str()); - fs << 3.25; - } - { - std::ifstream fs(temp.c_str()); - double x = 0; - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); - { - std::wofstream fs(temp.c_str()); - fs << 3.25; - } - { - std::wifstream fs(temp.c_str()); - double x = 0; - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp deleted file mode 100644 index 7112b17fb8b..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp +++ /dev/null @@ -1,46 +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_ofstream - -// explicit basic_ofstream(const string& s, ios_base::openmode mode = ios_base::out); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::ofstream fs(temp); - fs << 3.25; - } - { - std::ifstream fs(temp); - double x = 0; - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); - { - std::wofstream fs(temp); - fs << 3.25; - } - { - std::wifstream fs(temp); - double x = 0; - fs >> x; - assert(x == 3.25); - } - std::remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp deleted file mode 100644 index b8c358d8ece..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp +++ /dev/null @@ -1,42 +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_ofstream - -// void close(); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::ofstream fs; - assert(!fs.is_open()); - fs.open(temp.c_str()); - assert(fs.is_open()); - fs.close(); - assert(!fs.is_open()); - } - std::remove(temp.c_str()); - { - std::wofstream fs; - assert(!fs.is_open()); - fs.open(temp.c_str()); - assert(fs.is_open()); - fs.close(); - assert(!fs.is_open()); - } - std::remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp deleted file mode 100644 index e5cddc9e164..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp +++ /dev/null @@ -1,58 +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_ofstream - -// void open(const char* s, ios_base::openmode mode = ios_base::out); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::ofstream fs; - assert(!fs.is_open()); - char c = 'a'; - fs << c; - assert(fs.fail()); - fs.open(temp.c_str()); - assert(fs.is_open()); - fs << c; - } - { - std::ifstream fs(temp.c_str()); - char c = 0; - fs >> c; - assert(c == 'a'); - } - std::remove(temp.c_str()); - { - std::wofstream fs; - assert(!fs.is_open()); - wchar_t c = L'a'; - fs << c; - assert(fs.fail()); - fs.open(temp.c_str()); - assert(fs.is_open()); - fs << c; - } - { - std::wifstream fs(temp.c_str()); - wchar_t c = 0; - fs >> c; - assert(c == L'a'); - } - std::remove(temp.c_str()); -} 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 deleted file mode 100644 index d54aa1824ab..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp +++ /dev/null @@ -1,58 +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_ofstream - -// void open(const string& s, ios_base::openmode mode = ios_base::out); - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::ofstream fs; - assert(!fs.is_open()); - char c = 'a'; - fs << c; - assert(fs.fail()); - fs.open(temp); - assert(fs.is_open()); - fs << c; - } - { - std::ifstream fs(temp.c_str()); - char c = 0; - fs >> c; - assert(c == 'a'); - } - std::remove(temp.c_str()); - { - std::wofstream fs; - assert(!fs.is_open()); - wchar_t c = L'a'; - fs << c; - assert(fs.fail()); - fs.open(temp); - assert(fs.is_open()); - fs << c; - } - { - std::wifstream fs(temp.c_str()); - wchar_t c = 0; - fs >> c; - assert(c == L'a'); - } - std::remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp deleted file mode 100644 index d707e0a32ac..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp +++ /dev/null @@ -1,36 +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_ofstream - -// basic_filebuf<charT,traits>* rdbuf() const; - -#include <fstream> -#include <cassert> -#include "platform_support.h" - -int main() -{ - std::string temp = get_temp_file_name(); - { - std::ofstream fs(temp.c_str()); - std::filebuf* fb = fs.rdbuf(); - assert(fb->sputc('r') == 'r'); - } - std::remove(temp.c_str()); - { - std::wofstream fs(temp.c_str()); - std::wfilebuf* fb = fs.rdbuf(); - assert(fb->sputc(L'r') == L'r'); - } - std::remove(temp.c_str()); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/ofstream/types.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/ofstream/types.pass.cpp deleted file mode 100644 index 243994addcc..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/ofstream/types.pass.cpp +++ /dev/null @@ -1,34 +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_ofstream -// : public basic_ostream<charT,traits> -// { -// public: -// typedef charT char_type; -// typedef traits traits_type; -// typedef typename traits_type::int_type int_type; -// typedef typename traits_type::pos_type pos_type; -// typedef typename traits_type::off_type off_type; - -#include <fstream> -#include <type_traits> - -int main() -{ - static_assert((std::is_base_of<std::basic_ostream<char>, std::basic_ofstream<char> >::value), ""); - static_assert((std::is_same<std::basic_ofstream<char>::char_type, char>::value), ""); - static_assert((std::is_same<std::basic_ofstream<char>::traits_type, std::char_traits<char> >::value), ""); - static_assert((std::is_same<std::basic_ofstream<char>::int_type, std::char_traits<char>::int_type>::value), ""); - static_assert((std::is_same<std::basic_ofstream<char>::pos_type, std::char_traits<char>::pos_type>::value), ""); - static_assert((std::is_same<std::basic_ofstream<char>::off_type, std::char_traits<char>::off_type>::value), ""); -} diff --git a/libcxx/test/input.output/file.streams/fstreams/version.pass.cpp b/libcxx/test/input.output/file.streams/fstreams/version.pass.cpp deleted file mode 100644 index 44b85141680..00000000000 --- a/libcxx/test/input.output/file.streams/fstreams/version.pass.cpp +++ /dev/null @@ -1,20 +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> - -#include <fstream> - -#ifndef _LIBCPP_VERSION -#error _LIBCPP_VERSION not defined -#endif - -int main() -{ -} |

