コード例 #1
0
 @Test
 public void checkEmptyUnion() {
   HeapDoublesUnion union = new HeapDoublesUnion(128);
   DoublesSketch sk = union.getResult();
   assertNotNull(sk);
   String s = union.toString();
   assertNotNull(s);
 }
コード例 #2
0
 @Test
 public void checkUnionUpdateLogic() {
   HeapDoublesSketch qs1 = null;
   HeapDoublesSketch qs2 = (HeapDoublesSketch) buildQS(256, 0);
   DoublesSketch result = HeapDoublesUnion.updateLogic(qs1, qs2); // null, empty
   result = HeapDoublesUnion.updateLogic(qs2, qs1); // empty, null
   qs2.update(1); // no longer empty
   result = HeapDoublesUnion.updateLogic(qs2, qs1); // valid, null
   assertEquals(result.getMaxValue(), result.getMinValue(), 0.0);
 }