Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkwork committed Dec 1, 2024
1 parent 9817aab commit a89e029
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions sdk/bindgen/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"testing"
"unicode"

"github.com/ddkwork/golibrary/safemap"

"github.com/ddkwork/app/bindgen/clang"
"github.com/ddkwork/app/bindgen/gengo"
"github.com/ddkwork/golibrary/mylog"
Expand Down Expand Up @@ -44,7 +46,7 @@ func TestMergeHeader(t *testing.T) {
func TestName(t *testing.T) {
// maps.CollectSafeSliceMap()
// maps.CollectSet()
safeSliceMap := maps.CollectSafeSliceMap[string, int](func(yield func(string, int) bool) {
safeSliceMap := safemap.NewOrdered(func(yield func(string, int) bool) {
yield("a", 0)
yield("b", 1)
yield("c", 2)
Expand Down Expand Up @@ -122,9 +124,7 @@ func TestBindMacros(t *testing.T) {
macros.Range(func(key string, value string) bool {
if !m.Has(key) {
// mylog.Warning(key, value)
macros.Lock()
macros.Delete(key)
macros.Unlock()
// return true
}
// mylog.Warning(key, value)
Expand Down
6 changes: 4 additions & 2 deletions sdk/bindgen/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"strings"
"testing"

"github.com/ddkwork/golibrary/safemap"

"github.com/ddkwork/HyperDbg/sdk"

"github.com/ddkwork/golibrary/mylog"
Expand Down Expand Up @@ -71,7 +73,7 @@ func TestUnmarshalCommandJson(t *testing.T) {

func TestCommandGenerate(t *testing.T) {
t.Skip("not well")
m := safemap.NewOrdered[string, string]()
m := new(safemap.M[string, string])
m.Set("debugging", "debugging")
m.Set("extension", "extension")
m.Set("hwdbg", "hwdbg")
Expand Down Expand Up @@ -108,7 +110,7 @@ func commandGenerate(kindName, path string) {
return err
})

m := safemap.NewOrdered[string, string]()
m := new(safemap.M[string, string])
for _, command := range commands {
m.Set(command.FullName, command.FullName) // todo this must be use Cmd,then it will return the right command
}
Expand Down
2 changes: 2 additions & 0 deletions sdk/bindgen/macros_decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package bindgen

import (
"strings"

"github.com/ddkwork/golibrary/safemap"
)

func extractMacros(lines []string) *safemap.M[string, string] {
Expand Down

0 comments on commit a89e029

Please sign in to comment.