To write an automated test to validate if the installTap(onBus bus:bufferSize:format:block:) function is calling our logics, I created an abstraction. This abstraction, instead of always installing a tap at inputNode from an AVAudioEngine instance. I inject an input node (AVAudioNode) where the install tap will be executed. At production code, I inject the microphone node, but on tests, I inject an AVAudioPlayerNode instance that produce some AVAudioBuffers. But, the test is pretty flaky, and sometimes fails because we got an exception with -10851 error code, which means kAudioUnitErr_InvalidPropertyValue. How can I write automated tests to installTap?
1
0
1.1k