leerho commented on code in PR #541:
URL: https://github.com/apache/datasketches-java/pull/541#discussion_r1556403713


##########
src/test/java/org/apache/datasketches/kll/KllDirectFloatsSketchTest.java:
##########
@@ -637,14 +638,25 @@ public void checkMergeExceptions() {
   }
 
   @Test
-  public void checkMergeExceptionsWrongType() {
-    KllFloatsSketch sk1 = KllFloatsSketch.newHeapInstance(20);
-    KllDoublesSketch sk2 = KllDoublesSketch.newHeapInstance(20);
-    try { sk1.merge(sk2); fail(); } catch (ClassCastException e) { }
-    try { sk2.merge(sk1); fail(); } catch (ClassCastException e) { }
+  public void checkVectorUpdate() {
+    WritableMemory dstMem = WritableMemory.allocate(6000);
+    KllFloatsSketch sk = KllFloatsSketch.newDirectInstance(20, dstMem, 
memReqSvr);
+    float[] v = new float[21];
+    for (int i = 0; i < 21; i++) { v[i] = i + 1; }
+    sk.update(v, 0, 21);
   }
 
-  private static KllFloatsSketch getUpdatableDirectFloatSketch(final int k, 
final int n) {
+  @Test
+  public void checkWeightedUpdate() {
+    WritableMemory dstMem = WritableMemory.allocate(6000);
+    KllFloatsSketch sk = KllFloatsSketch.newDirectInstance(8, dstMem, 
memReqSvr);
+    for (int i = 0; i < 16; i++) {
+      sk.update(i + 1, 16);
+    }
+    println(sk.toString(true, true));

Review Comment:
   Fixed again, now on the right branch!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to