mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
test: s390x z15 accelerated zlib fixes
Modern s390x x15 has accelerated zlib operations on the CPU. Many distros currently have patches to take advantage of this feature. One side-effect of these patches is that compression routine is no longer deterministic as with software. Interruption to input produces different compressed results. Invalid input can result in processor fault. PR-URL: https://github.com/nodejs/node/pull/44117 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Richard Lau <rlau@redhat.com>
This commit is contained in:
1 parent
5d5971cda7
commit
2f036c857e
3 files changed
+5
-3
No files matched your search
@@ -53,7 +53,7 @@ const input = Buffer.from([0x78, 0xBB, 0x04, 0x09, 0x01, 0xA5]);
|
||||
stream.on('error', common.mustCall(function(err) {
|
||||
// It's not possible to separate invalid dict and invalid data when using
|
||||
// the raw format
|
||||
assert.match(err.message, /invalid/);
|
||||
assert.match(err.message, /(invalid|Operation-Ending-Supplemental Code is 0x12)/);
|
||||
}));
|
||||
|
||||
stream.write(input);
|
||||
|
||||
@@ -16,7 +16,7 @@ zipper.write('A'.repeat(17000));
|
||||
zipper.flush();
|
||||
|
||||
let received = 0;
|
||||
unzipper.on('data', common.mustCall((d) => {
|
||||
unzipper.on('data', common.mustCallAtLeast((d) => {
|
||||
received += d.length;
|
||||
}, 2));
|
||||
|
||||
|
||||
@@ -55,7 +55,9 @@ const expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN4' +
|
||||
'sHnHNzRtagj5AQAA';
|
||||
|
||||
zlib.deflate(inputString, common.mustCall((err, buffer) => {
|
||||
assert.strictEqual(buffer.toString('base64'), expectedBase64Deflate);
|
||||
zlib.inflate(buffer, common.mustCall((err, inflated) => {
|
||||
assert.strictEqual(inflated.toString(), inputString);
|
||||
}));
|
||||
}));
|
||||
|
||||
zlib.gzip(inputString, common.mustCall((err, buffer) => {
|
||||
|
||||
Reference in new issue
Block a user