Implement size to pdu header
This commit is contained in:
@@ -63,3 +63,6 @@ func (p *PDU_HEADER) Decode(data []uint8) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (p *PDU_HEADER) Size() uint32 {
|
||||||
|
return 16
|
||||||
|
}
|
@@ -441,3 +441,11 @@ func TestDecodeHandlesByteSlicesWithMinimumUint32Values(t *testing.T) {
|
|||||||
t.Errorf("Expected command_id to be 0, got %d", p.command_id)
|
t.Errorf("Expected command_id to be 0, got %d", p.command_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// region size
|
||||||
|
func TestSizeReturns16(t *testing.T) {
|
||||||
|
var p PDU_HEADER
|
||||||
|
if p.Size() != 16 {
|
||||||
|
t.Errorf("Expected size to be 16, got %d", p.Size())
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user