summaryrefslogtreecommitdiff
path: root/software/communication/data_link_test.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-05-30 22:55:52 +0200
committerxengineering <me@xengineering.eu>2024-05-31 10:04:51 +0200
commita3cbf0dd580a5bc51c4cfccbdf69be5fff23303a (patch)
tree47705f9414356ff7f1178582c41756ee580d235e /software/communication/data_link_test.go
parent41072be6c6af48f3066daf60552eba5191bfad7d (diff)
downloadiot-core-a3cbf0dd580a5bc51c4cfccbdf69be5fff23303a.tar
iot-core-a3cbf0dd580a5bc51c4cfccbdf69be5fff23303a.tar.zst
iot-core-a3cbf0dd580a5bc51c4cfccbdf69be5fff23303a.zip
software: Fix unslip() implementation and test
Both the implementation and the unit test had bugs which were blocking the test execution forever. This is fixed with this commit. Furthermore the new unslip() implementation is refactored and more readable.
Diffstat (limited to 'software/communication/data_link_test.go')
-rw-r--r--software/communication/data_link_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/software/communication/data_link_test.go b/software/communication/data_link_test.go
index ce8fe10..bbe9539 100644
--- a/software/communication/data_link_test.go
+++ b/software/communication/data_link_test.go
@@ -8,10 +8,14 @@ import (
func TestUnslip(t *testing.T) {
input := []byte{
0xFF, 0x12, SLIP_END,
+ 0xFF, SLIP_ESC, SLIP_ESC_END, 0x12, SLIP_END,
+ 0xFF, SLIP_ESC, SLIP_ESC_ESC, 0x12, SLIP_END,
}
output := [][]byte{
{0xFF, 0x12},
+ {0xFF, SLIP_END, 0x12},
+ {0xFF, SLIP_ESC, 0x12},
}
bytes := make(chan byte)