Fixes global numeric types to have max of signed encoding (#442)
This adjusts towards the exiting code which used int32/64 instead of uint32/64. The reason is that the spec indicates intepretation as signed numbers, which affects the maximum value. See https://www.w3.org/TR/wasm-core-1/#value-types%E2%91%A2 Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -64,11 +64,11 @@ func TestEncodeDecodeF64(t *testing.T) {
|
||||
} {
|
||||
t.Run(fmt.Sprintf("%f", v), func(t *testing.T) {
|
||||
encoded := EncodeF64(v)
|
||||
binary := DecodeF64(encoded)
|
||||
if math.IsNaN(binary) { // cannot use require.Equal as NaN by definition doesn't equal itself
|
||||
require.True(t, math.IsNaN(binary))
|
||||
val := DecodeF64(encoded)
|
||||
if math.IsNaN(val) { // cannot use require.Equal as NaN by definition doesn't equal itself
|
||||
require.True(t, math.IsNaN(val))
|
||||
} else {
|
||||
require.Equal(t, v, binary)
|
||||
require.Equal(t, v, val)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user