Skip to content

Commit a502c63

Browse files
committed
Add test case for char literals
1 parent 47a7cd2 commit a502c63

File tree

1 file changed

+10
-5
lines changed
  • tests/ClangSharp.PInvokeGenerator.UnitTests

1 file changed

+10
-5
lines changed

tests/ClangSharp.PInvokeGenerator.UnitTests/CTest.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,10 @@ public Task UnsignedIntBitshiftTest()
292292
const int ShiftSignedLong = 1 << SignedLong;
293293
const int ShiftUnsigned = 1 << Unsigned;
294294
295-
const int Char = 1 << (signed char)1;
296-
const int UChar = 1 << (unsigned char)1;
295+
const int Char = 1 << 'a';
296+
297+
const int Byte = 1 << (signed char)1;
298+
const int UByte = 1 << (unsigned char)1;
297299
298300
const int CInt = 1 << 1;
299301
const int CUint = 1 << 1U;
@@ -353,10 +355,13 @@ public static partial class Methods
353355
public const int ShiftUnsigned = 1 << (int)(Unsigned);
354356
355357
[NativeTypeName(""const int"")]
356-
public const int Char = 1 << (sbyte)(1);
358+
public const int Char = 1 << (sbyte)('a');
359+
360+
[NativeTypeName(""const int"")]
361+
public const int Byte = 1 << (sbyte)(1);
357362
358363
[NativeTypeName(""const int"")]
359-
public const int UChar = unchecked(1 << (byte)(1));
364+
public const int UByte = unchecked(1 << (byte)(1));
360365
361366
[NativeTypeName(""const int"")]
362367
public const int CInt = 1 << 1;
@@ -420,4 +425,4 @@ public static partial class Methods
420425

421426
return ValidateGeneratedCSharpLatestWindowsBindingsAsync(inputContents, expectedOutputContents, commandLineArgs: DefaultCClangCommandLineArgs, language: "c", languageStandard: DefaultCStandard);
422427
}
423-
}
428+
}

0 commit comments

Comments
 (0)