From 753b68f9d8177d6af6da536b91d7660182c45406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 25 Jul 2017 13:58:55 +0200 Subject: [PATCH] test: support odd value for kStringMaxLength MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/v8/v8/commit/e8c9649e2570c7e278e70a6584738a3c3f828b2b PR-URL: https://github.com/nodejs/node/pull/14476 Reviewed-By: Ben Noordhuis Reviewed-By: Ali Ijaz Sheikh Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Yuta Hiroto --- .../test-stringbytes-external-exceed-max-by-2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js index db007a53a44..751c864bace 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js @@ -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));