1 #include <boost/test/unit_test.hpp>
2 #include <boost/thread.hpp>
4 #include "audio_backend/sndfile_backend.hpp"
11 aligned_storage_ptr
<float> data(nova::calloc_aligned
<float>(64));
13 struct engine_functor
;
23 sndfile_backend
<engine_functor
> be
;
25 void engine_functor::run_tick(void)
27 float * data_ptr
= data
.get();
28 be
.output_mapping(&data_ptr
, &data_ptr
+ 1);
33 BOOST_AUTO_TEST_CASE( sndfile_backend_test_1
)
35 BOOST_REQUIRE(!be
.audio_is_opened());
36 BOOST_REQUIRE(!be
.audio_is_active());
38 be
.open_client("", "./output.wav", 44100, SF_FORMAT_WAV
| SF_FORMAT_PCM_16
, 1);
39 BOOST_REQUIRE(be
.audio_is_opened());
42 BOOST_REQUIRE(be
.audio_is_active());
46 boost::xtime_get(&xt
, boost::TIME_UTC
);
48 boost::thread::sleep(xt
);
50 be
.deactivate_audio();
51 BOOST_REQUIRE(!be
.audio_is_active());
54 BOOST_REQUIRE(!be
.audio_is_opened());