Skip to content

Commit 451803c

Browse files
committed
Ensure unix is also handled
1 parent d9ff6b1 commit 451803c

File tree

1 file changed

+30
-1
lines changed
  • tests/ClangSharp.PInvokeGenerator.UnitTests

1 file changed

+30
-1
lines changed

tests/ClangSharp.PInvokeGenerator.UnitTests/CTest.cs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ enum {
8383
} field;
8484
};
8585
";
86-
var expectedOutputContents = @"namespace ClangSharp.Test
86+
string expectedOutputContents;
87+
88+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
89+
{
90+
expectedOutputContents = @"namespace ClangSharp.Test
8791
{
8892
public partial struct MyStruct
8993
{
@@ -103,6 +107,31 @@ public static partial class Methods
103107
}
104108
}
105109
";
110+
}
111+
else
112+
{
113+
expectedOutputContents = @"namespace ClangSharp.Test
114+
{
115+
public partial struct MyStruct
116+
{
117+
[NativeTypeName(""__AnonymousEnum_ClangUnsavedFile_L8_C5"")]
118+
public uint field;
119+
120+
public const uint VALUEA = 0;
121+
public const uint VALUEB = 1;
122+
public const uint VALUEC = 2;
123+
}
124+
125+
public static partial class Methods
126+
{
127+
public const uint VALUE1 = 0;
128+
public const uint VALUE2 = 1;
129+
public const uint VALUE3 = 2;
130+
}
131+
}
132+
";
133+
}
134+
106135
var diagnostics = new[] {
107136
new Diagnostic(DiagnosticLevel.Info, "Found anonymous enum: __AnonymousEnum_ClangUnsavedFile_L1_C1. Mapping values as constants in: Methods", "Line 1, Column 1 in ClangUnsavedFile.h"),
108137
new Diagnostic(DiagnosticLevel.Info, "Found anonymous enum: __AnonymousEnum_ClangUnsavedFile_L8_C5. Mapping values as constants in: Methods", "Line 8, Column 5 in ClangUnsavedFile.h")

0 commit comments

Comments
 (0)