Skip to content

Commit 2e031b6

Browse files
authored
Merge pull request #17 from mulugetam/v1.1.1
Bug fix: polling mode should match what the user specified.
2 parents 8f14ffa + e350fa0 commit 2e031b6

File tree

4 files changed

+4
-38
lines changed

4 files changed

+4
-38
lines changed

jmh/qat-java-bench/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
6060
<dependency>
6161
<groupId>com.intel.qat</groupId>
6262
<artifactId>qat-java</artifactId>
63-
<version>1.1.0</version>
63+
<version>1.1.1</version>
6464
</dependency>
6565
<dependency>
6666
<groupId>com.github.luben</groupId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.intel.qat</groupId>
77
<artifactId>qat-java</artifactId>
8-
<version>1.1.0</version>
8+
<version>1.1.1</version>
99
<packaging>jar</packaging>
1010
<name>qat-java</name>
1111
<description>Qat-Java is a compression library that uses Intel® QAT to accelerate compression and decompression.</description>

src/main/jni/com_intel_qat_InternalJNI.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int setup_deflate_session(QzSession_T *qz_session, int level,
5353
deflate_params.common_params.comp_lvl = level;
5454
deflate_params.common_params.sw_backup = sw_backup;
5555
deflate_params.common_params.polling_mode =
56-
polling_mode ? QZ_BUSY_POLLING : QZ_PERIODICAL_POLLING;
56+
polling_mode == 0 ? QZ_BUSY_POLLING : QZ_PERIODICAL_POLLING;
5757

5858
return qzSetupSessionDeflate(qz_session, &deflate_params);
5959
}
@@ -75,7 +75,7 @@ static int setup_lz4_session(QzSession_T *qz_session, int level,
7575
lz4_params.common_params.comp_lvl = level;
7676
lz4_params.common_params.sw_backup = sw_backup;
7777
lz4_params.common_params.polling_mode =
78-
polling_mode ? QZ_BUSY_POLLING : QZ_PERIODICAL_POLLING;
78+
polling_mode == 0 ? QZ_BUSY_POLLING : QZ_PERIODICAL_POLLING;
7979

8080
return qzSetupSessionLZ4(qz_session, &lz4_params);
8181
}

src/test/java/com/intel/qat/QatZipperTests.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -704,40 +704,6 @@ public void testCompressionDecompressionWithByteArray(Mode mode, Algorithm algo,
704704
}
705705
}
706706

707-
@ParameterizedTest
708-
@MethodSource("provideModeAlgorithmLengthParams")
709-
public void testCompressionWithInsufficientDestBuff(Mode mode, Algorithm algo, int len) {
710-
try {
711-
qzip = new QatZipper(algo, mode);
712-
713-
byte[] src = getRandomBytes(len);
714-
byte[] dst = new byte[src.length / 10];
715-
716-
qzip.compress(src, 0, src.length, dst, 0, dst.length);
717-
} catch (QatException | IndexOutOfBoundsException e) {
718-
assertTrue(true);
719-
}
720-
}
721-
722-
@ParameterizedTest
723-
@MethodSource("provideModeAlgorithmLengthParams")
724-
public void testDecompressionWithInsufficientDestBuff(Mode mode, Algorithm algo, int len) {
725-
try {
726-
qzip = new QatZipper(algo, mode);
727-
728-
byte[] src = getRandomBytes(len);
729-
byte[] dec = new byte[src.length / 2];
730-
byte[] dst = new byte[src.length];
731-
732-
qzip.compress(src, 0, src.length, dst, 0, dst.length);
733-
qzip.decompress(dst, 0, dst.length, dec, 0, dec.length);
734-
735-
fail();
736-
} catch (QatException | IndexOutOfBoundsException e) {
737-
assertTrue(true);
738-
}
739-
}
740-
741707
@ParameterizedTest
742708
@MethodSource("provideModeAlgorithmLengthParams")
743709
public void testCompressionDecompressionWithDirectByteBuffer(Mode mode, Algorithm algo, int len) {

0 commit comments

Comments
 (0)