MCPcopy Create free account
hub / github.com/bshoshany/thread-pool / check_exceptions_multi_future

Function check_exceptions_multi_future

tests/BS_thread_pool_test.cpp:2195–2212  ·  view source on GitHub ↗

* @brief Check that exceptions are forwarded correctly by `BS::multi_future`. */

Source from the content-addressed store, hash-verified

2193 * @brief Check that exceptions are forwarded correctly by `BS::multi_future`.
2194 */
2195void 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// =====================================

Callers 1

mainFunction · 0.85

Calls 3

loglnFunction · 0.85
checkFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected