Skip to content

Commit

Permalink
demo test:gpg error #106
Browse files Browse the repository at this point in the history
  • Loading branch information
luoliwoshang committed Jan 3, 2025
1 parent 06bdb07 commit 81acd8d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _llcppgtest/gpgerror/llcppg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"cflags": "$(pkg-config --cflags gpg-error)",
"libs": "$(pkg-config --libs gpg-error)",
"include": [
"gpgrt.h"
"gpgrt.h",
"gpg-error.h"
],
"trimPrefixes": ["gpg_err_","gpgrt_set_","gpg_","GPG_ERR_"],
"cplusplus": false
Expand Down
21 changes: 21 additions & 0 deletions cmd/gogensig/convert/package_bulitin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,24 @@ func TestPubMethodName(t *testing.T) {
t.Fatal("Expected pubName to be 'Foo', got", pubName)
}
}

func TestGetNameType(t *testing.T) {
named := types.NewNamed(types.NewTypeName(0, nil, "Foo", nil), nil, nil)
ptrNamed := types.NewPointer(named)
customSturct := types.NewStruct(nil, nil)

namedRes := getNamedType(named)
if namedRes != named {
t.Fatal("Expected namedRes to be *types.Named, got", namedRes)
}

ptrNamedRes := getNamedType(ptrNamed)
if ptrNamedRes != named {
t.Fatal("Expected ptrNamedRes to be *types.Named, got", ptrNamedRes)
}

customRes := getNamedType(customSturct)
if customRes != nil {
t.Fatal("Expected nil, got", customRes)
}
}

0 comments on commit 81acd8d

Please sign in to comment.