FILE / ScuroNeko/mtg

mtglib/internal/obfuscated2/server_handshake_fuzz_internal_test.go

Исходный файл и его история в репозитории.
FILE 074c4017f5632624124506f658ebb9a4121771de
Files
mtg/mtglib/internal/obfuscated2/server_handshake_fuzz_internal_test.go
T
2022-03-18 14:58:08 +03:00

31 lines
771 B
Go

package obfuscated2
import (
"encoding/binary"
"testing"
"github.com/stretchr/testify/assert"
)
func FuzzServerGenerateHandshakeFrame(f *testing.F) {
f.Fuzz(func(t *testing.T, arg int) {
frame := generateServerHanshakeFrame()
assert.NotEqualValues(t, 0xef, frame.data[0])
firstBytes := binary.LittleEndian.Uint32(frame.data[:4])
assert.NotEqualValues(t, 0x44414548, firstBytes)
assert.NotEqualValues(t, 0x54534f50, firstBytes)
assert.NotEqualValues(t, 0x20544547, firstBytes)
assert.NotEqualValues(t, 0x4954504f, firstBytes)
assert.NotEqualValues(t, 0xeeeeeeee, firstBytes)
assert.NotEqualValues(
t,
0,
frame.data[4]|frame.data[5]|frame.data[6]|frame.data[7])
assert.Equal(t, handshakeConnectionType, frame.connectionType())
})
}