2021-05-29 08:47:18 +03:00
|
|
|
package json
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
"unsafe"
|
|
|
|
|
|
|
|
"github.com/goccy/go-json/internal/encoder"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestOpcodeSize(t *testing.T) {
|
|
|
|
const uintptrSize = 4 << (^uintptr(0) >> 63)
|
|
|
|
if uintptrSize == 8 {
|
|
|
|
size := unsafe.Sizeof(encoder.Opcode{})
|
2021-11-27 20:14:57 +03:00
|
|
|
if size != 120 {
|
|
|
|
t.Fatalf("unexpected opcode size: expected 120bytes but got %dbytes", size)
|
2021-05-29 08:47:18 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|