From a3cbf0dd580a5bc51c4cfccbdf69be5fff23303a Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 30 May 2024 22:55:52 +0200 Subject: 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. --- software/communication/data_link_test.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'software/communication/data_link_test.go') 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) -- cgit v1.2.3-70-g09d2