Skip to content

Commit

Permalink
Add another multiple read test for decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbeltran committed Dec 22, 2017
1 parent 8061309 commit 7f22058
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions encoding/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 7f22058

Please sign in to comment.