You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by GitBox <gi...@apache.org> on 2022/03/14 22:08:07 UTC

[GitHub] [datasketches-cpp] AlexanderSaydakov opened a new pull request #267: serialize-deserialize-serialize tests

AlexanderSaydakov opened a new pull request #267:
URL: https://github.com/apache/datasketches-cpp/pull/267


   Added a few tests. One of them would have caught the bug fixed by #266
   


-- 
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: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [datasketches-cpp] jmalkin commented on a change in pull request #267: serialize-deserialize-serialize tests

Posted by GitBox <gi...@apache.org>.
jmalkin commented on a change in pull request #267:
URL: https://github.com/apache/datasketches-cpp/pull/267#discussion_r834012263



##########
File path: hll/test/HllSketchTest.cpp
##########
@@ -384,4 +384,61 @@ TEST_CASE("hll sketch: deserialize HLL mode buffer overrun", "[hll_sketch]") {
   REQUIRE(test_allocator_total_bytes == 0);
 }
 
+TEST_CASE("hll sketch: bytes serialize-deserialize-serialize list mode") {
+  test_allocator_total_bytes = 0;
+  {
+    hll_sketch_test_alloc s1(10, target_hll_type::HLL_4, false, 0);
+    s1.update(1);
+    s1.update(2);
+    s1.update(3);
+    std::cout << s1.to_string();
+    auto bytes1 = s1.serialize_compact();
+    auto s2 = hll_sketch_test_alloc::deserialize(bytes1.data(), bytes1.size(), 0);
+    auto bytes2 = s2.serialize_compact();
+    REQUIRE(bytes1 == bytes2);
+  }
+  REQUIRE(test_allocator_total_bytes == 0);
+}
+
+TEST_CASE("hll sketch: updatable bytes serialize-deserialize-serialize set mode") {
+  test_allocator_total_bytes = 0;
+  {
+    hll_sketch_test_alloc s1(10, target_hll_type::HLL_4, false, 0);
+    for (int i = 0; i < 10; ++i) s1.update(i);
+    std::cout << s1.to_string();
+    auto bytes1 = s1.serialize_updatable();
+    auto s2 = hll_sketch_test_alloc::deserialize(bytes1.data(), bytes1.size(), 0);
+
+    auto bytes2 = s2.serialize_updatable();
+    REQUIRE(bytes1 == bytes2);
+  }
+  REQUIRE(test_allocator_total_bytes == 0);
+}
+
+TEST_CASE("hll sketch: compact bytes serialize-deserialize-serialize set mode") {
+  test_allocator_total_bytes = 0;
+  {
+    hll_sketch_test_alloc s1(10, target_hll_type::HLL_4, false, 0);
+    for (int i = 0; i < 10; ++i) s1.update(i);
+    std::cout << s1.to_string();
+    auto bytes1 = s1.serialize_compact();
+    auto s2 = hll_sketch_test_alloc::deserialize(bytes1.data(), bytes1.size(), 0);
+
+    // cannot just compare bytes here
+    // hash set does not preserve the order after reconstruction in compact mode

Review comment:
       This is rather annoying with such a small table. Oh well.




-- 
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: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [datasketches-cpp] AlexanderSaydakov merged pull request #267: serialize-deserialize-serialize tests

Posted by GitBox <gi...@apache.org>.
AlexanderSaydakov merged pull request #267:
URL: https://github.com/apache/datasketches-cpp/pull/267


   


-- 
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: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [datasketches-cpp] coveralls commented on pull request #267: serialize-deserialize-serialize tests

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #267:
URL: https://github.com/apache/datasketches-cpp/pull/267#issuecomment-1067355613


   ## Pull Request Test Coverage Report for [Build 1983406538](https://coveralls.io/builds/47354034)
   
   * **0** of **0**   changed or added relevant lines in **0** files are covered.
   * No unchanged relevant lines lost coverage.
   * Overall coverage remained the same at **92.159%**
   
   ---
   
   
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/47354034/badge)](https://coveralls.io/builds/47354034) |
   | :-- | --: |
   | Change from base [Build 1971615164](https://coveralls.io/builds/47298599): |  0.0% |
   | Covered Lines: | 2151 |
   | Relevant Lines: | 2334 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   


-- 
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: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org