[ ] multiple_senders_one_receiver_concurrent: two senders are running concurrently; both are connected to same slot of same receiver; receiver mixes samples from two senders into one stream
(this test is similar to existing test multiple_senders_one_receiver_sequential, but senders are running concurrently instead of one after another)
[ ] receiver_slots_concurrent: two senders are running concurrently; sender 1 is connected to slot 1 of receiver, sender 2 is connected to slot 2 of receiver; receiver mixes samples from two senders into one stream
(this test is similar to existing test receiver_slots_sequential, but senders are running concurrently instead of one after another)
Note: existing tests run only one sender, or run senders sequentially. It means in existing tests, receiver always produces stream from only one sender, without mixing. Senders produce sequence of incrementing samples, and receiver checks that it also receives sequence of incremented samples.
These new tests will run senders concurrently, which means that receiver will mix samples from two senders. Further more, each sender will have its own (unknown) shift of its stream, and we can;t predict how exactly they can be mixed.
We'll need to adjust sender sample generation (test_helpers/sender.h) and receiver sample checks (test_helpers/receiver.h) for these two tests. For example, for this case we can do a simpler check: sender assigns all samples same constant value X; receiver checks that the stream looks like 0 0 0 ... X X X ... 2X 2X 2X ... X X X ... 0 0 0 (i.e. stream is first all zeros, while there are no senders, then it becomes X, when there is one sender, then 2X, when both senders are connected, then X again when one sender is disconnected, and then all zeros again when all senders are disconnected).
The new behavior can be enabled using some flag used specifically for the new tests. We already are passing flags from test to sender and receiver ctors.
Add integration tests for C API for concurrently running senders.
Current tests: https://github.com/roc-streaming/roc-toolkit/blob/develop/src/tests/public_api/test_sender_receiver.cpp API documentation: https://roc-streaming.org/toolkit/docs/api.html
What tests to add (to
test_sender_receiver.cpp
):[ ]
multiple_senders_one_receiver_concurrent
: two senders are running concurrently; both are connected to same slot of same receiver; receiver mixes samples from two senders into one stream(this test is similar to existing test
multiple_senders_one_receiver_sequential
, but senders are running concurrently instead of one after another)[ ]
receiver_slots_concurrent
: two senders are running concurrently; sender 1 is connected to slot 1 of receiver, sender 2 is connected to slot 2 of receiver; receiver mixes samples from two senders into one stream(this test is similar to existing test
receiver_slots_sequential
, but senders are running concurrently instead of one after another)Note: existing tests run only one sender, or run senders sequentially. It means in existing tests, receiver always produces stream from only one sender, without mixing. Senders produce sequence of incrementing samples, and receiver checks that it also receives sequence of incremented samples.
These new tests will run senders concurrently, which means that receiver will mix samples from two senders. Further more, each sender will have its own (unknown) shift of its stream, and we can;t predict how exactly they can be mixed.
We'll need to adjust sender sample generation (test_helpers/sender.h) and receiver sample checks (test_helpers/receiver.h) for these two tests. For example, for this case we can do a simpler check: sender assigns all samples same constant value
X
; receiver checks that the stream looks like0 0 0 ... X X X ... 2X 2X 2X ... X X X ... 0 0 0
(i.e. stream is first all zeros, while there are no senders, then it becomes X, when there is one sender, then 2X, when both senders are connected, then X again when one sender is disconnected, and then all zeros again when all senders are disconnected).The new behavior can be enabled using some flag used specifically for the new tests. We already are passing flags from test to sender and receiver ctors.
Background: #328.