From 82da74b1cdcdb85537c1b88b112969ae6bda82fa Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Mon, 4 May 2020 17:03:13 -0700 Subject: [PATCH] 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 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: David Carlier Reviewed-By: Chengzhong Wu Reviewed-By: Zeyu Yang --- test/js-native-api/test_number/test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/js-native-api/test_number/test.js b/test/js-native-api/test_number/test.js index 808d1d9d5c374f..8ab8ad5e8be7f3 100644 --- a/test/js-native-api/test_number/test.js +++ b/test/js-native-api/test_number/test.js @@ -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`