From 7f22058967016acb61a4256fc39cc664e341af55 Mon Sep 17 00:00:00 2001 From: Alex Beltran Date: Thu, 21 Dec 2017 22:28:49 -0800 Subject: [PATCH] Add another multiple read test for decoding --- encoding/service_test.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/encoding/service_test.go b/encoding/service_test.go index fc32dbc..99e3059 100644 --- a/encoding/service_test.go +++ b/encoding/service_test.go @@ -297,3 +297,35 @@ func TestReadMultipleTwo(t *testing.T) { counter++ } } + +func TestReadMultipleThree(t *testing.T) { + + b := []byte{48, 54, 14, 12, 2, 0, 78, 233, 30, 41, 76, 57, 241, 78, 196, 0, 128, + 0, 62, 79, 41, 76, 57, 242, 78, 196, 5, 0, 0, 68, 79, 41, 76, 57, 243, 78, + 196, 0, 128, 0, 61, 79, 41, 76, 57, 244, 78, 196, 5, 0, 0, 67, 79, 41, 76, + 57, 245, 78, 196, 5, 0, 0, 65, 79, 41, 76, 57, 246, 78, 196, 0, 128, 0, 60, + 79, 41, 76, 57, 247, 78, 196, 5, 0, 0, 66, 79, 41, 76, 57, 248, 78, 196, 5, + 0, 0, 69, 79, 41, 76, 57, 249, 78, 196, 1, 64, 0, 40, 79, 41, 76, 57, 250, + 78, 196, 1, 64, 0, 42, 79, 41, 76, 57, 251, 78, 196, 4, 192, 0, 17, 79, 41, + 76, 57, 252, 78, 196, 1, 64, 0, 38, 79, 41, 76, 57, 253, 78, 196, 4, 192, 0, + 16, 79, 41, 76, 57, 254, 78, 196, 1, 64, 0, 37, 79, 41, 76, 57, 255, 78, + 196, 4, 192, 0, 18, 79, 41, 76, 58, 1, 0, 78, 196, 1, 64, 0, 39, 79, 41, 76, + 58, 1, 1, 78, 196, 1, 64, 0, 41, 79, 41, 76, 58, 1, 2, 78, 196, 5, 0, 0, 73, + 79, 41, 76, 58, 1, 3, 78, 196, 0, 128, 0, 75, 79, 41, 76, 58, 1, 4, 78, 196, + 5, 0, 0, 82, 79, 41, 76, 58, 1, 5, 78, 196, 0, 128, 0, 76, 79, 41, 76, 58, + 1, 6, 78, 196, 5, 0, 0, 83, 79, 41, 76, 58, 1, 7, 78, 196, 0, 128, 0, 77, + 79, 41, 76, 58, 1, 8, 78, 196, 5, 0, 0, 84, 79, 41, 76, 58, 1, 9, 78, 196, + 0, 128, 0, 67, 79, 41, 76, 58, 1, 10, 78, 196, 5, 0, 0, 74, 79, 41, 76, 58, + 1, 11, 78, 196, 0, 128, 0, 68, 79, 41, 76, 58, 1, 12, 78, 196, 5, 0, 0, 75, + 79, 41, 76, 58, 1, 13, 78, 196, 5, 0, 0, 76, 79, 41, 76, 58, 1, 14, 78, 196, + 0, 128, 0, 73, 79, 31} + dec := NewDecoder(b) + var apdu bactype.APDU + dec.APDU(&apdu) + + rp := bactype.ReadMultipleProperty{} + err := dec.ReadMultiplePropertyAck(&rp) + if err != nil { + t.Fatalf("failed to decode read multiple: %v", err) + } +}