You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nnet/protocol/modbus/crc_test.go

15 lines
280 B
Go

package modbus
import (
"git.noahlan.cn/noahlan/nnet/protocol/modbus/internal"
"testing"
)
func TestCRC(t *testing.T) {
got := crcModbus([]byte{0x01, 0x04, 0x02, 0xFF, 0xFF})
expect := uint16(0x80B8)
assert := internal.NewAssert(t, "TestCRC")
assert.Equal(expect, got)
}