supernova: jack backend - improve xrun handling
[supercollider.git] / testsuite / supernova / server_scheduler_test.cpp
blob523c473967fcad9d8a4ab8a3bcdfa4bc4663287c
1 #include <boost/test/unit_test.hpp>
3 #include <boost/thread.hpp>
4 #include <boost/thread/barrier.hpp>
6 #include "server/server_scheduler.hpp"
8 using namespace nova;
9 using namespace boost;
11 BOOST_AUTO_TEST_CASE( scheduler_test_1 )
13 scheduler<> sched(1);
14 /* sched(); */
17 namespace
19 boost::barrier barr(2);
20 void thread_fn(scheduler<> * sched)
22 for (int i = 0; i != 1000; ++i)
23 /* (*sched)() */;
24 barr.wait();
28 BOOST_AUTO_TEST_CASE( scheduler_test_2 )
30 scheduler<> sched(1);
31 boost::thread thrd(boost::bind(thread_fn, &sched));
32 barr.wait();