test: support odd value for kStringMaxLength

V8 6.2 will support a larger maximum string length on 64-bit platforms.
Update the test to take into account its odd value ((1 << 30) - 1 - 24).

Refs: e8c9649e25
PR-URL: https://github.com/nodejs/node/pull/14476
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
This commit is contained in:
Michaël Zasso 2017-07-25 13:58:55 +02:00
parent 4e8bc7181c
commit 753b68f9d8

View File

@ -26,4 +26,4 @@ if (!binding.ensureAllocation(2 * kStringMaxLength))
common.skip(skipMessage);
const maxString = buf.toString('utf16le');
assert.strictEqual(maxString.length, (kStringMaxLength + 2) / 2);
assert.strictEqual(maxString.length, Math.floor((kStringMaxLength + 2) / 2));