go-json/size_test.go

19 lines
359 B
Go
Raw Permalink Normal View History

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