jmalkin commented on code in PR #447:
URL: https://github.com/apache/datasketches-cpp/pull/447#discussion_r1909368138
##########
theta/test/bit_packing_test.cpp:
##########
@@ -29,51 +29,53 @@ namespace datasketches {
static const uint64_t IGOLDEN64 = 0x9e3779b97f4a7c13ULL;
TEST_CASE("pack unpack bits") {
- for (uint8_t bits = 1; bits <= 63; ++bits) {
- int n = 8;
- const uint64_t mask = (1ULL << bits) - 1;
- std::vector<uint64_t> input(n, 0);
- const uint64_t igolden64 = IGOLDEN64;
- uint64_t value = 0xaa55aa55aa55aa55ULL; // arbitrary starting value
- for (int i = 0; i < n; ++i) {
- input[i] = value & mask;
- value += igolden64;
- }
- std::vector<uint8_t> bytes(n * sizeof(uint64_t), 0);
- uint8_t offset = 0;
- uint8_t* ptr = bytes.data();
- for (int i = 0; i < n; ++i) {
- offset = pack_bits(input[i], bits, ptr, offset);
- }
+ uint64_t value = 0xaa55aa55aa55aa55ULL; // arbitrary starting value
+ for (int n = 0; n < 100; ++n) {
+ for (uint8_t bits = 1; bits <= 63; ++bits) {
+ int n = 8;
Review Comment:
this conflicts with the for loop 2 lines above
--
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]