mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-23 21:18:04 +00:00
chore: repo cleanup and code quality improvements
- Remove global.json (SDK pinning unnecessary) - Remove nuget.config, move MyGet source to .csproj RestoreAdditionalProjectSources - Gitignore ndepend/ entirely, move badges to docs/img/ - Update README.md and docs/ndepend.md badge paths - Add NDepend project property to QuanTAlib.slnx - Expand .editorconfig ReSharper/diagnostic suppressions - Use ArgumentOutOfRangeException instead of ArgumentException - Use discard _ for unused event sender parameters - Remove quantalib.code-workspace and sonar-suppressions.json - Add filter signature SVGs
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace QuanTAlib.Tests;
|
||||
|
||||
public class WmaCoverageTests
|
||||
public class WmaCoverageTests(ITestOutputHelper output)
|
||||
{
|
||||
[Fact]
|
||||
public void Cover_Scalar_Fallback_SmallData()
|
||||
@@ -41,7 +42,7 @@ public class WmaCoverageTests
|
||||
source[i] = i;
|
||||
}
|
||||
|
||||
double[] output = new double[len];
|
||||
double[] result = new double[len];
|
||||
|
||||
// Use reflection to invoke private static CalculateSimdCore
|
||||
var method = typeof(Wma).GetMethod("CalculateSimdCore", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
@@ -73,12 +74,12 @@ public class WmaCoverageTests
|
||||
// Maybe I can use `MethodInfo.CreateDelegate`?
|
||||
// Delegates can take Spans if defined correctly.
|
||||
|
||||
InvokePrivateStaticMethod_WithSpans("CalculateSimdCore", source, output, period);
|
||||
InvokePrivateStaticMethod_WithSpans("CalculateSimdCore", source, result, period);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// If reflection fails, we can't cover it.
|
||||
Console.WriteLine($"Could not invoke AVX2 core: {ex.Message}");
|
||||
output.WriteLine($"Could not invoke AVX2 core: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user