Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
n-api: add uint32 test for -1
Adds a test to ensure that napi_get_value_uint32 returns 0xffffffff for
-1.

Re: #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>
  • Loading branch information
Gabriel Schulhof authored and codebytere committed Jun 7, 2020
1 parent 4294d92 commit 82da74b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/js-native-api/test_number/test.js
Expand Up @@ -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`
Expand Down

0 comments on commit 82da74b

Please sign in to comment.