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

Function check_exceptions_submit

tests/BS_thread_pool_test.cpp:2175–2190  ·  view source on GitHub ↗

* @brief Check that exceptions are forwarded correctly by submit_task(). */

Source from the content-addressed store, hash-verified

2173 * @brief Check that exceptions are forwarded correctly by submit_task().
2174 */
2175void 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`.

Callers 1

mainFunction · 0.85

Calls 3

loglnFunction · 0.85
checkFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected