mirror of
https://github.com/aler9/gortsplib
synced 2025-10-04 14:52:46 +08:00
rename Read / Write into Unmarshal / Marshal when needed
Read() / Write() are used to read / write from streams, while Unmarshal() / Marshal() are used to decode / encode from / to bytes.
This commit is contained in:
@@ -175,17 +175,17 @@ func TestResponseReadErrors(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestResponseWrite(t *testing.T) {
|
||||
func TestResponseMarshal(t *testing.T) {
|
||||
for _, c := range casesResponse {
|
||||
t.Run(c.name, func(t *testing.T) {
|
||||
buf, err := c.res.Write()
|
||||
buf, err := c.res.Marshal()
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, c.byts, buf)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestResponseWriteAutoFillStatus(t *testing.T) {
|
||||
func TestResponseMarshalAutoFillStatus(t *testing.T) {
|
||||
res := &Response{
|
||||
StatusCode: StatusMethodNotAllowed,
|
||||
Header: Header{
|
||||
@@ -207,7 +207,7 @@ func TestResponseWriteAutoFillStatus(t *testing.T) {
|
||||
"\r\n",
|
||||
)
|
||||
|
||||
buf, err := res.Write()
|
||||
buf, err := res.Marshal()
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, byts, buf)
|
||||
}
|
||||
|
Reference in New Issue
Block a user