Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user