AlexanderSaydakov commented on code in PR #458:
URL: https://github.com/apache/datasketches-cpp/pull/458#discussion_r2136259181
##########
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 ¢roid: td) {
+ centroid_count++;
+ }
+ // Ensure that centroids are retrieved for a case where there is buffered
values
+ REQUIRE(centroid_count == 10);
Review Comment:
perhaps we could do better than just counting, but I am not sure whether
that would be assuming too much about implementation
--
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]