File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
tests/Smdn.Reflection.ReverseGenerating
Smdn.Reflection.ReverseGenerating Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -11,5 +11,14 @@ SPDX-License-Identifier: MIT
1111
1212 <ItemGroup >
1313 <ProjectReference Include =" ..\..\src\Smdn.Reflection.ReverseGenerating\Smdn.Reflection.ReverseGenerating.csproj" />
14+ <PackageReference
15+ Include =" System.Runtime.InteropServices.RuntimeInformation"
16+ Version =" 4.3.0"
17+ Condition = " (
18+ $(TargetFramework.StartsWith('net45')) or
19+ $(TargetFramework.StartsWith('net46')) or
20+ $(TargetFramework.StartsWith('net47'))
21+ )"
22+ />
1423 </ItemGroup >
1524</Project >
Original file line number Diff line number Diff line change @@ -46,7 +46,25 @@ class AttributeTargetsMember {
4646
4747 class AttributeTargetsReturnValue {
4848#if NETFRAMEWORK
49- [ return : AttributeTestCase ( "[return: System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)]" ) ]
49+ static string M0_ExpectedResult =>
50+ RuntimeInformation . FrameworkDescription . StartsWith ( ".NET Framework" , StringComparison . Ordinal )
51+ ? "[return: System.Runtime.InteropServices.MarshalAs(" +
52+ "System.Runtime.InteropServices.UnmanagedType.Bool, " +
53+ "ArraySubType = default(System.Runtime.InteropServices.UnmanagedType), " +
54+ "SizeParamIndex = 0, " +
55+ "SizeConst = 0, " +
56+ "IidParameterIndex = 0, " +
57+ "SafeArraySubType = System.Runtime.InteropServices.VarEnum.VT_EMPTY" +
58+ ")]"
59+ : "[return: System.Runtime.InteropServices.MarshalAs(" +
60+ "System.Runtime.InteropServices.UnmanagedType.Bool)" +
61+ "]" ;
62+
63+ [ return : AttributeTestCase (
64+ expected : null ,
65+ ExpectedValueGeneratorType = typeof ( AttributeTargetsReturnValue ) ,
66+ ExpectedValueGeneratorMemberName = nameof ( M0_ExpectedResult )
67+ ) ]
5068 [ return : MarshalAs ( UnmanagedType . Bool ) ]
5169 public bool M0 ( ) => throw new NotImplementedException ( ) ;
5270#endif
You can’t perform that action at this time.
0 commit comments