-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathchunktype_test.go
More file actions
39 lines (34 loc) · 931 Bytes
/
chunktype_test.go
File metadata and controls
39 lines (34 loc) · 931 Bytes
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
38
39
// SPDX-FileCopyrightText: 2026 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT
package sctp
import (
"testing"
"github.com/stretchr/testify/assert"
)
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 {
assert.Equalf(t, tc.expected, tc.chunkType.String(), "chunkType %v should be %s", tc.chunkType, tc.expected)
}
}