1 #include <boost/test/unit_test.hpp>
3 #include <boost/thread.hpp>
4 #include <boost/bind.hpp>
6 #include "utilities/callback_system.hpp"
7 #include "utilities/callback_interpreter.hpp"
8 #include "nova-tt/thread_priority.hpp"
27 BOOST_AUTO_TEST_CASE( callback_system_test
)
29 callback_system
<dummy
> cbs
;
31 cbs
.add_callback(new dummy());
33 BOOST_REQUIRE_EQUAL(i
, 1);
36 BOOST_AUTO_TEST_CASE( threaded_callback_interpreter_test
)
38 threaded_callback_interpreter
<dummy
> cbi
;
42 for (int j
= 0; j
!= 20; ++j
)
43 cbi
.add_callback(new dummy());
46 BOOST_REQUIRE_EQUAL(i
, 21);
49 BOOST_AUTO_TEST_CASE( callback_interpreter_threadpool_test
)
52 callback_interpreter_threadpool
<dummy
> cbi(4, true, thread_priority_interval().first
);
54 for (int j
= 0; j
!= 20; ++j
)
55 cbi
.add_callback(new dummy());
57 BOOST_REQUIRE_EQUAL(i
, 41);