Skip to content

Commit 837b632

Browse files
committed
Add UnsignedIntBitshiftTest
1 parent b6f9089 commit 837b632

File tree

1 file changed

+18
-0
lines changed
  • tests/ClangSharp.PInvokeGenerator.UnitTests

1 file changed

+18
-0
lines changed

tests/ClangSharp.PInvokeGenerator.UnitTests/CTest.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,24 @@ public static partial class Methods
275275
public const int MyMacro2 = 5;
276276
}
277277
}
278+
";
279+
280+
return ValidateGeneratedCSharpLatestWindowsBindingsAsync(inputContents, expectedOutputContents, commandLineArgs: DefaultCClangCommandLineArgs, language: "c", languageStandard: DefaultCStandard);
281+
}
282+
283+
[Test]
284+
public Task UnsignedIntBitshiftTest()
285+
{
286+
var inputContents = @"#define BITSHIFT 1 << 1U";
287+
288+
var expectedOutputContents = @"namespace ClangSharp.Test
289+
{
290+
public static partial class Methods
291+
{
292+
[NativeTypeName(""#define BITSHIFT 1 << 1U"")]
293+
public const int BITSHIFT = 1 << (int)(1U);
294+
}
295+
}
278296
";
279297

280298
return ValidateGeneratedCSharpLatestWindowsBindingsAsync(inputContents, expectedOutputContents, commandLineArgs: DefaultCClangCommandLineArgs, language: "c", languageStandard: DefaultCStandard);

0 commit comments

Comments
 (0)