diff options
Diffstat (limited to 'test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp')
-rw-r--r-- | test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp b/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp index f01d35b9a33c..6847694e4b73 100644 --- a/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp +++ b/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp @@ -7,18 +7,23 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // test bitset<N>& reset(size_t pos); #include <bitset> #include <cassert> +#include "test_macros.h" + template <std::size_t N> -void test_reset_one() +void test_reset_one(bool test_throws) { std::bitset<N> v; +#ifdef TEST_HAS_NO_EXCEPTIONS + if (test_throws) return; +#else try { +#endif v.set(); v.reset(50); if (50 >= v.size()) @@ -28,21 +33,25 @@ void test_reset_one() assert(!v[i]); else assert(v[i]); + assert(!test_throws); +#ifndef TEST_HAS_NO_EXCEPTIONS } catch (std::out_of_range&) { + assert(test_throws); } +#endif } int main() { - test_reset_one<0>(); - test_reset_one<1>(); - test_reset_one<31>(); - test_reset_one<32>(); - test_reset_one<33>(); - test_reset_one<63>(); - test_reset_one<64>(); - test_reset_one<65>(); - test_reset_one<1000>(); + test_reset_one<0>(true); + test_reset_one<1>(true); + test_reset_one<31>(true); + test_reset_one<32>(true); + test_reset_one<33>(true); + test_reset_one<63>(false); + test_reset_one<64>(false); + test_reset_one<65>(false); + test_reset_one<1000>(false); } |