Skip to content

Commit

Permalink
test for jb list
Browse files Browse the repository at this point in the history
  • Loading branch information
olofkallander committed Nov 2, 2023
1 parent 491636f commit d0e9817
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/transport/JitterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,3 +970,35 @@ TEST_F(JitterBufferTest, reorderedFull)
EXPECT_EQ(_buffer.count(), _buffer.SIZE - 50);
EXPECT_TRUE(_buffer.add(std::move(p)));
}

TEST_F(JitterBufferTest, reorderedOne)
{
memory::Packet stageArea;
{
auto header = rtp::RtpHeader::create(stageArea);
header->ssrc = 4000;
stageArea.setLength(250);
}

EXPECT_EQ(_buffer.pop(), nullptr);

auto p = memory::makeUniquePacket(_allocator, stageArea);
auto header = rtp::RtpHeader::create(*p);
header->sequenceNumber = 100;
header->timestamp = 56000;
EXPECT_TRUE(_buffer.add(std::move(p)));

p = memory::makeUniquePacket(_allocator, stageArea);
header = rtp::RtpHeader::create(*p);
header->sequenceNumber = 98;
header->timestamp = 57000;
EXPECT_TRUE(_buffer.add(std::move(p)));

p = _buffer.pop();
header = rtp::RtpHeader::fromPacket(*p);
EXPECT_EQ(header->sequenceNumber.get(), 98);

p = _buffer.pop();
header = rtp::RtpHeader::fromPacket(*p);
EXPECT_EQ(header->sequenceNumber.get(), 100);
}

0 comments on commit d0e9817

Please sign in to comment.