1
Fork 0
mirror of https://github.com/jech/galene.git synced 2025-01-08 15:45:47 +01:00

Add TestPayloadTypesDiscontiguous.

This commit is contained in:
Juliusz Chroboczek 2025-01-04 18:49:46 +01:00
parent 84b4a773b6
commit 8d7ea92445

View file

@ -7,6 +7,8 @@ import (
"sort"
"testing"
"time"
"github.com/pion/webrtc/v4"
)
func TestGroup(t *testing.T) {
@ -348,3 +350,32 @@ func TestValidGroupName(t *testing.T) {
}
}
}
func TestPayloadTypeDiscontiguous(t *testing.T) {
names := []string{
"vp8", "vp9", "av1", "h264",
"opus", "g722", "pcmu", "pcma",
}
m := make(map[webrtc.PayloadType]bool)
for _, n := range names {
codec, err := codecsFromName(n)
if err != nil {
t.Errorf("%v: %v", n, err)
continue
}
pt, err := CodecPayloadType(codec[0].RTPCodecCapability)
if err != nil {
t.Errorf("%v: %v", codec, err)
continue
}
m[pt] = true
}
for pt := range m {
if m[pt+1] {
t.Errorf("%v and %v are both defined", pt, pt+1)
}
}
}