Skip to content

Commit e044126

Browse files
committed
Reimplement test
1 parent 8d14e32 commit e044126

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

tests/ClangSharp.PInvokeGenerator.UnitTests/Base/CXXMethodDeclarationCSharpTest.cs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,24 +96,47 @@ protected override Task ConversionTestImpl()
9696
var inputContents = @"struct MyStruct
9797
{
9898
int value;
99-
99+
int* pointer;
100+
int** pointer2;
100101
operator int()
101102
{
102103
return value;
103104
}
105+
operator int*()
106+
{
107+
return pointer;
108+
}
109+
operator int**()
110+
{
111+
return pointer2;
112+
}
104113
};
105114
";
106115

107116
var expectedOutputContents = @"namespace ClangSharp.Test
108117
{
109-
public partial struct MyStruct
118+
public unsafe partial struct MyStruct
110119
{
111120
public int value;
112121
122+
public int* pointer;
123+
124+
public int** pointer2;
125+
113126
public int ToInt32()
114127
{
115128
return value;
116129
}
130+
131+
public int* ToInt32Pointer()
132+
{
133+
return pointer;
134+
}
135+
136+
public int** ToInt32Pointer2()
137+
{
138+
return pointer2;
139+
}
117140
}
118141
}
119142
";

0 commit comments

Comments
 (0)