* @brief Check that exceptions are forwarded correctly by submit_task(). */
| 2173 | * @brief Check that exceptions are forwarded correctly by submit_task(). |
| 2174 | */ |
| 2175 | void check_exceptions_submit() |
| 2176 | { |
| 2177 | BS::thread_pool pool; |
| 2178 | logln("Checking that exceptions are forwarded correctly by submit_task()..."); |
| 2179 | bool caught = false; |
| 2180 | std::future<void> future = pool.submit_task(throws); |
| 2181 | try |
| 2182 | { |
| 2183 | future.get(); |
| 2184 | } |
| 2185 | catch (const test_exception&) |
| 2186 | { |
| 2187 | caught = true; |
| 2188 | } |
| 2189 | check(caught); |
| 2190 | } |
| 2191 | |
| 2192 | /** |
| 2193 | * @brief Check that exceptions are forwarded correctly by `BS::multi_future`. |