From 324743238cb12cedec2cd4f0ac08b0aa8ca886e4 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Mon, 14 Aug 2017 22:18:12 +0700 Subject: Fix the message in case of test failure --- crypto/test/src/crypto/test/DSTU7624Test.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/test/src/crypto/test/DSTU7624Test.cs b/crypto/test/src/crypto/test/DSTU7624Test.cs index 2aa65f8c4..234474db6 100644 --- a/crypto/test/src/crypto/test/DSTU7624Test.cs +++ b/crypto/test/src/crypto/test/DSTU7624Test.cs @@ -185,10 +185,11 @@ namespace Org.BouncyCastle.Crypto.Tests wrapper.Init(false, new KeyParameter(key)); output = wrapper.Unwrap(output, textB.Length, output.Length - textB.Length - textA.Length); - if (!Arrays.AreEqual(output, Arrays.CopyOfRange(textToWrap, textA.Length, textToWrap.Length - textB.Length))) + byte[] expected = Arrays.CopyOfRange(textToWrap, textA.Length, textToWrap.Length - textB.Length); + if (!Arrays.AreEqual(output, expected)) { return new SimpleTestResult(false, Name + ": Failed KW (unwrapping) test 1 - expected " - + Hex.ToHexString(textToWrap) + + Hex.ToHexString(expected) + " got " + Hex.ToHexString(output)); } -- cgit 1.5.1