Examples of signExtend()


Examples of org.ethereum.vm.DataWord.signExtend()

    DataWord x = new DataWord(Hex.decode("f2"));
    byte k = 0;
    String expected = "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2";

    x.signExtend(k);
    System.out.println(x.toString());
    assertEquals(expected, x.toString());
  }

  @Test
View Full Code Here

Examples of org.ethereum.vm.DataWord.signExtend()

  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
View Full Code Here

Examples of org.ethereum.vm.DataWord.signExtend()

    byte k = 1;
    DataWord x = new DataWord(Hex.decode("0f00ab"));
    String expected = "00000000000000000000000000000000000000000000000000000000000000ab";

    x.signExtend(k);
    System.out.println(x.toString());
    assertEquals(expected, x.toString());
  }

  @Test
View Full Code Here

Examples of org.ethereum.vm.DataWord.signExtend()

    byte k = 1;
    DataWord x = new DataWord(Hex.decode("ffff"));
    String expected = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";

    x.signExtend(k);
    System.out.println(x.toString());
    assertEquals(expected, x.toString());
  }

  @Test
View Full Code Here

Examples of org.ethereum.vm.DataWord.signExtend()

    byte k = 3;
    DataWord x = new DataWord(Hex.decode("ffffffff"));
    String expected = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";

    x.signExtend(k);
    System.out.println(x.toString());
    assertEquals(expected, x.toString());
  }

  @Test
View Full Code Here

Examples of org.ethereum.vm.DataWord.signExtend()

    byte k = 3;
    DataWord x = new DataWord(Hex.decode("ab02345678"));
    String expected = "0000000000000000000000000000000000000000000000000000000002345678";

    x.signExtend(k);
    System.out.println(x.toString());
    assertEquals(expected, x.toString());
  }

  @Test
View Full Code Here

Examples of org.ethereum.vm.DataWord.signExtend()

    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());
  }

  @Test
View Full Code Here

Examples of org.ethereum.vm.DataWord.signExtend()

    byte k = 30;
    DataWord x = new DataWord(Hex.decode("ff34567882345678823456788234567882345678823456788234567882345678"));
    String expected = "0034567882345678823456788234567882345678823456788234567882345678";

    x.signExtend(k);
    System.out.println(x.toString());
    assertEquals(expected, x.toString());
  }

  @Test(expected=IndexOutOfBoundsException.class)
View Full Code Here

Examples of org.ethereum.vm.DataWord.signExtend()

  public void testSignExtendException1() {

    byte k = -1;
    DataWord x = new DataWord();

    x.signExtend(k); // should throw an exception
  }
 
  @Test(expected=IndexOutOfBoundsException.class)
  public void testSignExtendException2() {
View Full Code Here

Examples of org.ethereum.vm.DataWord.signExtend()

  public void testSignExtendException2() {

    byte k = 32;
    DataWord x = new DataWord();

    x.signExtend(k); // should throw an exception
  }
 
  public static BigInteger pow(BigInteger x, BigInteger y) {
    if (y.compareTo(BigInteger.ZERO) < 0)
      throw new IllegalArgumentException();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.