aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
AgeCommit message (Collapse)Author
2018-03-13Relax some of the checks in the loopback test to avoid false positives.Bryce Van Dyk
- For the silent loopback test we check that we don't get any sound above an epsilon. The value of this epsilon has been increased to accommodate a wider range of systems. - The delay on all tests has been increased to allow for more time to capture looped samples. The original 150ms delay was sufficient on the machine I tested with, however, I've seen the tests fail due to not having enough looped input.
2018-03-01Add test to verify the behaviour a different return values for data callbacks.Bryce Van Dyk
2018-01-26Fix deadlock and device collection changed callback issue on OSX (#401)Paul Adenot
* Add an automated test to ensure creating a duplex stream with a device collection changed callback works. * Fix a deadlock When creating an aggregate device, and a device collection change callback was installed, a deadlock occured, because the device collection change listener was being called synchronously. Use GCD to send a task to a serial queue, and carefuly unlock the mutex in audiounit_stream_destroy to not deadlock on the queue. * Don't call the device collection change callback when creating cubeb's own aggregate device. * Remove std:: prefix, there is a using namespace std; now. * Address review comments * Address even more comments.
2018-01-23Explicitly init stream_params.prefs in tests.Bryce Van Dyk
Also update the example code comment in cubbeb.h to reflect new param usage.
2018-01-23Update loopback test to check that output is not passed in data callbackBryce Van Dyk
2018-01-23Respond to review comments.Bryce Van Dyk
- Fix indentation in header - Adjust spacing for casts and pointer + ref declarations - Adjust comments in test about locking after stop - Simplify default device selection when loopback is involved
2018-01-23Add loopback test where devices are explicitly selected via device id.Bryce Van Dyk
2018-01-23Add test for loopback when playback is silentBryce Van Dyk
2018-01-23Add further test for separate loopback and playback streams.Bryce Van Dyk
Add a test to verify loopback works when loopback and playback streams are created separately.
2018-01-23Add loopback test file and test for duplex stream with loopback.Bryce Van Dyk
Add a test file for loopback tests and add to build script. This file is currently configured to be Windows only in build scripts, as the WASAPI backend is currently the only backend supporting the new loopback interface. Add a test for duplex streams using the default output device and a loopback from the same device.
2018-01-18Don't enumerate private aggregate devices in cubeb_audiounit.cpp (#400)Paul Adenot
2018-01-12cubeb_resampler_speex: don't call data callback while draining (#398)Karl Tomlinson
* extend resampler_drain test to assert that data callback is not called while draining * cubeb_resampler_speex: don't call data callback while draining This support for this was dropped in https://github.com/kinetiknz/cubeb/commit/06c689c2ad37347bfb20061d2bcb0e5ea037e561#diff-2f55f506bd2dd918b7b8c6ceec8aee0dL238 but documented later in https://github.com/kinetiknz/cubeb/commit/4b4e6e3db126ee62af7514fff65a7f6bd7346aeb#diff-a2acb4d7d9909e5853f52f32b203283dR301 even though it was no longer provided.
2017-10-13Mute test deadlockAlex Chronopoulos
2017-10-03Implement some rudimentary underrun protection for duplex streams (#354)Paul Adenot
* Implement some rudimentary underrun protection for duplex streams * Fix resampler api change that broke test_resampler.cpp * Address review comments, clean things up a bit * Address acronop comments, and add a test. * Address more comments from achronop, and test mono and stereo input * Fix warning.
2017-08-29Add a thread reset API for the ring buffer class.Paul Adenot
This allow reseting the consumer/producer thread id in the ring buffer class, so that we can take into account the change in thread inherent to the audio devices changes. This fixes #320.
2017-08-29test_sanity: Assert devid are same between two cubeb_eumerate_devices.Dan Glastonbury
2017-08-07Remove unused B2G-only stream_type field from cubeb_stream_params. (#347)Matthew Gregan
2017-07-12New test for undefined layout on outputAlex Chronopoulos
2017-06-24Change cubeb_get_min_latency to take params via pointer.Dan Glastonbury
To be consistent with cubeb_stream_init, take the cubeb_stream_params parameter via pointer instead of by value. This is a public API change only---Backends are handed params by value via ops table.
2017-06-06audiounit: clear tsan warningsAlex Chronopoulos
2017-06-02Fix test_mixer fails on local build (#316)Chun-Min Chang
* Fix test_mixer on OS X * Fix warnings of comparison of integers of different signs: 'long' and 'unsigned long' * Add debugging messages for test_mixer * Move channel_names from common.h to test_mixer.cpp * Explain why we need an extra assertion
2017-05-29cubeb: Test cubeb_device_collection_destroy behaviour.Dan Glastonbury
2017-05-26cubeb_get_preferred_channel_layout should be verified in test_sanity instead ↵Chun-Min Chang
of test_latency
2017-05-26Correct the check for mixed resultsChun-Min Chang
2017-05-26Add assertions to check we don't write out of bound of bufferChun-Min Chang
2017-05-26Add osx-specific setting for downmixing testChun-Min Chang
2017-05-25Rework device collection (#309)Dan Glastonbury
Rust compatiblity change to cubeb_device_collection. Replace the C dynamic allocation with magic header into a structure that hold pointer + count of entries. This is the same memory layout that rust uses for fat pointers for &[T], Box<[T]>, etc.
2017-05-23Add backend specification support to common.hDan Glastonbury
Set CUBEB_BACKEND env var to the name of valid backend supported by the current platform to prefer that backend over the default choice. If CUBEB_BACKEND is not valid, backend selection falls back to the standard behaviour. A warning is printed to stderr if the chosen backend id doesn't match the requested one.
2017-05-22Push destroy fns to backend (#302)Dan Glastonbury
* Make cubeb_device_info_destroy private. * Move implementation of cubeb_device_collection_destroy to cubeb_utils. * Move cubeb_device_collection_destroy implementation into backend. Push the responsiblity for destroying device collections to the backends so they can make independent choices on how to handle allocation. * Unstage space changes
2017-05-22Fix memory leaks in tests.Dan Glastonbury
2017-05-02Use same mixer interface for wasapi and audiounit (#290)Chun-Min Chang
* Rename mixing stuff to mixer in wasapi to align the name in audiounit * Use an identical mixer interface * Remove CUBEB_MIXER_DIRECTION_ALL * Fix the wrong assert * Use cubeb_sample_format as parameter type in cubeb_mixer_create and remove weird comment * Use explicit for cubeb_mixer_impl's constructor * Breakdown assertion in cubeb_downmix * Remove const for cubeb_mixer::mix
2017-04-25Pulse layout assert (#291)Alex Chronopoulos
* pulse: relax input layout assert * test: update record test to accept undefined layout * pulse: create pa stream with default layout
2017-04-17Replace RAII wrapper with unique_ptrChun-Min Chang
2017-04-13tests: Remove code preferring floats on Win32Michael Maltese
The WASAPI backend supports S16, same as the other backends.
2017-04-07Add a deadlock test on OSX (#266)Chun-Min Chang
* Add a deadlock test and intentionally produce a deadlock on OSX * Replace std::mutex by owned_critical_section * Restore audiounit_get_preferred_channel_layout * Revise comments * Add more log and comments for better readability.
2017-04-07Use auto-for-loop in test_mixer.cpp and fix typoChun-Min Chang
2017-04-07Use plain std::unique_ptr and new instead of custom deleterChun-Min Chang
2017-04-07Using gtest style's error message in cubeb (#274)Chun-Min Chang
* Replace printf by fprintf * Turn error log into gtest's style * Avoid scan-build warning by replacing raw pointer with unique_ptr
2017-04-06assert everywhere rather than returning a resultChun-Min Chang
2017-04-06Replace cubeb_cleaner and cubeb_stream_cleaner by unique_ptrChun-Min Chang
2017-04-06Using RAII helpers for cubeb context and stream but leaving test_sanity for ↵Chun-Min Chang
explicit flow control
2017-03-27Replace printf by fprintf with stderrChun-Min Chang
2017-03-27Replace assert by gtest assertionChun-Min Chang
2017-03-21Remove templated non-thread-safety from ring_buffer_base.Matthew Gregan
2017-03-15test_overload_callback: Use the standard STREAM_FORMAT definition.Matthew Gregan
2017-03-13cubeb-api: Give cubeb_init a third param, backend nameDamien Zammit
This allows forcing of a particular backend by name, *if* it was compiled in, otherwise default list is tried in default order as before. Tests updated to reflect new api. (Gecko change required) Using JACK backend: 100% tests passed, 0 tests failed out of 13 Total Test time (real) = 183.75 sec Signed-off-by: Damien Zammit <[email protected]>
2017-03-09Make `stop_and_join_render_thread` more idempotent, and add a test.Paul Adenot
This fixes Gecko bug #1345147.
2017-02-17audiounit: additional fix for drift cases (#235)Alex Chronopoulos
* audiounit: additional fix for drift cases * test_resampler: change expected frames to the frames used
2017-02-07Multiple channel support on OS X (#212)Chun-Min Chang
* fix typo * Add cubeb_channel_map_to_layout * Implement audiounit_get_preferred_channel_layout * Implement audiounit_layout_init * Create auto_channel_layout to replace raw operation of AudioChannelLayout * Apply cubeb_channel_map_to_layout in cubeb_pulse.c * Use enum instead of bool to indicate input or output * Show input/output, preferred or not in error message for channel layout * Replace Boolean writable by nullptr * Null the raw pointer(layout) after freeing it * Use fieldOffset to calculate size of AudioChannelLayout * Return CUBEB_ERROR when preferred layout is non-SMPTE format * Check layout is undefined when cubeb_get_preferred_channel_layout returns ERROR
2017-02-06Fix test compilation when compiling inside Gecko.Paul Adenot