mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-16 17:48:05 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user