2021-05-29 05:47:18 +00:00
|
|
|
package json
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
"unsafe"
|
|
|
|
|
2024-04-14 08:03:12 +00:00
|
|
|
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
2021-05-29 05:47:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestOpcodeSize(t *testing.T) {
|
|
|
|
const uintptrSize = 4 << (^uintptr(0) >> 63)
|
|
|
|
if uintptrSize == 8 {
|
|
|
|
size := unsafe.Sizeof(encoder.Opcode{})
|
2022-01-03 03:33:51 +00:00
|
|
|
if size != 120 {
|
2021-12-27 08:50:55 +00:00
|
|
|
t.Fatalf("unexpected opcode size: expected 112bytes but got %dbytes", size)
|
2021-05-29 05:47:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|