Index: libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp =================================================================== --- libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp +++ libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // // template @@ -18,13 +17,21 @@ #include #include +#include "test_macros.h" + struct B { static int count_; static int population_; int data_; explicit B() : data_(1) { ++population_; } - B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; } + B(const B &b) { + ++count_; + if (count_ == 3) + TEST_THROW(1); + data_ = b.data_; + ++population_; + } ~B() {data_ = 0; --population_; } }; @@ -49,6 +56,7 @@ B* bp = (B*)pool; B b[N]; assert(B::population_ == N); +#ifndef TEST_HAS_NO_EXCEPTIONS try { std::uninitialized_copy(b, b+N, bp); @@ -58,6 +66,7 @@ { assert(B::population_ == N); } +#endif B::count_ = 0; std::uninitialized_copy(b, b+2, bp); for (int i = 0; i < 2; ++i) Index: libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp =================================================================== --- libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp +++ libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.copy/uninitialized_copy_n.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // // template @@ -18,13 +17,21 @@ #include #include +#include "test_macros.h" + struct B { static int count_; static int population_; int data_; explicit B() : data_(1) { ++population_; } - B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; } + B(const B &b) { + ++count_; + if (count_ == 3) + TEST_THROW(1); + data_ = b.data_; + ++population_; + } ~B() {data_ = 0; --population_; } }; @@ -49,6 +56,7 @@ B* bp = (B*)pool; B b[N]; assert(B::population_ == N); +#ifndef TEST_HAS_NO_EXCEPTIONS try { std::uninitialized_copy_n(b, 5, bp); @@ -58,6 +66,7 @@ { assert(B::population_ == N); } +#endif B::count_ = 0; std::uninitialized_copy_n(b, 2, bp); for (int i = 0; i < 2; ++i) Index: libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp =================================================================== --- libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp +++ libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // // template @@ -17,13 +16,21 @@ #include #include +#include "test_macros.h" + struct B { static int count_; static int population_; int data_; explicit B() : data_(1) { ++population_; } - B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; } + B(const B &b) { + ++count_; + if (count_ == 3) + TEST_THROW(1); + data_ = b.data_; + ++population_; + } ~B() {data_ = 0; --population_; } }; @@ -47,6 +54,7 @@ char pool[sizeof(B)*N] = {0}; B* bp = (B*)pool; assert(B::population_ == 0); +#ifndef TEST_HAS_NO_EXCEPTIONS try { std::uninitialized_fill_n(bp, 5, B()); @@ -56,6 +64,7 @@ { assert(B::population_ == 0); } +#endif B::count_ = 0; B* r = std::uninitialized_fill_n(bp, 2, B()); assert(r == bp + 2); Index: libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp =================================================================== --- libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp +++ libcxx/trunk/test/std/utilities/memory/specialized.algorithms/uninitialized.fill/uninitialized_fill.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // // template @@ -18,13 +17,21 @@ #include #include +#include "test_macros.h" + struct B { static int count_; static int population_; int data_; explicit B() : data_(1) { ++population_; } - B(const B& b) {if (++count_ == 3) throw 1; data_ = b.data_; ++population_; } + B(const B &b) { + ++count_; + if (count_ == 3) + TEST_THROW(1); + data_ = b.data_; + ++population_; + } ~B() {data_ = 0; --population_; } }; @@ -48,6 +55,7 @@ char pool[sizeof(B)*N] = {0}; B* bp = (B*)pool; assert(B::population_ == 0); +#ifndef TEST_HAS_NO_EXCEPTIONS try { std::uninitialized_fill(bp, bp+N, B()); @@ -57,6 +65,7 @@ { assert(B::population_ == 0); } +#endif B::count_ = 0; std::uninitialized_fill(bp, bp+2, B()); for (int i = 0; i < 2; ++i)