Skip to content

Commit

Permalink
fix(plc4go/spi): add test for WriteBufferPlcValueBased
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed May 12, 2023
1 parent 8ea1a62 commit 2c092fe
Show file tree
Hide file tree
Showing 2 changed files with 1,069 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plc4go/spi/values/WriteBufferPlcValueBased.go
Expand Up @@ -136,6 +136,9 @@ func (p *writeBufferPlcValueBased) WriteInt64(logicalName string, bitLength uint
}

func (p *writeBufferPlcValueBased) WriteBigInt(logicalName string, bitLength uint8, value *big.Int, _ ...utils.WithWriterArgs) error {
if value == nil {
return errors.New("value must not be nil")
}
p.move(uint(bitLength))
// TODO: check if we set the type dynamic here...
return p.appendValue(logicalName, NewPlcRawByteArray(value.Bytes()))
Expand All @@ -152,6 +155,9 @@ func (p *writeBufferPlcValueBased) WriteFloat64(logicalName string, bitLength ui
}

func (p *writeBufferPlcValueBased) WriteBigFloat(logicalName string, bitLength uint8, value *big.Float, _ ...utils.WithWriterArgs) error {
if value == nil {
return errors.New("value must not be nil")
}
p.move(uint(bitLength))
// TODO: check if we set the type dynamic here...
encode, err := value.GobEncode()
Expand Down

0 comments on commit 2c092fe

Please sign in to comment.