* @brief Check that exceptions are forwarded correctly by `BS::multi_future`. */
| 2193 | * @brief Check that exceptions are forwarded correctly by `BS::multi_future`. |
| 2194 | */ |
| 2195 | void check_exceptions_multi_future() |
| 2196 | { |
| 2197 | BS::thread_pool pool; |
| 2198 | logln("Checking that exceptions are forwarded correctly by BS::multi_future..."); |
| 2199 | bool caught = false; |
| 2200 | BS::multi_future<void> future; |
| 2201 | future.push_back(pool.submit_task(throws)); |
| 2202 | future.push_back(pool.submit_task(throws)); |
| 2203 | try |
| 2204 | { |
| 2205 | future.get(); |
| 2206 | } |
| 2207 | catch (const test_exception&) |
| 2208 | { |
| 2209 | caught = true; |
| 2210 | } |
| 2211 | check(caught); |
| 2212 | } |
| 2213 | #endif |
| 2214 | |
| 2215 | // ===================================== |