Beispiel #1
0
  @Test
  public void testDiv() {
    DoubleMemory memory = new DoubleMemory(10);
    Assert.assertEquals(5, memory.div(2).toDouble(), 0.00001);
    Assert.assertEquals(Memory.Type.DOUBLE, memory.div(2).type);

    Assert.assertEquals(10, memory.div(true).toDouble(), 0.000001);
    Assert.assertEquals(Memory.Type.DOUBLE, memory.div(true).type);

    Assert.assertEquals(5, memory.div(2.0).toDouble(), 0.0001);
    Assert.assertEquals(Memory.Type.DOUBLE, memory.div(2.0).type);
  }
Beispiel #2
0
 @Test
 public void testDivInvalidNull() {
   DoubleMemory memory = new DoubleMemory(10);
   Assert.assertEquals(Memory.FALSE, memory.div(Memory.NULL));
 }
Beispiel #3
0
 @Test
 public void testDivInvalidFalse() {
   DoubleMemory memory = new DoubleMemory(10);
   Assert.assertEquals(Memory.FALSE, memory.div(false));
 }