MaheshGPai commented on code in PR #458:
URL: https://github.com/apache/datasketches-cpp/pull/458#discussion_r2140111271


##########
tdigest/test/tdigest_test.cpp:
##########
@@ -453,4 +453,18 @@ TEST_CASE("deserialize from reference implementation bytes 
float", "[tdigest]")
   REQUIRE(td.get_rank(n) == 1);
 }
 
+TEST_CASE("iterate centroids", "[tdigest]") {
+  tdigest_double td(100);
+  for (int i = 0; i < 10; i++) {
+    td.update(i);
+  }
+
+  auto centroid_count = 0;
+  for (const auto &centroid: td) {
+    centroid_count++;
+  }
+  // Ensure that centroids are retrieved for a case where there is buffered 
values
+  REQUIRE(centroid_count == 10);

Review Comment:
   I have added validation to check the weights as well. Cant think of anything 
better. Please do let me know if you have anything specific in mind.



-- 
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