You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2023/03/17 22:55:46 UTC
[datasketches-java] branch minor-updates updated: The BitPackingTest was printing hundreds of lines to the console.
This is an automated email from the ASF dual-hosted git repository.
leerho pushed a commit to branch minor-updates
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git
The following commit(s) were added to refs/heads/minor-updates by this push:
new 021b95f2 The BitPackingTest was printing hundreds of lines to the console.
021b95f2 is described below
commit 021b95f2f61eb39bf4bd91a48cf224e164a91f3b
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Fri Mar 17 15:55:31 2023 -0700
The BitPackingTest was printing hundreds of lines to the console.
It was modified to print based on a internal variable that can be set
by the developer if needed.
---
src/test/java/org/apache/datasketches/theta/BitPackingTest.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/test/java/org/apache/datasketches/theta/BitPackingTest.java b/src/test/java/org/apache/datasketches/theta/BitPackingTest.java
index 5a80ed04..152bee03 100644
--- a/src/test/java/org/apache/datasketches/theta/BitPackingTest.java
+++ b/src/test/java/org/apache/datasketches/theta/BitPackingTest.java
@@ -25,7 +25,7 @@ import org.apache.datasketches.common.Util;
import org.testng.annotations.Test;
public class BitPackingTest {
-
+ private final static boolean enablePrinting = false;
//for every number of bits from 1 to 63
//generate pseudo-random data, pack, unpack and compare
@@ -66,7 +66,7 @@ public class BitPackingTest {
@Test
public void packUnpackBlocks() {
for (int bits = 1; bits <= 63; bits++) {
- System.out.println("bits " + bits);
+ if (enablePrinting) { System.out.println("bits " + bits); }
final long mask = (1L << bits) - 1;
long[] input = new long[8];
final long golden64 = Util.INVERSE_GOLDEN_U64;
@@ -77,13 +77,13 @@ public class BitPackingTest {
}
byte[] bytes = new byte[8 * Long.BYTES];
BitPacking.packBitsBlock8(input, 0, bytes, 0, bits);
- hexDump(bytes);
+ if (enablePrinting) { hexDump(bytes); }
long[] output = new long[8];
BitPacking.unpackBitsBlock8(output, 0, bytes, 0, bits);
for (int i = 0; i < 8; ++i) {
- System.out.println("checking value " + i);
+ if (enablePrinting) { System.out.println("checking value " + i); }
assertEquals(output[i], input[i]);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org