From 950afc4358e2a82f225573451490842737784200 Mon Sep 17 00:00:00 2001 From: Jimi van der Woning Date: Mon, 6 Nov 2017 17:36:56 +0100 Subject: [PATCH] test: fix typos in read-buffer tests The offset-exceeding tests for readFloat contained a double test for readFloatLE instead of one for readFloatLE and one for readFloatBE. This is fixed in this commit. --- test/parallel/test-buffer-read.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-buffer-read.js b/test/parallel/test-buffer-read.js index 777ced08c5d954..b5bdbbb7a4b403 100644 --- a/test/parallel/test-buffer-read.js +++ b/test/parallel/test-buffer-read.js @@ -59,13 +59,13 @@ read(buf, 'readUIntBE', [2, 0], 0xfd); read(buf, 'readUIntLE', [2, 0], 0x48); // attempt to overflow buffers, similar to previous bug in array buffers -assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(0xffffffff), +assert.throws(() => Buffer.allocUnsafe(8).readFloatBE(0xffffffff), RangeError); assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(0xffffffff), RangeError); // ensure negative values can't get past offset -assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(-1), RangeError); +assert.throws(() => Buffer.allocUnsafe(8).readFloatBE(-1), RangeError); assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(-1), RangeError); // offset checks