diff --git a/_llcppgtest/gpgerror/llcppg.cfg b/_llcppgtest/gpgerror/llcppg.cfg index 028e40b6..887a03b4 100644 --- a/_llcppgtest/gpgerror/llcppg.cfg +++ b/_llcppgtest/gpgerror/llcppg.cfg @@ -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 diff --git a/cmd/gogensig/convert/package_bulitin_test.go b/cmd/gogensig/convert/package_bulitin_test.go index 2db53b2f..93cce978 100644 --- a/cmd/gogensig/convert/package_bulitin_test.go +++ b/cmd/gogensig/convert/package_bulitin_test.go @@ -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) + } +}