n-api: add uint32 test for -1

Adds a test to ensure that napi_get_value_uint32 returns 0xffffffff for
-1.

Re: https://github.com/nodejs/node/issues/33117
Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
This commit is contained in:
Gabriel Schulhof
2020-05-04 17:03:13 -07:00
parent 8607f9ec5c
commit e454e9b33f

View File

@@ -48,6 +48,7 @@ testUint32(4294967295);
testUint32(4294967296, 0);
testUint32(4294967297, 1);
testUint32(17 * 4294967296 + 1, 1);
testUint32(-1, 0xffffffff);
// Validate documented behavior when value is retrieved as 32-bit integer with
// `napi_get_value_int32`