Split out mediatransportutil (#1071)

This commit is contained in:
Raja Subramanian
2022-10-06 23:55:59 +05:30
committed by GitHub
parent c3120679e6
commit 792349cc56
19 changed files with 30 additions and 1568 deletions
-29
View File
@@ -2,7 +2,6 @@ package buffer
import (
"testing"
"time"
"github.com/stretchr/testify/require"
)
@@ -95,31 +94,3 @@ func TestVP8Helper_Unmarshal(t *testing.T) {
}
// ------------------------------------------
func Test_timeToNtp(t *testing.T) {
type args struct {
ns time.Time
}
tests := []struct {
name string
args args
wantNTP uint64
}{
{
name: "Must return correct NTP time",
args: args{
ns: time.Unix(1602391458, 1234),
},
wantNTP: 16369753560730047668,
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
gotNTP := uint64(ToNtpTime(tt.args.ns))
if gotNTP != tt.wantNTP {
t.Errorf("timeToNtp() gotFraction = %v, want %v", gotNTP, tt.wantNTP)
}
})
}
}