Example #1
0
  @Test
  public void testLongs() throws SyntaxException {

    long va = 0x1f;
    long vb = 0xf1;

    Operation bitior =
        BitIOR.newOperation(null, LongProperty.getInstance(va), LongProperty.getInstance(vb));

    assertTrue(bitior instanceof LongProperty);
    LongProperty result = (LongProperty) bitior;
    long lvalue = result.getValue().longValue();
    assertTrue((va | vb) == lvalue);
  }
Example #2
0
 @Test(expected = EvaluationException.class)
 public void testInvalidArgument() throws SyntaxException {
   HashResource h = new HashResource();
   BitIOR.newOperation(null, h, h);
 }
Example #3
0
 @Test(expected = AssertionError.class)
 public void testOverflow() throws SyntaxException {
   LongProperty i = LongProperty.getInstance(1L);
   BitIOR.newOperation(null, i, i, i);
 }
Example #4
0
 @Test(expected = AssertionError.class)
 public void testUnderflow() throws SyntaxException {
   BitIOR.newOperation(null);
 }