Livt packages

Livt.Net

Version 1.4.1

Ethernet, IPv4, TCP, UDP, ARP, TFTP, and Telnet networking components for Livt hardware.

Published files (163)

tests/FrameCapacityTest.lvt

namespace Livt.Net.Tests

using Livt.Net

/**
 * Runs complete protocol checks against independently sized component graphs.
 */
@Test
component FrameCapacityTest
{
	icmpSmall: IcmpCapacityChecks<96>
	icmpLarge: IcmpCapacityChecks<256>
	small: ArpCompositionChecks<96>
	large: ArpCompositionChecks<256>

	/**
	 * Constructs independent capacities so generic graphs cannot share mutable preparation state.
	 */
	new()
	{
		this.icmpSmall = new IcmpCapacityChecks<96>()
		this.icmpLarge = new IcmpCapacityChecks<256>()
		this.small = new ArpCompositionChecks<96>()
		this.large = new ArpCompositionChecks<256>()
	}

	/**
	 * Exercises independent capacities to detect accidental sharing between generic specializations.
	 */
	@Test
	fn SpecializesProtocolGraphsIndependently()
	{
		this.icmpSmall.Check()
		this.icmpLarge.Check()
		this.small.Check()
		this.large.Check()
	}
}