Skip to content

Commit

Permalink
test: check zlib version for createDeflateRaw
Browse files Browse the repository at this point in the history
We are currenly builing Node with --shared-zlib which happens to be
version 1.2.8. The test for zlib.createDeflateRaw is expected to fail
but does not when using version 1.2.8.

As far as I can tell the fix referred to in the comments was
introduced in version 1.2.9:
- Reject a window size of 256 bytes if not using the zlib wrapper

This commit suggests adding a check for the version and skipping this
assert if the version is less than 1.2.9.

Refs: http://zlib.net/ChangeLog.txt
Backport-PR-URL: #15478
PR-URL: #13697
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
danbev authored and MylesBorins committed Sep 26, 2017
1 parent feb6863 commit 8e00315
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/parallel/test-zlib-failed-init.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
'use strict';

require('../common');
const common = require('../common');

const assert = require('assert');
const zlib = require('zlib');

if (process.config.variables.node_shared_zlib &&
/^1\.2\.[0-8]$/.test(process.versions.zlib)) {
common.skip("older versions of shared zlib don't throw on create");
}

// For raw deflate encoding, requests for 256-byte windows are rejected as
// invalid by zlib.
// (http://zlib.net/manual.html#Advanced)
Expand Down

0 comments on commit 8e00315

Please sign in to comment.