forked from TrueCloudLab/policy-engine
Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
9c98b05066 |
3 changed files with 23 additions and 21 deletions
3
CODEOWNERS
Normal file
3
CODEOWNERS
Normal file
|
@ -0,0 +1,3 @@
|
|||
.* @TrueCloudLab/storage-core-committers @TrueCloudLab/storage-core-developers @TrueCloudLab/storage-services-committers @TrueCloudLab/storage-services-developers
|
||||
.forgejo/.* @potyarkin
|
||||
Makefile @potyarkin
|
|
@ -3,10 +3,7 @@
|
|||
|
||||
package chain
|
||||
|
||||
func InitFuzzUnmarshal() {
|
||||
}
|
||||
|
||||
func DoFuzzUnmarshal(data []byte) int {
|
||||
func DoFuzzChainUnmarshalBinary(data []byte) int {
|
||||
var ch Chain
|
||||
err := ch.UnmarshalBinary(data)
|
||||
if err != nil {
|
||||
|
|
|
@ -5,28 +5,30 @@ package chain
|
|||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func FuzzUnmarshal(f *testing.F) {
|
||||
// for _, id := range generateTestIDs() {
|
||||
// for _, rules := range generateTestRules() {
|
||||
// for _, matchType := range generateTestMatchTypes() {
|
||||
for _, id := range generateTestIDs() {
|
||||
for _, rules := range generateTestRules() {
|
||||
for _, matchType := range generateTestMatchTypes() {
|
||||
|
||||
// chain := Chain{
|
||||
// ID: id,
|
||||
// Rules: rules,
|
||||
// MatchType: matchType,
|
||||
// }
|
||||
// data, err := chain.MarshalBinary()
|
||||
// require.NoError(f, err)
|
||||
// f.Add(data)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
chain := Chain{
|
||||
ID: id,
|
||||
Rules: rules,
|
||||
MatchType: matchType,
|
||||
}
|
||||
data, err := chain.MarshalBinary()
|
||||
require.NoError(f, err)
|
||||
f.Add(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
// require.NotPanics(t, func() {
|
||||
DoFuzzUnmarshal(data)
|
||||
// })
|
||||
require.NotPanics(t, func() {
|
||||
DoFuzzChainUnmarshalBinary(data)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue