Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improve n-api coverage for typed arrays #13244

Closed
wants to merge 3 commits into from

Conversation

mhdawson
Copy link
Member

Add testing for all types of typed arrays.
Add testing for napi_is_arraybuffer.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test, n-api

Add testing for all types of typed arrays.
Add testing for napi_is_arraybuffer.
@nodejs-github-bot nodejs-github-bot added node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests. labels May 26, 2017

assert.ok(theArray instanceof currentType,
'Type of new array should match that of the template');
assert.ok(theArray !== template);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert.strictNotEqual()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, thanks.

NAPI_ASSERT(env, valuetype0 == napi_object,
"Wrong type of argments. Expects a typed array as first argument.");

napi_value input_array = args[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can you declare napi_value input_array = args[0]; and napi_value input_buffer = args[1]; around line 104 for better readability and reuse it on line 106 and 119 respectively?

@mhdawson
Copy link
Member Author

Pushed commit to address comments

@mhdawson
Copy link
Member Author

@mhdawson
Copy link
Member Author

CI run good, landing.

@mhdawson
Copy link
Member Author

landed as effeff1

@mhdawson mhdawson closed this May 30, 2017
mhdawson added a commit that referenced this pull request May 30, 2017
Add testing for all types of typed arrays.
Add testing for napi_is_arraybuffer.

PR-URL: #13244
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jason Ginchereau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
jasnell pushed a commit that referenced this pull request Jun 5, 2017
Add testing for all types of typed arrays.
Add testing for napi_is_arraybuffer.

PR-URL: #13244
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jason Ginchereau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
@jasnell jasnell mentioned this pull request Jun 5, 2017
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
@mhdawson mhdawson deleted the napi-cov8 branch June 28, 2017 19:23
gabrielschulhof pushed a commit to gabrielschulhof/node that referenced this pull request Apr 10, 2018
Add testing for all types of typed arrays.
Add testing for napi_is_arraybuffer.

PR-URL: nodejs#13244
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jason Ginchereau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
MylesBorins pushed a commit that referenced this pull request Apr 16, 2018
Add testing for all types of typed arrays.
Add testing for napi_is_arraybuffer.

Backport-PR-URL: #19447
PR-URL: #13244
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jason Ginchereau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants