1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 08:35:57 +01:00

Run gofmt.

This commit is contained in:
Juliusz Chroboczek 2020-12-19 17:38:47 +01:00
parent 325f288189
commit 4fde2c40e6
7 changed files with 38 additions and 39 deletions

View file

@ -15,7 +15,7 @@ func TestEstimator(t *testing.T) {
e.Accumulate(128)
e.estimate(now + rtptime.JiffiesPerSec)
rate, packetRate :=
e.estimate(now + (rtptime.JiffiesPerSec * 1001) / 1000)
e.estimate(now + (rtptime.JiffiesPerSec*1001)/1000)
if rate != 42+128 {
t.Errorf("Expected %v, got %v", 42+128, rate)

View file

@ -69,7 +69,7 @@ func TestJSON(t *testing.T) {
}
func BenchmarkPlain(b *testing.B) {
for i :=0; i < b.N; i++ {
for i := 0; i < b.N; i++ {
match, err := pw2.Match("bad")
if err != nil || match {
b.Errorf("pw2 matched")
@ -78,7 +78,7 @@ func BenchmarkPlain(b *testing.B) {
}
func BenchmarkPBKDF2(b *testing.B) {
for i :=0; i < b.N; i++ {
for i := 0; i < b.N; i++ {
match, err := pw3.Match("bad")
if err != nil || match {
b.Errorf("pw3 matched")

View file

@ -350,7 +350,7 @@ func TestBitmapPacket(t *testing.T) {
}
p := rtcp.NackPair{first, rtcp.PacketBitmap(bitmap)}
p.Range(func (s uint16) bool {
p.Range(func(s uint16) bool {
if s < 42 || s >= 42+64 {
if (value & (1 << (s - 42))) != 0 {
t.Errorf("Bit %v unexpectedly set", s-42)

View file

@ -574,7 +574,7 @@ func gotNACK(conn *rtpDownConnection, track *rtpDownTrack, p *rtcp.TransportLaye
var packet rtp.Packet
buf := make([]byte, packetcache.BufSize)
for _, nack := range p.Nacks {
nack.Range(func (seqno uint16) bool {
nack.Range(func(seqno uint16) bool {
l := track.remote.GetRTP(seqno, buf)
if l == 0 {
unhandled = append(unhandled, seqno)

View file

@ -943,7 +943,6 @@ func leaveGroup(c *webClient) {
c.group = nil
}
func failDownConnection(c *webClient, id string, message string) error {
if id != "" {
err := c.write(clientMessage{

View file

@ -39,7 +39,7 @@ func NTPToTime(ntp uint64) time.Time {
sec := uint32(ntp >> 32)
frac := uint32(ntp & 0xFFFFFFFF)
return ntpEpoch.Add(
time.Duration(sec) * time.Second +
time.Duration(sec)*time.Second +
((time.Duration(frac) * time.Second) >> 32),
)
}
@ -48,5 +48,5 @@ func TimeToNTP(tm time.Time) uint64 {
d := tm.Sub(ntpEpoch)
sec := uint32(d / time.Second)
frac := uint32(d % time.Second)
return (uint64(sec) << 32) + (uint64(frac) << 32) / uint64(time.Second)
return (uint64(sec) << 32) + (uint64(frac)<<32)/uint64(time.Second)
}

View file

@ -21,15 +21,15 @@ func differs(a, b, delta uint64) bool {
if a < b {
a, b = b, a
}
return a - b >= delta
return a-b >= delta
}
func TestTime(t *testing.T) {
a := Now(48000)
time.Sleep(4 * time.Millisecond)
b := Now(48000) - a
if differs(b, 4 * 48, 16) {
t.Errorf("Expected %v, got %v", 4 * 48, b)
if differs(b, 4*48, 16) {
t.Errorf("Expected %v, got %v", 4*48, b)
}
c := Microseconds()
@ -68,7 +68,7 @@ func TestNTP(t *testing.T) {
}
if diff2 > (1 << 8) {
t.Errorf("Expected %v, got %v (diff=%v)",
ntp, ntp2, float64(diff2) / float64(1<<32))
ntp, ntp2, float64(diff2)/float64(1<<32))
}
}