Skip to content

Commit

Permalink
adapted tests to the ignored Library classes in the call graph algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKlauke committed Nov 17, 2023
1 parent c553668 commit 4e83872
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public void testRecursiveCall() {
assertTrue(cg.containsMethod(mainMethodSignature));
assertTrue(cg.containsMethod(method));
assertFalse(cg.containsMethod(uncalledMethod));
// 2 methods + Object::clinit + Object::registerNatives
TestCase.assertEquals(4, cg.getMethodSignatures().size());
// 2 methods + Object::clinit
TestCase.assertEquals(3, cg.getMethodSignatures().size());

assertTrue(cg.containsCall(mainMethodSignature, mainMethodSignature));
assertTrue(cg.containsCall(mainMethodSignature, method));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void testMiscExample1() {

assertEquals(
cg.toString().replace("\n", "").replace("\t", ""),
"GraphBasedCallGraph(16):"
"GraphBasedCallGraph(14):"
+ "<example1.A: void <init>()>:"
+ "to <java.lang.Object: void <init>()>"
+ "from <example1.B: void <init>()>"
Expand Down Expand Up @@ -238,15 +238,9 @@ public void testMiscExample1() {
+ "to <java.lang.Object: void <clinit>()>"
+ ""
+ "<java.lang.Object: void <clinit>()>:"
+ "to <java.lang.Object: void <clinit>()>"
+ "to <java.lang.Object: void registerNatives()>"
+ "from <example1.Example: void main(java.lang.String[])>"
+ "from <java.lang.Object: void <clinit>()>"
+ ""
+ "<java.lang.Object: void <init>()>:"
+ "from <example1.A: void <init>()>"
+ ""
+ "<java.lang.Object: void registerNatives()>:"
+ "from <java.lang.Object: void <clinit>()>");
+ "from <example1.A: void <init>()>");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void testMiscExample1() {

assertEquals(
cg.toString().replace("\n", "").replace("\t", ""),
"GraphBasedCallGraph(15):"
"GraphBasedCallGraph(13):"
+ "<example1.A: void <init>()>:"
+ "to <java.lang.Object: void <init>()>"
+ "from <example1.B: void <init>()>"
Expand Down Expand Up @@ -226,16 +226,10 @@ public void testMiscExample1() {
+ "to <java.lang.Object: void <clinit>()>"
+ ""
+ "<java.lang.Object: void <clinit>()>:"
+ "to <java.lang.Object: void <clinit>()>"
+ "to <java.lang.Object: void registerNatives()>"
+ "from <example1.Example: void main(java.lang.String[])>"
+ "from <java.lang.Object: void <clinit>()>"
+ ""
+ "<java.lang.Object: void <init>()>:"
+ "from <example1.A: void <init>()>"
+ ""
+ "<java.lang.Object: void registerNatives()>:"
+ "from <java.lang.Object: void <clinit>()>");
+ "from <example1.A: void <init>()>");
}

@Test
Expand Down

0 comments on commit 4e83872

Please sign in to comment.