fix: suppress MA0077 on ref struct types and fix variable shadowing

ref struct types (BatchOutputs, BatchInputs, ScalarState, WorkBuffers)
cannot implement IEquatable<T> — C# prohibits interface implementation
on ref structs. Added #pragma warning disable/restore MA0077 at type
declaration level in AccBands.cs, Aberr.cs, Apz.cs (9 ref structs).

Renamed local 'output' to 'result' in Wma.Coverage.Tests.cs to avoid
shadowing the primary constructor ITestOutputHelper parameter (S1117/MA0084).
This commit is contained in:
Miha Kralj
2026-03-03 12:42:42 -08:00
parent 3e858ca39e
commit 7737098a54
4 changed files with 24 additions and 6 deletions
+6 -6
View File
@@ -18,12 +18,12 @@ public class WmaCoverageTests(ITestOutputHelper output)
source[i] = i;
}
double[] output = new double[len];
double[] result = new double[len];
// This should trigger CalculateScalarCore internally
Wma.Batch(source.AsSpan(), output.AsSpan(), period);
Wma.Batch(source.AsSpan(), result.AsSpan(), period);
Assert.NotEqual(0, output[period]);
Assert.NotEqual(0, result[period]);
}
[Fact]
@@ -94,11 +94,11 @@ public class WmaCoverageTests(ITestOutputHelper output)
source[i] = i;
}
double[] output = new double[len];
double[] result = new double[len];
InvokePrivateStaticMethod_WithSpans("CalculateScalarCore", source, output, period);
InvokePrivateStaticMethod_WithSpans("CalculateScalarCore", source, result, period);
Assert.NotEqual(0, output[period]);
Assert.NotEqual(0, result[period]);
}
private delegate void CoreDelegate(ReadOnlySpan<double> source, Span<double> output, int period);