-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchunktype_test.go
37 lines (33 loc) · 912 Bytes
/
chunktype_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT
package sctp
import "testing"
func TestChunkType_String(t *testing.T) {
tt := []struct {
chunkType chunkType
expected string
}{
{ctPayloadData, "DATA"},
{ctInit, "INIT"},
{ctInitAck, "INIT-ACK"},
{ctSack, "SACK"},
{ctHeartbeat, "HEARTBEAT"},
{ctHeartbeatAck, "HEARTBEAT-ACK"},
{ctAbort, "ABORT"},
{ctShutdown, "SHUTDOWN"},
{ctShutdownAck, "SHUTDOWN-ACK"},
{ctError, "ERROR"},
{ctCookieEcho, "COOKIE-ECHO"},
{ctCookieAck, "COOKIE-ACK"},
{ctCWR, "ECNE"},
{ctShutdownComplete, "SHUTDOWN-COMPLETE"},
{ctReconfig, "RECONFIG"},
{ctForwardTSN, "FORWARD-TSN"},
{chunkType(255), "Unknown ChunkType: 255"},
}
for _, tc := range tt {
if tc.chunkType.String() != tc.expected {
t.Errorf("failed to stringify chunkType %v, expected %s", tc.chunkType, tc.expected)
}
}
}