@Test(expected = IndexOutOfBoundsException.class) public void testSignExtendException2() { byte k = 32; DataWord x = new DataWord(); x.signExtend(k); // should throw an exception }
@Test public void testSignExtend2() { DataWord x = new DataWord(Hex.decode("f2")); byte k = 1; String expected = "00000000000000000000000000000000000000000000000000000000000000f2"; x.signExtend(k); System.out.println(x.toString()); assertEquals(expected, x.toString()); }
@Test public void testSignExtend7() { byte k = 3; DataWord x = new DataWord(Hex.decode("ab82345678")); String expected = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffff82345678"; x.signExtend(k); System.out.println(x.toString()); assertEquals(expected, x.toString()); }