diff --git a/tests/ComputeSharp.D2D1.Tests/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressorTests.cs b/tests/ComputeSharp.D2D1.Tests/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressorTests.cs new file mode 100644 index 00000000..7a873e9a --- /dev/null +++ b/tests/ComputeSharp.D2D1.Tests/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressorTests.cs @@ -0,0 +1,18 @@ +namespace ComputeSharp.D2D1.Tests; + +/// +/// A test class for the diagnostic suppressor for D2D1 resource texture fields being left uninitialized. +/// +internal sealed partial class D2D1ResourceTextureUninitializedFieldDiagnosticSuppressorTests +{ + public readonly partial struct MyShader : ID2D1PixelShader + { + // This test just needs to validate the project builds fine with this shader. + // If the diagnostic suppressor wasn't working, it'd fail to build because + // Roslyn would emit a CS0649 warning, which would be treated as an error. + [D2DResourceTextureIndex(0)] + private readonly D2D1ResourceTexture1D texture; + + public float4 Execute() => texture[0]; + } +}