diff --git a/src/tests/roc_pipeline/test_helpers/packet_reader.h b/src/tests/roc_pipeline/test_helpers/packet_reader.h index a952439472..5244e0b195 100644 --- a/src/tests/roc_pipeline/test_helpers/packet_reader.h +++ b/src/tests/roc_pipeline/test_helpers/packet_reader.h @@ -69,9 +69,9 @@ class PacketReader : public core::NonCopyable<> { abs_offset_ += samples_per_packet; } - packet::PacketPtr read_nonzero_packet(size_t samples_per_packet, - const audio::SampleSpec& sample_spec, - core::nanoseconds_t base_capture_ts = 0) { + void read_nonzero_packet(size_t samples_per_packet, + const audio::SampleSpec& sample_spec, + core::nanoseconds_t base_capture_ts = 0) { packet::PacketPtr pp = read_packet_(); audio::sample_t samples[MaxSamples] = {}; @@ -86,8 +86,6 @@ class PacketReader : public core::NonCopyable<> { } CHECK(non_zero > 0); abs_offset_ += samples_per_packet; - - return pp; } void read_zero_packet(size_t samples_per_packet, diff --git a/src/tests/roc_pipeline/test_sender_sink_receiver_source.cpp b/src/tests/roc_pipeline/test_loopback_sink_2_source.cpp similarity index 95% rename from src/tests/roc_pipeline/test_sender_sink_receiver_source.cpp rename to src/tests/roc_pipeline/test_loopback_sink_2_source.cpp index 587cb16c0e..8d843e9e9a 100644 --- a/src/tests/roc_pipeline/test_sender_sink_receiver_source.cpp +++ b/src/tests/roc_pipeline/test_loopback_sink_2_source.cpp @@ -353,21 +353,21 @@ void send_receive(int flags, } // namespace -TEST_GROUP(sender_sink_receiver_source) {}; +TEST_GROUP(loopback_sink_2_source) {}; -TEST(sender_sink_receiver_source, bare_rtp) { +TEST(loopback_sink_2_source, bare_rtp) { enum { Chans = Chans_Stereo, NumSess = 1 }; send_receive(FlagNone, NumSess, Chans, Chans); } -TEST(sender_sink_receiver_source, interleaving) { +TEST(loopback_sink_2_source, interleaving) { enum { Chans = Chans_Stereo, NumSess = 1 }; send_receive(FlagInterleaving, NumSess, Chans, Chans); } -TEST(sender_sink_receiver_source, fec_rs) { +TEST(loopback_sink_2_source, fec_rs) { enum { Chans = Chans_Stereo, NumSess = 1 }; if (is_fec_supported(FlagReedSolomon)) { @@ -375,7 +375,7 @@ TEST(sender_sink_receiver_source, fec_rs) { } } -TEST(sender_sink_receiver_source, fec_ldpc) { +TEST(loopback_sink_2_source, fec_ldpc) { enum { Chans = Chans_Stereo, NumSess = 1 }; if (is_fec_supported(FlagLDPC)) { @@ -383,7 +383,7 @@ TEST(sender_sink_receiver_source, fec_ldpc) { } } -TEST(sender_sink_receiver_source, fec_interleaving) { +TEST(loopback_sink_2_source, fec_interleaving) { enum { Chans = Chans_Stereo, NumSess = 1 }; if (is_fec_supported(FlagReedSolomon)) { @@ -391,7 +391,7 @@ TEST(sender_sink_receiver_source, fec_interleaving) { } } -TEST(sender_sink_receiver_source, fec_loss) { +TEST(loopback_sink_2_source, fec_loss) { enum { Chans = Chans_Stereo, NumSess = 1 }; if (is_fec_supported(FlagReedSolomon)) { @@ -399,7 +399,7 @@ TEST(sender_sink_receiver_source, fec_loss) { } } -TEST(sender_sink_receiver_source, fec_drop_source) { +TEST(loopback_sink_2_source, fec_drop_source) { enum { Chans = Chans_Stereo, NumSess = 0 }; if (is_fec_supported(FlagReedSolomon)) { @@ -407,7 +407,7 @@ TEST(sender_sink_receiver_source, fec_drop_source) { } } -TEST(sender_sink_receiver_source, fec_drop_repair) { +TEST(loopback_sink_2_source, fec_drop_repair) { enum { Chans = Chans_Stereo, NumSess = 1 }; if (is_fec_supported(FlagReedSolomon)) { @@ -415,25 +415,25 @@ TEST(sender_sink_receiver_source, fec_drop_repair) { } } -TEST(sender_sink_receiver_source, channel_mapping_stereo_to_mono) { +TEST(loopback_sink_2_source, channel_mapping_stereo_to_mono) { enum { FrameChans = Chans_Stereo, PacketChans = Chans_Mono, NumSess = 1 }; send_receive(FlagNone, NumSess, FrameChans, PacketChans); } -TEST(sender_sink_receiver_source, channel_mapping_mono_to_stereo) { +TEST(loopback_sink_2_source, channel_mapping_mono_to_stereo) { enum { FrameChans = Chans_Mono, PacketChans = Chans_Stereo, NumSess = 1 }; send_receive(FlagNone, NumSess, FrameChans, PacketChans); } -TEST(sender_sink_receiver_source, timestamp_mapping) { +TEST(loopback_sink_2_source, timestamp_mapping) { enum { Chans = Chans_Stereo, NumSess = 1 }; send_receive(FlagRTCP | FlagCTS, NumSess, Chans, Chans); } -TEST(sender_sink_receiver_source, timestamp_mapping_remixing) { +TEST(loopback_sink_2_source, timestamp_mapping_remixing) { enum { FrameChans = Chans_Mono, PacketChans = Chans_Stereo, NumSess = 1 }; send_receive(FlagRTCP | FlagCTS, NumSess, FrameChans, PacketChans); diff --git a/src/tests/roc_pipeline/test_sender_sink.cpp b/src/tests/roc_pipeline/test_sender_sink.cpp index 9d00fc0913..b6a18106d1 100644 --- a/src/tests/roc_pipeline/test_sender_sink.cpp +++ b/src/tests/roc_pipeline/test_sender_sink.cpp @@ -361,7 +361,7 @@ TEST(sender_sink, timestamp_mapping) { packet_reader.read_eof(); } -TEST(sender_sink, timestamp_mapping_remixing_packet_reader) { +TEST(sender_sink, timestamp_mapping_remixing) { enum { InputRate = 48000, PacketRate = 44100, @@ -408,6 +408,7 @@ TEST(sender_sink, timestamp_mapping_remixing_packet_reader) { if (np == 0) { cts = pp->rtp()->capture_timestamp; CHECK(cts >= unix_base); + CHECK(cts < unix_base + core::Millisecond); } else { test::expect_capture_timestamp(cts, pp->rtp()->capture_timestamp, packet_sample_spec,