srtp_test.go 428 B

12345678910111213141516171819202122
  1. package srtp_test
  2. import (
  3. "testing"
  4. "v2ray.com/core/common/buf"
  5. . "v2ray.com/core/transport/internet/headers/srtp"
  6. . "v2ray.com/ext/assert"
  7. )
  8. func TestSRTPWrite(t *testing.T) {
  9. assert := With(t)
  10. content := []byte{'a', 'b', 'c', 'd', 'e', 'f', 'g'}
  11. srtp := SRTP{}
  12. payload := buf.NewLocal(2048)
  13. payload.AppendSupplier(srtp.Write)
  14. payload.Append(content)
  15. assert(payload.Len(), Equals, len(content)+srtp.Size())
  16. }