Add fuzz testing for Section encoding/decoding with multiple edge cases

This commit is contained in:
adman
2026-04-28 09:31:35 +02:00
parent ce0c58e7c5
commit 719a3bacd8
15 changed files with 289 additions and 65 deletions
+3 -2
View File
@@ -7,6 +7,7 @@ import (
"strings"
"github.com/admin-else/strom/proto_generator/protodef"
"github.com/admin-else/strom/util"
"github.com/go-viper/mapstructure/v2"
)
@@ -52,7 +53,7 @@ func ContainerCompareTo(g *Generator, parts []string, inExpr ast.Expr, dataRaw a
}
for _, field := range data {
if field.Name == name {
return g.VisitCompareTo(parts, SelectorExprAndStr(inExpr, CamelCase(field.Name)), field.Type)
return g.VisitCompareTo(parts, SelectorExprAndStr(inExpr, util.CamelCase(field.Name)), field.Type)
}
}
err = errors.New("field not found")
@@ -87,7 +88,7 @@ func BitfieldCompareTo(_ *Generator, parts []string, inExpr ast.Expr, dataRaw an
cet = CaseExprTypeOnlyNumber
}
e = SelectorExprAndStr(inExpr, CamelCase(fieldName))
e = SelectorExprAndStr(inExpr, util.CamelCase(fieldName))
return
}