// Test that we send an Ethernet frame whose size is less than the MTU,
// and that we don't send an Ethernet frame whose size is greater than
// the MTU.
Test that we send an Ethernet frame whose size is less than the MTU,
and that we don't send an Ethernet frame whose size is greater than
the MTU.
Test that we send an Ethernet frame whose size is less than the MTU and that we don ' t send an Ethernet frame whose size is greater than the MTU .
fn test(size: usize, expect_frames_sent: usize) {
            let mut ctx = DummyCtx::with_state(DummyEthernetCtx::new(
                DUMMY_CONFIG_V4.local_mac,
                Ipv6::MINIMUM_LINK_MTU.into(),
            ));
            <DummyCtx as ArpHandler<_, _>>::insert_static_neighbor(
                &mut ctx,
                DummyDeviceId,
                DUMMY_CONFIG_V4.remote_ip.get(),
                DUMMY_CONFIG_V4.remote_mac.get(),
            );
            let _ = send_ip_frame(
                &mut ctx,
                DummyDeviceId,
                DUMMY_CONFIG_V4.remote_ip,
                Buf::new(&mut vec![0; size], ..),
            );
            assert_eq!(ctx.frames().len(), expect_frames_sent);
        }
fn test ( size : usize , expect_frames_sent : usize ) { let mut ctx = DummyCtx :: with_state ( DummyEthernetCtx :: new ( DUMMY_CONFIG_V4 . local_mac , Ipv6 :: MINIMUM_LINK_MTU . into ( ) , ) ) ; < DummyCtx as ArpHandler < _ , _ > > :: insert_static_neighbor ( & mut ctx , DummyDeviceId , DUMMY_CONFIG_V4 . remote_ip . get ( ) , DUMMY_CONFIG_V4 . remote_mac . get ( ) , ) ; let _ = send_ip_frame ( & mut ctx , DummyDeviceId , DUMMY_CONFIG_V4 . remote_ip , Buf :: new ( & mut vec ! [ 0 size ] , .. ) , ) ; assert_eq ! ( ctx frames ( ) len ( ) expect_frames_sent ) ; }
Test that we send an Ethernet frame whose size is less than the MTU,
and that we don't send an Ethernet frame whose size is greater than
the MTU.
Test that we send an Ethernet frame whose size is less than the MTU and that we don ' t send an Ethernet frame whose size is greater than the MTU .
size
usize
expect_frames_sent
usize