From d87b3f10bcc2e6466ce42d3bd090ec9b44c50bf6 Mon Sep 17 00:00:00 2001 From: nicksavers Date: Mon, 13 Oct 2014 17:46:16 +0200 Subject: [PATCH] Fix unit tests for bigIntegerToBytes --- .../src/test/java/org/ethereum/util/ByteUtilTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ethereumj-core/src/test/java/org/ethereum/util/ByteUtilTest.java b/ethereumj-core/src/test/java/org/ethereum/util/ByteUtilTest.java index f7be14c6..2b411fcd 100644 --- a/ethereumj-core/src/test/java/org/ethereum/util/ByteUtilTest.java +++ b/ethereumj-core/src/test/java/org/ethereum/util/ByteUtilTest.java @@ -5,8 +5,6 @@ import static org.junit.Assert.*; import java.math.BigInteger; import java.nio.ByteBuffer; -import javassist.bytecode.ByteArray; - import org.junit.Test; import org.spongycastle.util.BigIntegers; import org.spongycastle.util.encoders.Hex; @@ -22,7 +20,7 @@ public class ByteUtilTest { @Test public void testBigIntegerToBytes() { - byte[] expecteds = new byte[]{0x0A}; + byte[] expecteds = new byte[]{(byte) 0xff, (byte) 0xec, 0x78}; BigInteger b = BigInteger.valueOf(16772216); byte[] actuals = ByteUtil.bigIntegerToBytes(b); assertArrayEquals(expecteds, actuals); @@ -30,7 +28,7 @@ public class ByteUtilTest { @Test public void testBigIntegerToBytesNegative() { - byte[] expecteds = new byte[]{0x01}; + byte[] expecteds = new byte[]{(byte) 0xff, 0x0, 0x13, (byte) 0x88}; BigInteger b = BigInteger.valueOf(-16772216); byte[] actuals = ByteUtil.bigIntegerToBytes(b); assertArrayEquals(expecteds, actuals);