| 1211 | } |
| 1212 | |
| 1213 | void |
| 1214 | testExceptions() |
| 1215 | { |
| 1216 | // operator=(array const&) |
| 1217 | fail_loop([&](storage_ptr const& sp) |
| 1218 | { |
| 1219 | array a0({1, true, str_}); |
| 1220 | array a1; |
| 1221 | array a(sp); |
| 1222 | a.emplace_back(nullptr); |
| 1223 | a = a0; |
| 1224 | a1 = a; |
| 1225 | check(a1); |
| 1226 | }); |
| 1227 | |
| 1228 | // operator=(init_list) |
| 1229 | fail_loop([&](storage_ptr const& sp) |
| 1230 | { |
| 1231 | init_list init{ 1, true, str_ }; |
| 1232 | array a1; |
| 1233 | array a(sp); |
| 1234 | a.emplace_back(nullptr); |
| 1235 | a = init; |
| 1236 | a1 = a; |
| 1237 | check(a1); |
| 1238 | }); |
| 1239 | |
| 1240 | // insert(const_iterator, count, value_type const&) |
| 1241 | fail_loop([&](storage_ptr const& sp) |
| 1242 | { |
| 1243 | array a1; |
| 1244 | array a({1, true}, sp); |
| 1245 | a.insert(a.begin() + 1, |
| 1246 | 3, nullptr); |
| 1247 | a1 = a; |
| 1248 | BOOST_TEST(a1.size() == 5); |
| 1249 | BOOST_TEST(a1[0].is_number()); |
| 1250 | BOOST_TEST(a1[1].is_null()); |
| 1251 | BOOST_TEST(a1[2].is_null()); |
| 1252 | BOOST_TEST(a1[3].is_null()); |
| 1253 | BOOST_TEST(a1[4].is_bool()); |
| 1254 | }); |
| 1255 | |
| 1256 | // insert(const_iterator, InputIt, InputIt) |
| 1257 | fail_loop([&](storage_ptr const& sp) |
| 1258 | { |
| 1259 | init_list init{ 1, true, str_ }; |
| 1260 | array a1; |
| 1261 | array a(sp); |
| 1262 | a.insert(a.end(), |
| 1263 | init.begin(), init.end()); |
| 1264 | a1 = a; |
| 1265 | check(a1); |
| 1266 | }); |
| 1267 | |
| 1268 | // emplace(const_iterator, arg) |
| 1269 | fail_loop([&](storage_ptr const& sp) |
| 1270 | { |