summaryrefslogtreecommitdiffstats
path: root/vpp-common/vpp-translate-utils/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'vpp-common/vpp-translate-utils/src/test/java')
-rw-r--r--vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/Ipv6TranslatorTest.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/Ipv6TranslatorTest.java b/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/Ipv6TranslatorTest.java
index 1099f6809..a620cbdd2 100644
--- a/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/Ipv6TranslatorTest.java
+++ b/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/Ipv6TranslatorTest.java
@@ -28,7 +28,17 @@ public class Ipv6TranslatorTest implements Ipv6Translator {
public void testIpv6NoZone() {
final Ipv6AddressNoZone ipv6Addr = new Ipv6AddressNoZone("3ffe:1900:4545:3:200:f8ff:fe21:67cf");
byte[] bytes = ipv6AddressNoZoneToArray(ipv6Addr);
- assertEquals((byte) 63, bytes[0]);
+ assertEquals((byte) 0x3f, bytes[0]);
+ final Ipv6AddressNoZone ivp6AddressNoZone = arrayToIpv6AddressNoZone(bytes);
+ assertEquals(ipv6Addr, ivp6AddressNoZone);
+ }
+
+ @Test
+ public void testIpv6NoZoneEmptyGroup() {
+ final Ipv6AddressNoZone ipv6Addr = new Ipv6AddressNoZone("10::10");
+ byte[] bytes = ipv6AddressNoZoneToArray(ipv6Addr);
+ assertEquals((byte) 0, bytes[0]);
+ assertEquals((byte) 0x10, bytes[1]);
final Ipv6AddressNoZone ivp6AddressNoZone = arrayToIpv6AddressNoZone(bytes);
assertEquals(ipv6Addr, ivp6AddressNoZone);
}