Livt packages
Livt.Net
Version 1.4.1
Ethernet, IPv4, TCP, UDP, ARP, TFTP, and Telnet networking components for Livt hardware.
Published files (163)
- ethernet
- services
- tftp
- ArpCompositionChecks.lvt
- ArpPacketParserTest.lvt
- ArpResponderTest.lvt
- ChecksumApiTest.lvt
- ChecksumWordSumTest.lvt
- CompactPacketFieldsTest.lvt
- CountingPacketData.lvt
- EthernetFrameBuilderTest.lvt
- EthernetFrameParserTest.lvt
- EthernetLiteDeviceFixture.lvt
- EthernetLiteDriverTest.lvt
- EthernetLiteReceiveWindowTest.lvt
- EthernetLiteResetScenario.lvt
- EthernetLiteResetTest.lvt
- FaultingFrameData.lvt
- FaultingPacketData.lvt
- FrameCapacityTest.lvt
- FrameCompositionTest.lvt
- FrameForwarder.lvt
- FrameLinkTest.lvt
- FrameMii10Link.lvt
- FrameMiiLink.lvt
- FrameMiiPins.lvt
- GenericPacketTest.lvt
- IcmpCapacityChecks.lvt
- IcmpEchoResponderTest.lvt
- IcmpStorageBackendTest.lvt
- InternetChecksumTest.lvt
- Ipv4HeaderBuilderTest.lvt
- Ipv4HeaderChecksumTest.lvt
- Ipv4PacketFieldsTest.lvt
- Ipv4PacketParserTest.lvt
- MiiFrame10Test.lvt
- MiiFrameTest.lvt
- PacketConvenienceTest.lvt
- PacketDataTest.lvt
- PacketMetadataStub.lvt
- PacketMetadataTest.lvt
- PacketParserFailureTest.lvt
- PacketStorageParityTest.lvt
- RamIpv4PacketParserTest.lvt
- ReceiveContractChecks.lvt
- ScheduledWordSumTest.lvt
- SynAckCompositionChecks.lvt
- TcpChecksumTest.lvt
- TcpConnectionRecognizerTest.lvt
- TcpHeaderParserTest.lvt
- TcpMultiSessionArrayStorageTest.lvt
- TcpMultiSessionAutoStorageTest.lvt
- TcpMultiSessionDistributedStorageTest.lvt
- TcpMultiSessionMixedStorageTest.lvt
- TcpMultiSessionStorageChecks.lvt
- TcpMultiSessionTest.lvt
- TcpRamPacketTest.lvt
- TcpRetryTimerTest.lvt
- TcpSegmentBuilderTest.lvt
- TcpSegmentTest.lvt
- TcpStreamServerArrayStorageTest.lvt
- TcpStreamServerAutoStorageTest.lvt
- TcpStreamServerDistributedStorageTest.lvt
- TcpStreamServerMixedStorageTest.lvt
- TcpStreamServerStorageChecks.lvt
- TcpStreamServerTest.lvt
- TelnetSessionTest.lvt
- TransmitContractChecks.lvt
- UdpPacketTest.lvt
tests/FaultingPacketData.lvt
namespace Livt.Net.Tests
using Livt.Net
/**
* Borrows a stable provider and injects one scheduled read failure.
* The harness changes the failure index only outside active source borrows.
*/
component FaultingPacketData<P: IPacketData> : IPacketData
{
// Borrowed provider and test-controlled failure location.
source: P
failureIndex: int
/**
* Binds the source; failure injection starts disabled.
*/
new(source: P)
{
this.source = source
this.failureIndex = -1
}
/**
* Selects a failing byte index; -1 disables injection.
*/
public fn SetFailure(index: int)
{
this.failureIndex = index
}
/**
* Reports the underlying publication state without acquiring it.
*/
override fn IsReady() bool
{
return this.source.IsReady()
}
/**
* Preserves the provider's readable prefix length.
*/
override fn GetAvailableLength() int
{
return this.source.GetAvailableLength()
}
/**
* Fails at the configured byte, otherwise delegates the checked read.
*/
override fn TryRead(index: int, value: out byte) PacketDataResult
{
value = 0x00
if (index == this.failureIndex) {
return PacketDataResult.NotReady
}
return this.source.TryRead(index, value)
}
}