functests/msgpack: Correct representation of literal INT64_MIN

In order to generate INT64_MIN from literal values, it's necessary to
use "-0x7fffffffffffffff - 1".  Using "-0x8000000000000000" causes the
value to get clamped to INT64_MAX and then negated.
This commit is contained in:
James McCoy 2017-06-06 13:38:23 -04:00
parent d69286c065
commit bf4de3f6f7
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -352,7 +352,7 @@ describe('msgpack*() functions', function()
eq(1, eval('type(parsed[0]) == type(0) ' ..
'|| parsed[0]._TYPE is v:msgpack_types.integer'))
if eval('type(parsed[0]) == type(0)') == 1 then
command('call assert_equal(-0x8000000000000000, parsed[0])')
command('call assert_equal(-0x7fffffffffffffff - 1, parsed[0])')
eq({}, eval('v:errors'))
else
eq({_TYPE={}, _VAL={-1, 2, 0, 0}}, eval('parsed[0]'))