mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 06:34:02 +03:00
Update fuzz tests
This commit is contained in:
+4
-12
@@ -47,19 +47,11 @@ run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzClientHello ./mtglib/internal/f
|
|||||||
|
|
||||||
[tasks."test:fuzz:client-handshake"]
|
[tasks."test:fuzz:client-handshake"]
|
||||||
description = "Run fuzzy test for ClientHandshake"
|
description = "Run fuzzy test for ClientHandshake"
|
||||||
run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzClientHandshake ./mtglib/internal/obfuscated2"
|
run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzClientServerHandshake ./mtglib/internal/obfuscation"
|
||||||
|
|
||||||
[tasks."test:fuzz:server-generate-handshake-frame"]
|
[tasks."test:fuzz:server-handshake-frame"]
|
||||||
description = "Run fuzzy test for ServerGenerateHandshakeFrame"
|
description = "Run fuzzy test for GenerateHandshakeFrame"
|
||||||
run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzServerGenerateHandshakeFrame ./mtglib/internal/obfuscated2"
|
run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzGenerateHandshakeFrame ./mtglib/internal/obfuscation"
|
||||||
|
|
||||||
[tasks."test:fuzz:server-receive"]
|
|
||||||
description = "Run fuzzy test for ServerReceive"
|
|
||||||
run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzServerReceive ./mtglib/internal/obfuscated2"
|
|
||||||
|
|
||||||
[tasks."test:fuzz:server-send"]
|
|
||||||
description = "Run fuzzy test for ServerSend"
|
|
||||||
run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzServerSend ./mtglib/internal/obfuscated2"
|
|
||||||
|
|
||||||
[tasks.static]
|
[tasks.static]
|
||||||
description = "Build static binary"
|
description = "Build static binary"
|
||||||
|
|||||||
@@ -28,6 +28,13 @@ func FuzzGenerateHandshakeFrame(f *testing.F) {
|
|||||||
frame.data[4]|frame.data[5]|frame.data[6]|frame.data[7])
|
frame.data[4]|frame.data[5]|frame.data[6]|frame.data[7])
|
||||||
|
|
||||||
assert.Equal(t, hfConnectionType[:], frame.connectionType())
|
assert.Equal(t, hfConnectionType[:], frame.connectionType())
|
||||||
|
|
||||||
|
if arg < 0 {
|
||||||
|
arg = -arg
|
||||||
|
} else if arg == 0 {
|
||||||
|
arg = defaultDC
|
||||||
|
}
|
||||||
|
|
||||||
assert.EqualValues(t, arg, frame.dc())
|
assert.EqualValues(t, arg, frame.dc())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user