1 #define BOOST_TEST_MAIN
2 #include <boost/test/included/unit_test.hpp>
3 #include <boost/thread.hpp>
5 #define protected public
7 #include "audio_backend/audio_backend.hpp"
8 #include "audio_backend/portaudio.hpp"
18 template <typename backend
>
19 void test_backend(void)
23 BOOST_REQUIRE(!be
.audiostream_ready());
25 device_list devs
= be
.list_devices();
26 be
.open_audio_stream(devs
[0], devs
[0].inchannels
, devs
[0], devs
[0].outchannels
, devs
[0].defaultSampleRate
);
28 BOOST_REQUIRE(be
.audiostream_ready());
30 BOOST_REQUIRE(!be
.is_active());
32 BOOST_REQUIRE(be
.is_active());
35 boost::xtime_get(&xt
, boost::TIME_UTC
);
38 boost::thread::sleep(xt
);
42 BOOST_REQUIRE(!be
.is_active());
43 be
.close_audio_stream();
44 BOOST_REQUIRE(!be
.audiostream_ready());
47 BOOST_AUTO_TEST_CASE( dummy_test_1
)
49 test_backend
<dummy_backend
<&tick
> >();
52 BOOST_AUTO_TEST_CASE( pa_test_1
)
54 test_backend
<portaudio_backend
<&tick
> >();