-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Conversation
Add testing for all types of typed arrays. Add testing for napi_is_arraybuffer.
|
||
assert.ok(theArray instanceof currentType, | ||
'Type of new array should match that of the template'); | ||
assert.ok(theArray !== template); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert.strictNotEqual()
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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?
Pushed commit to address comments |
CI run good, landing. |
landed as effeff1 |
Add testing for all types of typed arrays. Add testing for napi_is_arraybuffer. PR-URL: #13244 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com> Reviewed-By: Hitesh Kanwathirtha <digitalinfinity@gmail.com>
Add testing for all types of typed arrays. Add testing for napi_is_arraybuffer. PR-URL: #13244 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com> Reviewed-By: Hitesh Kanwathirtha <digitalinfinity@gmail.com>
Add testing for all types of typed arrays. Add testing for napi_is_arraybuffer. PR-URL: nodejs#13244 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com> Reviewed-By: Hitesh Kanwathirtha <digitalinfinity@gmail.com>
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 <cjihrig@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com> Reviewed-By: Hitesh Kanwathirtha <digitalinfinity@gmail.com>
Add testing for all types of typed arrays.
Add testing for napi_is_arraybuffer.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test, n-api