Initial working fully go release
This commit is contained in:
@@ -159,7 +159,7 @@ func TestDecodeTimeString(t *testing.T) {
|
||||
|
||||
func TestDecodeTimeEnum(t *testing.T) {
|
||||
hdr := buildTimeHeader(0, 0, 0, 0)
|
||||
val := []byte{0x00, 0x03, 0x00, 0x00} // enum=3 + 2-byte pad
|
||||
val := []byte{0x00, 0x00, 0x00, 0x03} // 2-byte RISC pad + enum=3
|
||||
payload := append(hdr, val...)
|
||||
|
||||
tv, ok := proto.DecodeTimeValue(proto.DBRTimeEnum, 1, payload)
|
||||
@@ -307,14 +307,14 @@ func TestEncodeEventMask(t *testing.T) {
|
||||
if len(b) != 16 {
|
||||
t.Fatalf("len = %d, want 16", len(b))
|
||||
}
|
||||
// m_mask is at offset 14 (after m_lval[0:4], p_delta[4:8], p_final[8:12], p_count[12:14]).
|
||||
mask := binary.BigEndian.Uint16(b[14:])
|
||||
// m_mask is at offset 12 per caProto.h struct mon_info.
|
||||
mask := binary.BigEndian.Uint16(b[12:])
|
||||
if mask != proto.DBEDefault {
|
||||
t.Errorf("mask = 0x%02X, want 0x%02X", mask, proto.DBEDefault)
|
||||
}
|
||||
// p_count at [12:14] must be zero.
|
||||
if pc := binary.BigEndian.Uint16(b[12:]); pc != 0 {
|
||||
t.Errorf("p_count = %d, want 0", pc)
|
||||
// m_pad at [14:16] must be zero.
|
||||
if pad := binary.BigEndian.Uint16(b[14:]); pad != 0 {
|
||||
t.Errorf("m_pad = %d, want 0", pad)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user