Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkwork committed Feb 21, 2025
1 parent 4e51818 commit 8ff3be9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions sdk/bindgen/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ func TestBindMacros(t *testing.T) {
//}
v := value
if isAlphabetOrUnderscore(v) {
v = stream.ToCamelUpper(v, false)
v = stream.ToCamelUpper(v)
}

k = stream.ToCamelUpper(k, false)
k = stream.ToCamelUpper(k)
switch {
case strings.HasPrefix(k, "DEBUGGER_ERROR"):
after, found := strings.CutPrefix(k, "DEBUGGER_ERROR")
Expand All @@ -207,7 +207,7 @@ func TestBindMacros(t *testing.T) {
enumIoctls.Set(k, k)
}

g.P(stream.ToCamelUpper(k, false) + "=" + v)
g.P(stream.ToCamelUpper(k) + "=" + v)
macros.Delete(k)
return true
})
Expand Down
6 changes: 3 additions & 3 deletions sdk/bindgen/constants/constants_gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ func genConstants(fileName string) {
if fileName == "ioctl.txt" {
v = "0x" + v
}
m.Set(stream.ToCamelUpper(split[0], false), v)
m.Set(stream.ToCamelUpper(split[0]), v)
}

kind := stream.ToCamelUpper(stream.BaseName(fileName), false) + "Kind"
kind := stream.ToCamelUpper(stream.BaseName(fileName)) + "Kind"

g := stream.NewGeneratedFile()
g.P("package constants")
Expand All @@ -55,7 +55,7 @@ func genConstants(fileName string) {
g.P("switch k {")
for _, p := range m.List() {
g.P("case ", p.Value, ":")
g.P("return ", strconv.Quote(stream.ToCamelUpper(p.Key, false)))
g.P("return ", strconv.Quote(stream.ToCamelUpper(p.Key)))
}
g.P("default:")
g.P("return \"unknown ", kind, " \"+fmt.Sprint(k)")
Expand Down

0 comments on commit 8ff3be9

Please sign in to comment.