Skip to content

Commit

Permalink
test: support odd value for kStringMaxLength
Browse files Browse the repository at this point in the history
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: v8/v8@e8c9649
PR-URL: #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>
  • Loading branch information
targos authored and addaleax committed Aug 7, 2017
1 parent dd586c6 commit 636ba8c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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));

0 comments on commit 636ba8c

Please sign in to comment.