예제 #1
0
  @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());
  }
예제 #2
0
  @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());
  }