Skip to content

Commit

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

Re: #33117
Signed-off-by: Gabriel Schulhof <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
  • Loading branch information
Gabriel Schulhof authored and codebytere committed May 7, 2020
1 parent b2fb01a commit 4ae6130
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/js-native-api/test_number/test.js
Original file line number Diff line number Diff line change
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 4ae6130

Please sign in to comment.