From a06c95935237e1a38503a88b0771d67d28b6b6c6 Mon Sep 17 00:00:00 2001 From: Jason Ernst Date: Thu, 22 Aug 2024 12:01:09 -0700 Subject: [PATCH] fix test params --- .../com/jasonernst/icmp_common/v4/ICMPv4Test.kt | 8 ++++---- .../com/jasonernst/icmp_common/v6/ICMPv6Test.kt | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/icmp-common/src/test/kotlin/com/jasonernst/icmp_common/v4/ICMPv4Test.kt b/icmp-common/src/test/kotlin/com/jasonernst/icmp_common/v4/ICMPv4Test.kt index 625dff4..d7ac242 100644 --- a/icmp-common/src/test/kotlin/com/jasonernst/icmp_common/v4/ICMPv4Test.kt +++ b/icmp-common/src/test/kotlin/com/jasonernst/icmp_common/v4/ICMPv4Test.kt @@ -24,7 +24,7 @@ class ICMPv4Test { val buffer = ByteBuffer.wrap(icmPv4EchoPacket.toByteArray()) val stringDumper = StringPacketDumper(logger) stringDumper.dumpBuffer(buffer, 0, buffer.limit()) - val parsedPacket = ICMPHeader.fromStream(buffer, true) + val parsedPacket = ICMPHeader.fromStream(buffer, isIcmpV4 = true) assertEquals(icmPv4EchoPacket, parsedPacket) } @@ -39,7 +39,7 @@ class ICMPv4Test { ) val buffer = ByteBuffer.wrap(icmPv4EchoPacket.toByteArray()) stringDumper.dumpBuffer(buffer, 0, buffer.limit()) - val parsedPacket = ICMPHeader.fromStream(buffer, true) + val parsedPacket = ICMPHeader.fromStream(buffer, isIcmpV4 = true) assertEquals(icmPv4EchoPacket, parsedPacket) } @@ -52,7 +52,7 @@ class ICMPv4Test { ) val buffer = ByteBuffer.wrap(icmpV4DestinationUnreachablePacket.toByteArray()) stringDumper.dumpBuffer(buffer, 0, buffer.limit()) - val parsedPacket = ICMPHeader.fromStream(buffer, true) + val parsedPacket = ICMPHeader.fromStream(buffer, isIcmpV4 = true) assertEquals(icmpV4DestinationUnreachablePacket, parsedPacket) } @@ -65,7 +65,7 @@ class ICMPv4Test { ) val buffer = ByteBuffer.wrap(icmPv4TimeExceededPacket.toByteArray()) stringDumper.dumpBuffer(buffer, 0, buffer.limit()) - val parsedPacket = ICMPHeader.fromStream(buffer, true) + val parsedPacket = ICMPHeader.fromStream(buffer, isIcmpV4 = true) assertEquals(icmPv4TimeExceededPacket, parsedPacket) } diff --git a/icmp-common/src/test/kotlin/com/jasonernst/icmp_common/v6/ICMPv6Test.kt b/icmp-common/src/test/kotlin/com/jasonernst/icmp_common/v6/ICMPv6Test.kt index 94a1af9..4793628 100644 --- a/icmp-common/src/test/kotlin/com/jasonernst/icmp_common/v6/ICMPv6Test.kt +++ b/icmp-common/src/test/kotlin/com/jasonernst/icmp_common/v6/ICMPv6Test.kt @@ -24,7 +24,7 @@ class ICMPv6Test { val buffer = ByteBuffer.wrap(icmPv6EchoPacket.toByteArray()) val stringDumper = StringPacketDumper(logger) stringDumper.dumpBuffer(buffer, 0, buffer.limit()) - val parsedPacket = ICMPHeader.fromStream(buffer, false) + val parsedPacket = ICMPHeader.fromStream(buffer, isIcmpV4 = false) assertEquals(icmPv6EchoPacket, parsedPacket) } @@ -40,7 +40,7 @@ class ICMPv6Test { val buffer = ByteBuffer.wrap(icmPv6EchoPacket.toByteArray()) stringDumper.dumpBuffer(buffer, 0, buffer.limit()) - val parsedPacket = ICMPHeader.fromStream(buffer, false) + val parsedPacket = ICMPHeader.fromStream(buffer, isIcmpV4 = false) assertEquals(icmPv6EchoPacket, parsedPacket) } @@ -53,7 +53,7 @@ class ICMPv6Test { ) val buffer = ByteBuffer.wrap(icmpV6DestinationUnreachablePacket.toByteArray()) stringDumper.dumpBuffer(buffer, 0, buffer.limit()) - val parsedPacket = ICMPHeader.fromStream(buffer, false) + val parsedPacket = ICMPHeader.fromStream(buffer, isIcmpV4 = false) assertEquals(icmpV6DestinationUnreachablePacket, parsedPacket) } @@ -66,7 +66,7 @@ class ICMPv6Test { ) val buffer = ByteBuffer.wrap(icmPv6TimeExceededPacket.toByteArray()) stringDumper.dumpBuffer(buffer, 0, buffer.limit()) - val parsedPacket = ICMPHeader.fromStream(buffer, false) + val parsedPacket = ICMPHeader.fromStream(buffer, isIcmpV4 = false) assertEquals(icmPv6TimeExceededPacket, parsedPacket) } @@ -75,7 +75,7 @@ class ICMPv6Test { val icmpV6MulticastListenerDiscoveryV2 = ICMPv6MulticastListenerDiscoveryV2(data = byteArrayOf(0x01, 0x02, 0x03, 0x04)) val buffer = ByteBuffer.wrap(icmpV6MulticastListenerDiscoveryV2.toByteArray()) stringDumper.dumpBuffer(buffer, 0, buffer.limit()) - val parsedPacket = ICMPHeader.fromStream(buffer, false) + val parsedPacket = ICMPHeader.fromStream(buffer, isIcmpV4 = false) assertEquals(icmpV6MulticastListenerDiscoveryV2, parsedPacket) } @@ -92,7 +92,7 @@ class ICMPv6Test { ) val buffer = ByteBuffer.wrap(icmpV6RouterAdvertisement.toByteArray()) stringDumper.dumpBuffer(buffer, 0, buffer.limit()) - val parsedPacket = ICMPHeader.fromStream(buffer, false) + val parsedPacket = ICMPHeader.fromStream(buffer, isIcmpV4 = false) assertEquals(icmpV6RouterAdvertisement, parsedPacket) } @@ -103,7 +103,7 @@ class ICMPv6Test { ) val buffer = ByteBuffer.wrap(icmpV6RouterSolicitation.toByteArray()) stringDumper.dumpBuffer(buffer, 0, buffer.limit()) - val parsedPacket = ICMPHeader.fromStream(buffer, false) + val parsedPacket = ICMPHeader.fromStream(buffer, isIcmpV4 = false) assertEquals(icmpV6RouterSolicitation, parsedPacket) }