Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: improve test-arm-math-illegal-instruction
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 <raisinten@gmail.com>
  • Loading branch information
marsonya authored and aduh95 committed Mar 19, 2021
commit 67d2262465ef41cbfaa36192f130cebfe493fbd1
34 changes: 7 additions & 27 deletions test/parallel/test-arm-math-illegal-instruction.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,10 @@ require('../common');
// See https://github.com/nodejs/node/issues/1376
// and https://code.google.com/p/v8/issues/detail?id=4019

Math.abs(-0.5);
Math.acos(-0.5);
Math.acosh(-0.5);
Math.asin(-0.5);
Math.asinh(-0.5);
Math.atan(-0.5);
Math.atanh(-0.5);
Math.cbrt(-0.5);
Math.ceil(-0.5);
Math.cos(-0.5);
Math.cosh(-0.5);
Math.exp(-0.5);
Math.expm1(-0.5);
Math.floor(-0.5);
Math.fround(-0.5);
Math.log(-0.5);
Math.log10(-0.5);
Math.log1p(-0.5);
Math.log2(-0.5);
Math.round(-0.5);
Math.sign(-0.5);
Math.sin(-0.5);
Math.sinh(-0.5);
Math.sqrt(-0.5);
Math.tan(-0.5);
Math.tanh(-0.5);
Math.trunc(-0.5);
// Iterate over all Math functions
Object.getOwnPropertyNames(Math).forEach((functionName) => {
if (!/[A-Z]/.test(functionName)) {
// The function names don't have capital letters.
Math[functionName](-0.5);
}
});