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 <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
  • 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.