summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorgarwahl <garwahlam@gmail.com>2018-03-23 23:24:01 +1100
committerGireesh Punathil <gpunathi@in.ibm.com>2018-03-29 16:31:49 +0530
commit42c740212d6c0b910463414ee7d9865e3fc0bb0c (patch)
tree00a8dcc357bbf819a0982a7f4f97331ad4740ce8 /test
parent37db277bb4f7fe9a00e728b91f354b62b3c279ce (diff)
downloadandroid-node-v8-42c740212d6c0b910463414ee7d9865e3fc0bb0c.tar.gz
android-node-v8-42c740212d6c0b910463414ee7d9865e3fc0bb0c.tar.bz2
android-node-v8-42c740212d6c0b910463414ee7d9865e3fc0bb0c.zip
test: fix incorrect assumptions on uid and gid
Add a invalidArgTypeErrorCount variable to adjust the number of expected errors if the uid and gid options cannot be properly validated. Fixes: https://github.com/nodejs/node/issues/19371 PR-URL: https://github.com/nodejs/node/pull/19554 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-child-process-spawnsync-validation-errors.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/parallel/test-child-process-spawnsync-validation-errors.js b/test/parallel/test-child-process-spawnsync-validation-errors.js
index 802acad103..e52f04b04a 100644
--- a/test/parallel/test-child-process-spawnsync-validation-errors.js
+++ b/test/parallel/test-child-process-spawnsync-validation-errors.js
@@ -5,13 +5,15 @@ const spawnSync = require('child_process').spawnSync;
const signals = process.binding('constants').os.signals;
let invalidArgTypeError;
+let invalidArgTypeErrorCount = 62;
if (common.isWindows) {
invalidArgTypeError =
common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 42);
} else {
invalidArgTypeError =
- common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }, 62);
+ common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError },
+ invalidArgTypeErrorCount);
}
const invalidRangeError =
@@ -76,6 +78,9 @@ if (!common.isWindows) {
fail('uid', Infinity, invalidArgTypeError);
fail('uid', 3.1, invalidArgTypeError);
fail('uid', -3.1, invalidArgTypeError);
+ } else {
+ //Decrement invalidArgTypeErrorCount if validation isn't possible
+ invalidArgTypeErrorCount -= 10;
}
}
@@ -95,6 +100,9 @@ if (!common.isWindows) {
fail('gid', Infinity, invalidArgTypeError);
fail('gid', 3.1, invalidArgTypeError);
fail('gid', -3.1, invalidArgTypeError);
+ } else {
+ //Decrement invalidArgTypeErrorCount if validation isn't possible
+ invalidArgTypeErrorCount -= 10;
}
}
}