test: improve test-arm-math-illegal-instruction.js#37670
test: improve test-arm-math-illegal-instruction.js#37670aduh95 merged 1 commit intonodejs:masterfrom marsonya:test-improve-1
Conversation
RaisinTen
left a comment
There was a problem hiding this comment.
What do you think about doing something like this instead:
Object.getOwnPropertyNames(Math).forEach(function (functionName) {
if (!/[A-Z]/.test(functionName)) {
// The function names don't have capital letters.
Math[functionName](-0.5);
}
});That way, we don't have to manually keep a track of all the function names.
This seems like a great idea. |
|
I don't think that will be a problem given the purpose of the test: node/test/parallel/test-arm-math-illegal-instruction.js Lines 4 to 7 in f355549 I think it's just checking whether calling any of these Math functions end up failing with an illegal instruction error, so it does not really matter what we feed into these functions provided the error does not happen.
|
That sounds fair. The functions that require more than one parameters are simply returning |
This seems a great solution to me. Let's wait for more reviews. |
|
+1 on @RaisinTen idea. FWIW we could use |
|
New changes made as per @RaisinTen's idea. |
Instead of writing each Math function and keeping track, loop over Math functions and test each one of them. PR-URL: #37670 Reviewed-By: Darshan Sen <[email protected]>
|
Landed in 67d2262 |
Instead of writing each Math function and keeping track, loop over Math functions and test each one of them. PR-URL: #37670 Reviewed-By: Darshan Sen <[email protected]>
Instead of writing each Math function and keeping track, loop over Math functions and test each one of them. PR-URL: #37670 Reviewed-By: Darshan Sen <[email protected]>
add
Math.clz32(x)to the test