FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: remove duplicated buffer negative allocation test by ZYSzys · Pull Request #26160 · nodejs/node · GitHub

/ node Public

test: remove duplicated buffer negative allocation test - #26160

Closed
ZYSzys wants to merge 1 commit into
nodejs:masterfrom
zys-contrib:test-buffer-duplicated
Closed

test: remove duplicated buffer negative allocation test#26160
ZYSzys wants to merge 1 commit into
nodejs:masterfrom
zys-contrib:test-buffer-duplicated

Conversation

ZYSzys commented Feb 17, 2019

Copy link
Copy Markdown
Member

The buffer negative allocation test test-buffer-negative-length.js is almost duplicated with test-buffer-no-negative-allocation.js.

'use strict';
const common = require('../common');
const assert = require('assert');
const SlowBuffer = require('buffer').SlowBuffer;
const bufferNegativeMsg = common.expectsError({
code: 'ERR_INVALID_OPT_VALUE',
type: RangeError,
message: /^The value "[^"]*" is invalid for option "size"$/
}, 5);
assert.throws(() => Buffer(-1).toString('utf8'), bufferNegativeMsg);
assert.throws(() => SlowBuffer(-1).toString('utf8'), bufferNegativeMsg);
assert.throws(() => Buffer.alloc(-1).toString('utf8'), bufferNegativeMsg);
assert.throws(() => Buffer.allocUnsafe(-1).toString('utf8'), bufferNegativeMsg);
assert.throws(() => Buffer.allocUnsafeSlow(-1).toString('utf8'),
bufferNegativeMsg);

'use strict';
const common = require('../common');
const assert = require('assert');
const msg = common.expectsError({
code: 'ERR_INVALID_OPT_VALUE',
type: RangeError,
message: /^The value "[^"]*" is invalid for option "size"$/
}, 12);
// Test that negative Buffer length inputs throw errors.
assert.throws(() => Buffer(-Buffer.poolSize), msg);
assert.throws(() => Buffer(-100), msg);
assert.throws(() => Buffer(-1), msg);
assert.throws(() => Buffer.alloc(-Buffer.poolSize), msg);
assert.throws(() => Buffer.alloc(-100), msg);
assert.throws(() => Buffer.alloc(-1), msg);
assert.throws(() => Buffer.allocUnsafe(-Buffer.poolSize), msg);
assert.throws(() => Buffer.allocUnsafe(-100), msg);
assert.throws(() => Buffer.allocUnsafe(-1), msg);
assert.throws(() => Buffer.allocUnsafeSlow(-Buffer.poolSize), msg);
assert.throws(() => Buffer.allocUnsafeSlow(-100), msg);
assert.throws(() => Buffer.allocUnsafeSlow(-1), msg);

So remove test-buffer-negative-length.js and add SlowBuffer allocation test into test-buffer-no-negative-allocation.js.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 17, 2019
addaleax added the buffer Issues and PRs related to the buffer subsystem. label Feb 17, 2019

Trott commented Feb 17, 2019
edited
Loading

Copy link
Copy Markdown
Member

Trott added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Feb 17, 2019

danbev commented Feb 22, 2019

Copy link
Copy Markdown
Contributor

@ZYSzys Sorry about this, but would you be able to rebase this and fix the conflict and we can then re-run CI and get it merged. Thanks

ZYSzys commented Feb 22, 2019

Copy link
Copy Markdown
Member Author

@danbev Done, thanks!

Trott commented Feb 22, 2019

Copy link
Copy Markdown
Member

addaleax commented Mar 1, 2019

Copy link
Copy Markdown
Member

addaleax commented Mar 1, 2019

Copy link
Copy Markdown
Member

ChALkeR requested a review from starkwang March 1, 2019 23:20

BridgeAR commented Mar 4, 2019

Copy link
Copy Markdown
Member

Landed in 6f6f6d4 🎉

BridgeAR closed this Mar 4, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 4, 2019
PR-URL: nodejs#26160
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
ZYSzys deleted the test-buffer-duplicated branch March 4, 2019 02:44
BridgeAR pushed a commit that referenced this pull request Mar 4, 2019
PR-URL: #26160
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
BridgeAR mentioned this pull request Mar 4, 2019
BridgeAR pushed a commit that referenced this pull request Mar 5, 2019
PR-URL: #26160
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
BethGriggs pushed a commit that referenced this pull request Apr 16, 2019
PR-URL: #26160
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
BethGriggs mentioned this pull request May 1, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. buffer Issues and PRs related to the buffer subsystem. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants


Back | FazBrowse Home | New Git URL