Make RTCPSenderTest test more robust to ordering
The test assumed a certain order in report blocks, which can have changed with tasks to use unordered collections. This commit makes the test more robust. Bug: webrtc:12689 Change-Id: Ie0087dcb7dc955d70aa39208848bb99fd2f1750b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216386 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Victor Boivie <boivie@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33863}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
f97afd65b2
commit
aeff995ca8
@ -28,7 +28,9 @@
|
||||
|
||||
using ::testing::_;
|
||||
using ::testing::ElementsAre;
|
||||
using ::testing::Eq;
|
||||
using ::testing::Invoke;
|
||||
using ::testing::Property;
|
||||
using ::testing::SizeIs;
|
||||
|
||||
namespace webrtc {
|
||||
@ -276,11 +278,11 @@ TEST_F(RtcpSenderTest, SendRrWithTwoReportBlocks) {
|
||||
EXPECT_EQ(0, rtcp_sender->SendRTCP(feedback_state(), kRtcpRr));
|
||||
EXPECT_EQ(1, parser()->receiver_report()->num_packets());
|
||||
EXPECT_EQ(kSenderSsrc, parser()->receiver_report()->sender_ssrc());
|
||||
EXPECT_EQ(2U, parser()->receiver_report()->report_blocks().size());
|
||||
EXPECT_EQ(kRemoteSsrc,
|
||||
parser()->receiver_report()->report_blocks()[0].source_ssrc());
|
||||
EXPECT_EQ(kRemoteSsrc + 1,
|
||||
parser()->receiver_report()->report_blocks()[1].source_ssrc());
|
||||
EXPECT_THAT(
|
||||
parser()->receiver_report()->report_blocks(),
|
||||
UnorderedElementsAre(
|
||||
Property(&rtcp::ReportBlock::source_ssrc, Eq(kRemoteSsrc)),
|
||||
Property(&rtcp::ReportBlock::source_ssrc, Eq(kRemoteSsrc + 1))));
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendSdes) {
|
||||
|
Reference in New Issue
Block a user