mirror of
https://github.com/aler9/gortsplib
synced 2025-10-21 22:29:31 +08:00
do not check for io.EOF in tests
This commit is contained in:
@@ -2,7 +2,6 @@ package gortsplib
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"io"
|
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
@@ -100,11 +99,10 @@ func TestServerConnPublishSetupPath(t *testing.T) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err = <-conn.Read(ServerConnReadHandlers{
|
<-conn.Read(ServerConnReadHandlers{
|
||||||
OnAnnounce: onAnnounce,
|
OnAnnounce: onAnnounce,
|
||||||
OnSetup: onSetup,
|
OnSetup: onSetup,
|
||||||
})
|
})
|
||||||
require.Equal(t, io.EOF, err)
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
conn, err := net.Dial("tcp", "localhost:8554")
|
conn, err := net.Dial("tcp", "localhost:8554")
|
||||||
@@ -466,13 +464,12 @@ func TestServerConnPublishReceivePackets(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = <-conn.Read(ServerConnReadHandlers{
|
<-conn.Read(ServerConnReadHandlers{
|
||||||
OnAnnounce: onAnnounce,
|
OnAnnounce: onAnnounce,
|
||||||
OnSetup: onSetup,
|
OnSetup: onSetup,
|
||||||
OnRecord: onRecord,
|
OnRecord: onRecord,
|
||||||
OnFrame: onFrame,
|
OnFrame: onFrame,
|
||||||
})
|
})
|
||||||
require.Equal(t, io.EOF, err)
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
conn, err := net.Dial("tcp", "localhost:8554")
|
conn, err := net.Dial("tcp", "localhost:8554")
|
||||||
|
@@ -2,7 +2,6 @@ package gortsplib
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"io"
|
|
||||||
"net"
|
"net"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@@ -85,10 +84,9 @@ func TestServerConnReadSetupPath(t *testing.T) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err = <-conn.Read(ServerConnReadHandlers{
|
<-conn.Read(ServerConnReadHandlers{
|
||||||
OnSetup: onSetup,
|
OnSetup: onSetup,
|
||||||
})
|
})
|
||||||
require.Equal(t, io.EOF, err)
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
conn, err := net.Dial("tcp", "localhost:8554")
|
conn, err := net.Dial("tcp", "localhost:8554")
|
||||||
@@ -251,12 +249,11 @@ func TestServerConnReadReceivePackets(t *testing.T) {
|
|||||||
close(packetsReceived)
|
close(packetsReceived)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = <-conn.Read(ServerConnReadHandlers{
|
<-conn.Read(ServerConnReadHandlers{
|
||||||
OnSetup: onSetup,
|
OnSetup: onSetup,
|
||||||
OnPlay: onPlay,
|
OnPlay: onPlay,
|
||||||
OnFrame: onFrame,
|
OnFrame: onFrame,
|
||||||
})
|
})
|
||||||
require.Equal(t, io.EOF, err)
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
conn, err := net.Dial("tcp", "localhost:8554")
|
conn, err := net.Dial("tcp", "localhost:8554")
|
||||||
@@ -390,11 +387,10 @@ func TestServerConnReadTCPResponseBeforeFrames(t *testing.T) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err = <-conn.Read(ServerConnReadHandlers{
|
<-conn.Read(ServerConnReadHandlers{
|
||||||
OnSetup: onSetup,
|
OnSetup: onSetup,
|
||||||
OnPlay: onPlay,
|
OnPlay: onPlay,
|
||||||
})
|
})
|
||||||
require.Equal(t, io.EOF, err)
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
conn, err := net.Dial("tcp", "localhost:8554")
|
conn, err := net.Dial("tcp", "localhost:8554")
|
||||||
@@ -496,11 +492,10 @@ func TestServerConnReadPlayMultiple(t *testing.T) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err = <-conn.Read(ServerConnReadHandlers{
|
<-conn.Read(ServerConnReadHandlers{
|
||||||
OnSetup: onSetup,
|
OnSetup: onSetup,
|
||||||
OnPlay: onPlay,
|
OnPlay: onPlay,
|
||||||
})
|
})
|
||||||
require.Equal(t, io.EOF, err)
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
conn, err := net.Dial("tcp", "localhost:8554")
|
conn, err := net.Dial("tcp", "localhost:8554")
|
||||||
@@ -615,12 +610,11 @@ func TestServerConnReadPauseMultiple(t *testing.T) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err = <-conn.Read(ServerConnReadHandlers{
|
<-conn.Read(ServerConnReadHandlers{
|
||||||
OnSetup: onSetup,
|
OnSetup: onSetup,
|
||||||
OnPlay: onPlay,
|
OnPlay: onPlay,
|
||||||
OnPause: onPause,
|
OnPause: onPause,
|
||||||
})
|
})
|
||||||
require.Equal(t, io.EOF, err)
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
conn, err := net.Dial("tcp", "localhost:8554")
|
conn, err := net.Dial("tcp", "localhost:8554")
|
||||||
|
Reference in New Issue
Block a user