mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 20:29:39 +08:00
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// REQUIRES: locale.en_US.UTF-8
|
||||
// REQUIRES: locale.fr_FR.UTF-8
|
||||
|
||||
@@ -23,6 +22,8 @@
|
||||
|
||||
#include "platform_support.h" // locale name macros
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
struct testbuf
|
||||
: public std::streambuf
|
||||
{
|
||||
@@ -158,6 +159,7 @@ int main()
|
||||
ios1.copyfmt(ios1);
|
||||
assert(!f1_called);
|
||||
|
||||
#ifndef TEST_HAS_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
ios1.copyfmt(ios2);
|
||||
@@ -166,6 +168,9 @@ int main()
|
||||
catch (std::ios_base::failure&)
|
||||
{
|
||||
}
|
||||
#else
|
||||
ios1.copyfmt(ios2);
|
||||
#endif
|
||||
assert(ios1.rdstate() == std::ios::eofbit);
|
||||
assert(ios1.rdbuf() == &sb1);
|
||||
assert(ios1.flags() == (std::ios::showpoint | std::ios::uppercase));
|
||||
|
||||
Reference in New Issue
Block a user