Skip to content

Commit

Permalink
Add test case for summary packet
Browse files Browse the repository at this point in the history
  • Loading branch information
haoming29 committed Feb 1, 2024
1 parent 6e9e42e commit 53e5332
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ func TestGoodVerify(t *testing.T) {

}

func TestVerifySummaryPacket(t *testing.T) {
summaryPacket := `<statistics
tod="int64" ver="chars" src=”chars” tos=”int64”
pgm=”chars” ins=”chars” pid=”int” site=”chars”>
</statistics>
`

assert.True(t, VerifyPacket([]byte(summaryPacket)), "Failed to verify packet")
}

// TestBadVerify tests the validation if the packets are not good (random bits)
func TestBadVerify(t *testing.T) {
badHeader := Header{}
Expand Down

0 comments on commit 53e5332

Please sign in to comment.