Refactor code structure and optimize performance across multiple modules

This commit is contained in:
StellaOps Bot
2025-12-26 20:03:22 +02:00
parent c786faae84
commit f10d83c444
1385 changed files with 69732 additions and 10280 deletions

View File

@@ -12,7 +12,8 @@ namespace StellaOps.Scanner.Reachability.Tests;
public class BinaryReachabilityLifterTests
{
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task EmitsSymbolAndCodeIdForBinary()
{
using var temp = new TempDir();
@@ -48,7 +49,8 @@ public class BinaryReachabilityLifterTests
Assert.Equal(expectedCodeId, richNode.CodeId);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task EmitsEntryPointForElfWithNonZeroEntryAddress()
{
using var temp = new TempDir();
@@ -84,7 +86,8 @@ public class BinaryReachabilityLifterTests
Assert.NotNull(entryEdge);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task EmitsPurlForLibrary()
{
using var temp = new TempDir();
@@ -110,7 +113,8 @@ public class BinaryReachabilityLifterTests
Assert.Equal("pkg:generic/libssl@3", node.Attributes["purl"]);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task DoesNotEmitEntryPointForElfWithZeroEntry()
{
using var temp = new TempDir();
@@ -135,7 +139,8 @@ public class BinaryReachabilityLifterTests
Assert.DoesNotContain(graph.Nodes, n => n.Kind == "entry_point");
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task EmitsUnknownsForElfUndefinedDynsymSymbols()
{
using var temp = new TempDir();
@@ -168,7 +173,8 @@ public class BinaryReachabilityLifterTests
e.To == unknownNode.SymbolId);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task RichGraphIncludesPurlAndSymbolDigestForElfDependencies()
{
using var temp = new TempDir();
@@ -196,7 +202,8 @@ public class BinaryReachabilityLifterTests
Assert.StartsWith("sha256:", edge.SymbolDigest, StringComparison.Ordinal);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task RichGraphIncludesPurlAndSymbolDigestForPeImports()
{
using var temp = new TempDir();
@@ -374,6 +381,7 @@ public class BinaryReachabilityLifterTests
using var ms = new MemoryStream();
using var writer = new BinaryWriter(ms);
using StellaOps.TestKit;
var stringTable = new StringBuilder();
stringTable.Append('\0');
var stringOffsets = new Dictionary<string, int>(StringComparer.Ordinal);