diff options
author | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2016-11-14 13:44:50 +0000 |
---|---|---|
committer | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2016-11-14 13:44:50 +0000 |
commit | aa35ecfecda832eecaebbcc41f7369b1b2b945ca (patch) | |
tree | 9798f791662f8d1436fb04894333c63ea6194cc0 /libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp | |
parent | c78f5d4194e466fd9cf234c03f33822242a69fb4 (diff) | |
download | bcm5719-llvm-aa35ecfecda832eecaebbcc41f7369b1b2b945ca.tar.gz bcm5719-llvm-aa35ecfecda832eecaebbcc41f7369b1b2b945ca.zip |
Protect std::ios tests under libcpp-no-exceptions
Skip tests that expect an exception be thrown. Also add
some missing asserts in the original test.
Differential Revision: https://reviews.llvm.org/D26512
llvm-svn: 286823
Diffstat (limited to 'libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp')
-rw-r--r-- | libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp b/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp index 1c40a81aa06..8852c9b55bb 100644 --- a/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp +++ b/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/set_rdbuf.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // <ios> // template <class charT, class traits> class basic_ios @@ -18,6 +17,8 @@ #include <streambuf> #include <cassert> +#include "test_macros.h" + struct testbuf : public std::streambuf { @@ -35,16 +36,20 @@ int main() testbuf sb1; testbuf sb2; testios ios(&sb1); +#ifndef TEST_HAS_NO_EXCEPTIONS try { ios.setstate(std::ios::badbit); ios.exceptions(std::ios::badbit); + assert(false); } catch (...) { } +#endif ios.set_rdbuf(&sb2); assert(ios.rdbuf() == &sb2); +#ifndef TEST_HAS_NO_EXCEPTIONS try { ios.setstate(std::ios::badbit); @@ -53,6 +58,7 @@ int main() catch (...) { } +#endif ios.set_rdbuf(0); assert(ios.rdbuf() == 0); } |