From bf354d5abe9d64eaa11aefd4b9cf16eeda9fe0c6 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 10 Apr 2025 23:30:39 -0700 Subject: [PATCH] Update source generator unit tests --- .../Test_D2DPixelShaderDescriptorGenerator.cs | 114 ++++++++++++++++++ ...ixelShaderDescriptorGenerator_Analyzers.cs | 2 + 2 files changed, 116 insertions(+) diff --git a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator.cs b/tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator.cs index ec2379b3..a0731c5f 100644 --- a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator.cs +++ b/tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator.cs @@ -102,6 +102,25 @@ public class Test_D2DPixelShaderDescriptorGenerator [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectAuthor => null; + /// + [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] + [global::System.Diagnostics.DebuggerNonUserCode] + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectFactory + { + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + get + { + [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])] + static int EffectFactory(void** effectImpl) + { + return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe(effectImpl); + } + + return (nint)(delegate* unmanaged[Stdcall])&EffectFactory; + } + } + /// [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] [global::System.Diagnostics.DebuggerNonUserCode] @@ -402,6 +421,25 @@ public class Test_D2DPixelShaderDescriptorGenerator [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectAuthor => null; + /// + [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] + [global::System.Diagnostics.DebuggerNonUserCode] + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectFactory + { + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + get + { + [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])] + static int EffectFactory(void** effectImpl) + { + return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe(effectImpl); + } + + return (nint)(delegate* unmanaged[Stdcall])&EffectFactory; + } + } + /// [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] [global::System.Diagnostics.DebuggerNonUserCode] @@ -754,6 +792,25 @@ public class Test_D2DPixelShaderDescriptorGenerator [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectAuthor => "ComputeSharp.D2D1"; + /// + [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] + [global::System.Diagnostics.DebuggerNonUserCode] + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectFactory + { + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + get + { + [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])] + static int EffectFactory(void** effectImpl) + { + return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe(effectImpl); + } + + return (nint)(delegate* unmanaged[Stdcall])&EffectFactory; + } + } + /// [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] [global::System.Diagnostics.DebuggerNonUserCode] @@ -1052,6 +1109,25 @@ public class Test_D2DPixelShaderDescriptorGenerator [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectAuthor => null; + /// + [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] + [global::System.Diagnostics.DebuggerNonUserCode] + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectFactory + { + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + get + { + [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])] + static int EffectFactory(void** effectImpl) + { + return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe(effectImpl); + } + + return (nint)(delegate* unmanaged[Stdcall])&EffectFactory; + } + } + /// [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] [global::System.Diagnostics.DebuggerNonUserCode] @@ -1347,6 +1423,25 @@ public class Test_D2DPixelShaderDescriptorGenerator [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectAuthor => null; + /// + [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] + [global::System.Diagnostics.DebuggerNonUserCode] + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectFactory + { + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + get + { + [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])] + static int EffectFactory(void** effectImpl) + { + return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe(effectImpl); + } + + return (nint)(delegate* unmanaged[Stdcall])&EffectFactory; + } + } + /// [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] [global::System.Diagnostics.DebuggerNonUserCode] @@ -1630,6 +1725,25 @@ public class Test_D2DPixelShaderDescriptorGenerator [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectAuthor => null; + /// + [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] + [global::System.Diagnostics.DebuggerNonUserCode] + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectFactory + { + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + get + { + [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])] + static int EffectFactory(void** effectImpl) + { + return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe(effectImpl); + } + + return (nint)(delegate* unmanaged[Stdcall])&EffectFactory; + } + } + /// [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] [global::System.Diagnostics.DebuggerNonUserCode] diff --git a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator_Analyzers.cs b/tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator_Analyzers.cs index cc3c4a79..42268da0 100644 --- a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator_Analyzers.cs +++ b/tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator_Analyzers.cs @@ -69,6 +69,8 @@ public class Test_D2DPixelShaderDescriptorGenerator_Analyzers public static string? EffectAuthor => throw new NotImplementedException(); + public static nint EffectFactory => throw new NotImplementedException(); + public static int ConstantBufferSize => throw new NotImplementedException(); public static int InputCount => throw new NotImplementedException();