From 2a84d439af01675b460079b8853e9f74f8cc922b Mon Sep 17 00:00:00 2001 From: Tibor Král Date: Wed, 20 Mar 2019 14:29:27 +0100 Subject: Adds additional tests for Ipsec FLAGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I059be31630b6c67d542e55e1acb6b038aea9caf9 Signed-off-by: Tibor Král --- .../hc2vpp/ipsec/write/IpsecSadEntryCustomizerTest.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ipsec/ipsec-impl/src/test/java/io/fd/hc2vpp/ipsec/write/IpsecSadEntryCustomizerTest.java b/ipsec/ipsec-impl/src/test/java/io/fd/hc2vpp/ipsec/write/IpsecSadEntryCustomizerTest.java index 42840a0cf..b15f54290 100644 --- a/ipsec/ipsec-impl/src/test/java/io/fd/hc2vpp/ipsec/write/IpsecSadEntryCustomizerTest.java +++ b/ipsec/ipsec-impl/src/test/java/io/fd/hc2vpp/ipsec/write/IpsecSadEntryCustomizerTest.java @@ -102,7 +102,7 @@ public class IpsecSadEntryCustomizerTest extends WriterCustomizerTest implements flags2.add(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY); flags2.add(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_USE_EXTENDED_SEQ_NUM); flags2.add(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_IS_TUNNEL); - ; + IpsecSadFlags flags3 = new IpsecSadFlags(); flags3.setOptionsValue(7); @@ -110,6 +110,20 @@ public class IpsecSadEntryCustomizerTest extends WriterCustomizerTest implements assertEquals(flags, flags2); assertEquals(7, flags.getOptionsValue()); assertEquals(flags, flags3); + + assertEquals(false, flags.remove(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_NONE)); + assertEquals(false, flags.add(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_NONE)); + + flags.removeAll(flags2.getOptions()); + assertEquals(0,flags.getOptionsValue()); + assertEquals(true, flags.contains(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_NONE)); + assertEquals(1,flags.getOptions().size()); + flags.add(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_IS_TUNNEL); + assertEquals(1,flags.getOptions().size()); + + flags2.clear(); + assertEquals(0,flags2.getOptionsValue()); + assertEquals(true, flags2.contains(IpsecSadFlags.IpsecSadFlagsOptions.IPSEC_API_SAD_FLAG_NONE)); } @Test -- cgit 1.2.3-korg