From 5f731bb09ca0b7c933fd883b6acc5f47db01dbfc Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Wed, 20 Dec 2017 13:35:55 +0100 Subject: [PATCH] letzte tests --- .../syntaxtree/factory/UnifyTypeFactory.java | 9 +-------- test/bytecode/DuMethod.jav | 2 +- test/bytecode/IfTest.jav | 10 ++++++++++ test/bytecode/JavaTXCompilerTest.java | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 test/bytecode/IfTest.jav diff --git a/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java b/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java index e0a8ddbf..361a7583 100644 --- a/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java +++ b/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java @@ -196,19 +196,12 @@ public class UnifyTypeFactory { RefTypeOrTPHOrWildcardOrGeneric tr = UnifyTypeFactory.convert(mp.getRhsType(), tphs); if(tl instanceof TypePlaceholder){ if(tr instanceof TypePlaceholder) { -<<<<<<< HEAD - if(mp.getPairOp().equals(PairOperator.EQUALSDOT)) - //throw new DebugException("TPH =. TPH ist ein ungültiges Ergebnis"); - //Einfach ignorieren TODO: Das hier muss ausgebessert werden: - return new PairTPHequalRefTypeOrWildcardType((TypePlaceholder)tl, ASTFactory.createObjectType()); - else -======= + if(mp.getPairOp().equals(PairOperator.EQUALSDOT)) { return new PairTPHEqualTPH((TypePlaceholder)tl, (TypePlaceholder)tr); //Einfach ignorieren TODO: Das hier muss ausgebessert werden: //return new PairTPHequalRefTypeOrWildcardType((TypePlaceholder)tl, ASTFactory.createObjectType()); }else{ ->>>>>>> eb8db0e0eb901afd5f4502ee4f7769a394b23422 return new PairTPHsmallerTPH((TypePlaceholder)tl, (TypePlaceholder)tr); } }else if(tr instanceof RefType){ diff --git a/test/bytecode/DuMethod.jav b/test/bytecode/DuMethod.jav index 12666893..b56f6c55 100644 --- a/test/bytecode/DuMethod.jav +++ b/test/bytecode/DuMethod.jav @@ -1,6 +1,6 @@ public class DuMethod{ - method(a,b){ + method(a){ return a; } diff --git a/test/bytecode/IfTest.jav b/test/bytecode/IfTest.jav new file mode 100644 index 00000000..806e2157 --- /dev/null +++ b/test/bytecode/IfTest.jav @@ -0,0 +1,10 @@ +public class IfTest{ + Integer m1(Boolean b) { + Integer i; + if(b) { + return i; + } + + return i; + } +} \ No newline at end of file diff --git a/test/bytecode/JavaTXCompilerTest.java b/test/bytecode/JavaTXCompilerTest.java index 66e60fe1..39413991 100644 --- a/test/bytecode/JavaTXCompilerTest.java +++ b/test/bytecode/JavaTXCompilerTest.java @@ -29,7 +29,7 @@ public class JavaTXCompilerTest { @Test public void test() throws IOException, java.lang.ClassNotFoundException { System.out.println(rootDirectory); - String fileName = "IfTest"; + String fileName = "LamAssign"; filesToTest.add(new File(rootDirectory+fileName+".jav")); System.out.println(rootDirectory+fileName+".jav"); JavaTXCompiler compiler = new JavaTXCompiler(filesToTest);