Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -8,11 +8,14 @@ using StellaOps.Scanner.Reachability;
|
||||
using StellaOps.Scanner.Reachability.Lifters;
|
||||
using Xunit;
|
||||
|
||||
|
||||
using StellaOps.TestKit;
|
||||
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 +51,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 +88,8 @@ public class BinaryReachabilityLifterTests
|
||||
Assert.NotNull(entryEdge);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task EmitsPurlForLibrary()
|
||||
{
|
||||
using var temp = new TempDir();
|
||||
@@ -110,7 +115,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 +141,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 +175,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 +204,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();
|
||||
|
||||
Reference in New Issue
Block a user