Home | History | Annotate | Download | only in test

Lines Matching refs:Packets

58 static bool IsSequenceNumberSorted(const Packets& packets) {
59 PacketsConstIt last_it = packets.begin();
60 for (PacketsConstIt it = last_it; it != packets.end(); ++it) {
71 Packets packets;
72 // Insert some packets in order...
73 EXPECT_TRUE(IsTimeSorted(packets));
75 packets.push_back(Packet(100, 0));
76 EXPECT_TRUE(IsTimeSorted(packets));
78 packets.push_back(Packet(110, 0));
79 EXPECT_TRUE(IsTimeSorted(packets));
82 packets.push_back(Packet(100, 0));
83 EXPECT_FALSE(IsTimeSorted(packets));
86 packets.pop_back();
87 packets.push_back(Packet(120, 0));
88 EXPECT_TRUE(IsTimeSorted(packets));
92 Packets packets;
93 // Insert some packets in order...
94 EXPECT_TRUE(IsSequenceNumberSorted(packets));
96 packets.push_back(Packet(0, 100));
97 EXPECT_TRUE(IsSequenceNumberSorted(packets));
99 packets.push_back(Packet(0, 110));
100 EXPECT_TRUE(IsSequenceNumberSorted(packets));
103 packets.push_back(Packet(0, 100));
104 EXPECT_FALSE(IsSequenceNumberSorted(packets));
107 packets.pop_back();
108 packets.push_back(Packet(0, 120));
109 EXPECT_TRUE(IsSequenceNumberSorted(packets));
183 Packets packets;
187 packets.push_back(Packet(0, now_ms_ * 1000, payload_bits / 8, header));
189 filter_.RunFor(run_for_ms, &packets);
190 ASSERT_TRUE(IsTimeSorted(packets));
212 // generating packets every 10 ms.
235 Packets::size_type sent_packets = 0;
236 Packets::size_type remaining_packets = 0;
240 Packets packets;
241 sent_packets += packets.size();
242 filter.RunFor(0, &packets);
243 ASSERT_TRUE(IsTimeSorted(packets));
244 ASSERT_TRUE(IsSequenceNumberSorted(packets));
245 remaining_packets += packets.size();
250 // Generate and process 10000 packets in different batch sizes (some empty)
252 Packets packets;
253 packets.insert(packets.end(), i % 10, Packet());
254 sent_packets += packets.size();
255 filter.RunFor(0, &packets);
256 ASSERT_TRUE(IsTimeSorted(packets));
257 ASSERT_TRUE(IsSequenceNumberSorted(packets));
258 remaining_packets += packets.size();
262 Packets::size_type expected_packets = loss_fraction * sent_packets;
285 // With 100% loss, the result should be exact (no packets out).
301 Packets packets;
303 packets.push_back(Packet(now_ms_ * 1000 + (sequence_number_ >> 4),
307 filter_.RunFor(run_for_ms, &packets);
308 ASSERT_TRUE(IsTimeSorted(packets));
309 ASSERT_TRUE(IsSequenceNumberSorted(packets));
310 for (PacketsConstIt it = packets.begin(); it != packets.end(); ++it) {
313 EXPECT_EQ(out_packets, packets.size());
314 accumulated_packets_.splice(accumulated_packets_.end(), packets);
362 Packets accumulated_packets_;
374 TestDelayFilter(1, 0, 0); // Check no packets are still in buffer
377 TestDelayFilter(1, 0, 0); // Check no packets are still in buffer
398 Packets acc;
399 Packets packets;
401 // Delay a bunch of packets, accumulate them to the 'acc' list.
404 packets.push_back(Packet(i * 100, i));
406 delay.RunFor(1000, &packets);
407 acc.splice(acc.end(), packets);
411 // Drop delay to zero, send a few more packets through the delay, append them
415 packets.push_back(Packet(i * 100, i));
417 delay.RunFor(1000, &packets);
418 acc.splice(acc.end(), packets);
448 // Generate packets, add jitter to them, accumulate the altered packets.
449 Packets original;
450 Packets jittered;
452 Packets packets;
454 packets.push_back(Packet(now_ms * 1000, sequence_number++));
457 original.insert(original.end(), packets.begin(), packets.end());
458 filter.RunFor(stddev_jitter_ms, &packets);
459 jittered.splice(jittered.end(), packets);
462 // Jittered packets should still be in order.
469 // Make sure jittered and original packets are in same order. Collect time
506 // Generate packets with 10 ms interval.
507 Packets packets;
511 packets.push_back(Packet(now_ms * 1000, sequence_number++));
513 ASSERT_TRUE(IsTimeSorted(packets));
514 ASSERT_TRUE(IsSequenceNumberSorted(packets));
516 // Reorder packets, verify that send times are still in order.
519 filter.RunFor(now_ms, &packets);
520 ASSERT_TRUE(IsTimeSorted(packets));
523 // of-order packets have been moved in the stream.
526 for (PacketsIt it = packets.begin(); it != packets.end(); ++it) {
541 // For 0% reordering, no packets should have been moved, so result is exact.
563 // adjacent packets, when the likelihood of a swap is 1.0, a swap will always
584 // Generate a bunch of packets, apply choke, verify output is ordered.
585 Packets packets;
591 packets.push_back(Packet(0, send_time_ms * 1000, 125, header));
594 ASSERT_TRUE(IsTimeSorted(packets));
595 filter->RunFor(run_for_ms, &packets);
597 output_packets_.splice(output_packets_.end(), packets);
627 Packets output_packets_;
634 // 100ms, 100 packets, 10 kbps choke -> 1 kbit of data should have propagated.
643 // 100ms, 10 packets, 10 kbps choke -> 1 packet through, or 1 kbit.
647 // 200ms, no new packets -> another packet through.
649 // 1000ms, no new packets -> 8 more packets.
651 // 2000ms, no new packets -> queue is empty so no output.
656 // 100ms, 100 packets in queue, 10 kbps choke -> 1 packet through, or 1 kbit.
662 // 1000ms, no input, 8 packets through.
664 // 10000ms, no input, raise choke to 100 kbps. Remaining 90 packets in queue
668 // 10100ms, 20 more packets -> 10 packets or 10 kbit through.
670 // 10300ms, 10 more packets -> 20 packets out.
682 // 100ms, 100 packets in queue, 10 kbps choke -> 1 packet through, or 1 kbit.
685 // 500ms, no input, 4 more packets through.
687 // 10000ms, no input, remaining packets should have been dropped.
692 // 10100ms, 50 more packets -> 2 packets or 2 kbit through.
695 // 20000ms, no input, remaining packets in queue should have been dropped.
698 // Reset delay cap (0 is no cap) and verify no packets are dropped.
706 // According to the input file 6 packets should be transmitted within
714 // According to the input file 19 packets should be transmitted within
715 // 280 milliseconds (at the wrapping point two packets are sent back to back).
725 // Uses all slots up to 110 ms. Several packets are being dropped.
738 Packets packets;
739 sender->RunFor(run_for_ms, &packets);
740 ASSERT_TRUE(IsTimeSorted(packets));
741 ASSERT_TRUE(IsSequenceNumberSorted(packets));
742 EXPECT_EQ(expected_packets, packets.size());
749 for (PacketsIt it = packets.begin(); it != packets.end(); ++it) {
774 // We're at 1 fps, so all packets should be generated on first call, giving 10
775 // packets of each 1000 bytes, total 10000 bytes.
793 // 500ms, first frame (this is the offset we set), 10 packets of 1000 bytes.
844 // Each frame is 102500/25=4100 bytes, or 5 packets (4 @1000 bytes, 1 @100),
864 Packets packets;
865 // Generate some packets, verify they are sorted.
866 sender1.RunFor(999, &packets);
867 ASSERT_TRUE(IsTimeSorted(packets));
868 ASSERT_TRUE(IsSequenceNumberSorted(packets));
869 EXPECT_EQ(9u, packets.size());
870 // Generate some more packets and verify they are appended to end of list.
871 sender1.RunFor(1000, &packets);
872 ASSERT_TRUE(IsTimeSorted(packets));
873 ASSERT_TRUE(IsSequenceNumberSorted(packets));
874 EXPECT_EQ(18u, packets.size());
879 // Generate some packets, verify that they are merged with the packets already
881 sender2.RunFor(999, &packets);
882 ASSERT_TRUE(IsTimeSorted(packets));
883 EXPECT_EQ(36u, packets.size());
885 sender2.RunFor(1000, &packets);
886 ASSERT_TRUE(IsTimeSorted(packets));
887 EXPECT_EQ(54u, packets.size());