virtual void SetUp() {
TickTime::UseFakeClock(12345);
receiver_.reset(new MockReceiver());
+ ON_CALL(*receiver_, DeliverPacket(_, _))
+ .WillByDefault(Return(PacketReceiver::DELIVERY_OK));
}
virtual void TearDown() {
// Test the capacity link and verify we get as many packets as we expect.
TEST_F(FakeNetworkPipeTest, CapacityTest) {
FakeNetworkPipe::Config config;
- config.queue_length = 20;
+ config.queue_length_packets = 20;
config.link_capacity_kbps = 80;
scoped_ptr<FakeNetworkPipe> pipe(new FakeNetworkPipe(config));
pipe->SetReceiver(receiver_.get());
// Test the extra network delay.
TEST_F(FakeNetworkPipeTest, ExtraDelayTest) {
FakeNetworkPipe::Config config;
- config.queue_length = 20;
+ config.queue_length_packets = 20;
config.queue_delay_ms = 100;
config.link_capacity_kbps = 80;
scoped_ptr<FakeNetworkPipe> pipe(new FakeNetworkPipe(config));
// packets too quickly.
TEST_F(FakeNetworkPipeTest, QueueLengthTest) {
FakeNetworkPipe::Config config;
- config.queue_length = 2;
+ config.queue_length_packets = 2;
config.link_capacity_kbps = 80;
scoped_ptr<FakeNetworkPipe> pipe(new FakeNetworkPipe(config));
pipe->SetReceiver(receiver_.get());
// Test we get statistics as expected.
TEST_F(FakeNetworkPipeTest, StatisticsTest) {
FakeNetworkPipe::Config config;
- config.queue_length = 2;
+ config.queue_length_packets = 2;
config.queue_delay_ms = 20;
config.link_capacity_kbps = 80;
scoped_ptr<FakeNetworkPipe> pipe(new FakeNetworkPipe(config));
// delivery times change accordingly.
TEST_F(FakeNetworkPipeTest, ChangingCapacityWithEmptyPipeTest) {
FakeNetworkPipe::Config config;
- config.queue_length = 20;
+ config.queue_length_packets = 20;
config.link_capacity_kbps = 80;
scoped_ptr<FakeNetworkPipe> pipe(new FakeNetworkPipe(config));
pipe->SetReceiver(receiver_.get());
// delivery times change accordingly.
TEST_F(FakeNetworkPipeTest, ChangingCapacityWithPacketsInPipeTest) {
FakeNetworkPipe::Config config;
- config.queue_length = 20;
+ config.queue_length_packets = 20;
config.link_capacity_kbps = 80;
scoped_ptr<FakeNetworkPipe> pipe(new FakeNetworkPipe(config));
pipe->SetReceiver(receiver_.get());