From 3dfbddf693b2a79aba3e98f8de8e1e5f21286204 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Thu, 28 Jun 2018 16:41:13 +0200 Subject: [PATCH] Vector Test anpasen --- .../unifywithoutwildcards/JavaTXCompilerASPTest.java | 4 ++++ test/javFiles/MatrixTest.jav | 11 +++++++++++ test/javFiles/Vector.jav | 8 ++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 test/javFiles/MatrixTest.jav diff --git a/test/asp/unifywithoutwildcards/JavaTXCompilerASPTest.java b/test/asp/unifywithoutwildcards/JavaTXCompilerASPTest.java index b9ac3e02..72742517 100644 --- a/test/asp/unifywithoutwildcards/JavaTXCompilerASPTest.java +++ b/test/asp/unifywithoutwildcards/JavaTXCompilerASPTest.java @@ -66,6 +66,10 @@ public class JavaTXCompilerASPTest { execute(new File(rootDirectory+"Matrix.jav")); } @Test + public void matrixTest() throws IOException, ClassNotFoundException, InterruptedException { + execute(new File(rootDirectory+"MatrixTest.jav")); + } + @Test public void packageTests() throws IOException, ClassNotFoundException, InterruptedException { execute(new File(rootDirectory+"Package.jav")); } diff --git a/test/javFiles/MatrixTest.jav b/test/javFiles/MatrixTest.jav new file mode 100644 index 00000000..574e2fe9 --- /dev/null +++ b/test/javFiles/MatrixTest.jav @@ -0,0 +1,11 @@ +import java.util.Vector; +import java.lang.Object; + +class Matrix extends Vector> { + Object mul1(Object x, Object y) { return x;} + Object add1(Object x, Object y) { return x;} + mul(m) { + var ret = new Matrix(); + return ret; + } +} diff --git a/test/javFiles/Vector.jav b/test/javFiles/Vector.jav index b30d3d4f..5b28234a 100644 --- a/test/javFiles/Vector.jav +++ b/test/javFiles/Vector.jav @@ -1,9 +1,13 @@ import java.util.Vector; -import java.lang.Integer; +import java.lang.Object; class MyVector{ id(x){ - return (x.elementAt(0)); + Object i; + x.elementAt(i); + x.elementAt(i); + x.elementAt(i); + return x.elementAt(i); } } \ No newline at end of file