1 #define BOOST_TEST_MAIN
2 #include <boost/test/included/unit_test.hpp>
6 #include "thread_pool.hpp"
8 BOOST_AUTO_TEST_CASE( int_test
)
10 std::atomic_int
count(0);
13 nova::thread_pool
pool(4);
15 for (int i
= 0; i
!= 100; ++i
) {
22 BOOST_REQUIRE_EQUAL( count
, 100 );
25 BOOST_AUTO_TEST_CASE( future_test
)
27 std::future
<int> answer
;
30 nova::thread_pool
pool(4);
32 answer
= pool
.schedule([]() {
37 BOOST_REQUIRE_EQUAL( answer
.get(), 42 );