From 427529102a0338f1102a4d64352e3bf96928122c Mon Sep 17 00:00:00 2001 From: "Achim D. Brucker" Date: Wed, 31 Aug 2016 08:42:53 +0100 Subject: [PATCH] Added tests for checking call grap sizes. --- .../crosslanguage/test/apps/Featherweight.scala | 13 +++++++++++++ .../test/apps/Featherweight_100_350.scala | 12 ++++++++++++ .../test/apps/Featherweight_100_630.scala | 14 +++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight.scala b/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight.scala index 17ff9ad..a4aebe1 100644 --- a/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight.scala +++ b/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight.scala @@ -61,6 +61,19 @@ class Featherweight extends FlatSpec with Matchers with BeforeAndAfterAll { app.analyze(ApkName, options, connections) } + "Merged CallGraph" should "contain 6.6k nodes" in { + app.getCallGraphSize() should be (6631 +- 20) + } + + "JavaScriptCallGraph" should "contain 0.8k nodes" in { + app.getJSCallGraphSize() should be (856 +- 10) + } + + "JavaCallGraph" should "be contain 5.7k nodes" in { + app.getJavaCallGraphSize() should be (5775 +- 10) + } + + "Java -> JavaScript" should "report ten hits" taggedAs (ManuallyChecked) in { app.getJava2JSHits() should be (10) } diff --git a/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight_100_350.scala b/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight_100_350.scala index b567b6e..a206e26 100644 --- a/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight_100_350.scala +++ b/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight_100_350.scala @@ -66,6 +66,18 @@ class Featherweight_100_350 extends FlatSpec with Matchers with BeforeAndAfterAl app.analyze(ApkName, options, connections) } + "Merged CallGraph" should "contain 6.6k nodes" in { + app.getCallGraphSize() should be (6627 +- 20) + } + + "JavaScriptCallGraph" should "contain 0.8k nodes" in { + app.getJSCallGraphSize() should be (858 +- 10) + } + + "JavaCallGraph" should "be contain 5.7k nodes" in { + app.getJavaCallGraphSize() should be (5769 +- 10) + } + "Java -> JavaScript" should "report fourteen hits" taggedAs (ManuallyChecked) in { app.getJava2JSHits() should be (14) } diff --git a/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight_100_630.scala b/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight_100_630.scala index ad3e9b6..56ad370 100644 --- a/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight_100_630.scala +++ b/src/eu.aniketos.dasca.crosslanguage.test/src/main/scala/eu/aniketos/dasca/crosslanguage/test/apps/Featherweight_100_630.scala @@ -64,7 +64,19 @@ class Featherweight_100_630 extends FlatSpec with Matchers with BeforeAndAfterAl val app = new AppTest(); override def beforeAll(){ app.analyze(ApkName, options, connections) - } + } + + "Merged CallGraph" should "contain 4.3k nodes" in { + app.getCallGraphSize() should be (4351 +- 20) + } + + "JavaScriptCallGraph" should "contain 0.9k nodes" in { + app.getJSCallGraphSize() should be (918 +- 10) + } + + "JavaCallGraph" should "be contain 3.4k nodes" in { + app.getJavaCallGraphSize() should be (3433 +- 10) + } "Java -> JavaScript" should "report fourteen hits" taggedAs (ManuallyChecked) in { app.getJava2JSHits() should be (14)