Änderungen an Testfiles

This commit is contained in:
JanUlrich 2014-09-03 16:15:04 +02:00
parent 3d88fb479b
commit 93a6070bd4
10 changed files with 52 additions and 20 deletions

View File

@ -658,7 +658,7 @@ public class MyCompiler implements MyCompilerAPI
return OutputDir; return OutputDir;
} }
// ino.end // ino.end
/*
// ino.method.getFullyQualifiedNameFromClassname.21322.definition // ino.method.getFullyQualifiedNameFromClassname.21322.definition
public static String getFullyQualifiedNameFromClassname(String typ, ImportDeclarations declarations) public static String getFullyQualifiedNameFromClassname(String typ, ImportDeclarations declarations)
// ino.end // ino.end
@ -677,7 +677,7 @@ public class MyCompiler implements MyCompilerAPI
return ret; return ret;
} }
// ino.end // ino.end
*/
// ino.method.makeRefTypesFullyQualified.21325.defdescription type=javadoc // ino.method.makeRefTypesFullyQualified.21325.defdescription type=javadoc
/** /**
* @author HOTI * @author HOTI
@ -686,7 +686,7 @@ public class MyCompiler implements MyCompilerAPI
* @param containedTypes Alle Typen, die die Klasse beinhaltet * @param containedTypes Alle Typen, die die Klasse beinhaltet
* @param name Alle Klassen, die es in den BasicAssumptions und im * @param name Alle Klassen, die es in den BasicAssumptions und im
* AbstractSyntaxTree gibt @param declarations Alle Import-Declarations * AbstractSyntaxTree gibt @param declarations Alle Import-Declarations
*/
// ino.end // ino.end
// ino.method.makeRefTypesFullyQualified.21325.definition // ino.method.makeRefTypesFullyQualified.21325.definition
public static void makeRefTypesFullyQualified(Vector<Type> containedTypes, ImportDeclarations declarations) public static void makeRefTypesFullyQualified(Vector<Type> containedTypes, ImportDeclarations declarations)
@ -716,7 +716,7 @@ public class MyCompiler implements MyCompilerAPI
} }
} }
// ino.end // ino.end
*/
/** /**
* @author Arne Lüdtke * @author Arne Lüdtke
* Ersetzt alle GTVs durch TPHs mit gleichem Namen. Arbeitet Rekursiv. * Ersetzt alle GTVs durch TPHs mit gleichem Namen. Arbeitet Rekursiv.

View File

@ -690,7 +690,9 @@ public class SourceFile
} }
xConstraints.add(cons); xConstraints.add(cons);
} }
typinferenzLog.debug("Karthesisches Produkt der Constraints: "+xConstraints); //typinferenzLog.debug("Karthesisches Produkt der Constraints: "+xConstraints);
finiteClosure.generateFullyNamedTypes(globalAssumptions);
////////////////////////////// //////////////////////////////
// Unifizierung der Constraints: // Unifizierung der Constraints:
@ -735,6 +737,7 @@ public class SourceFile
//Erst die Unifizierung erstellen: //Erst die Unifizierung erstellen:
Vector<Pair> constraintsClone = (Vector<Pair>)constraints.clone(); Vector<Pair> constraintsClone = (Vector<Pair>)constraints.clone();
/*
//Typen kontrollieren: //Typen kontrollieren:
for(Pair p : constraintsClone){ for(Pair p : constraintsClone){
Type t = p.TA1; Type t = p.TA1;
@ -754,6 +757,7 @@ public class SourceFile
if(!(replaceType == null))p.TA2 = replaceType; if(!(replaceType == null))p.TA2 = replaceType;
} }
} }
*/
Vector<Vector<Pair>> unifyResult = Unify.unify(constraintsClone, finiteClosure); Vector<Vector<Pair>> unifyResult = Unify.unify(constraintsClone, finiteClosure);
//Dann den Ergebnissen anfügen //Dann den Ergebnissen anfügen

View File

@ -659,9 +659,6 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit
// ino.end // ino.end
// ino.method.TRProg.23110.body // ino.method.TRProg.23110.body
{ {
/*
*/
////////////////////////////// //////////////////////////////
// Und los geht's: // Und los geht's:
////////////////////////////// //////////////////////////////

View File

@ -176,8 +176,9 @@ public class Type implements IItemWithOffset
// ino.method.equals.26765.body // ino.method.equals.26765.body
{ {
if(obj instanceof Type){ if(obj instanceof Type){
String name2 = ((Type)obj).printJavaCode(new ResultSet()).toString(); // String name2 = ((Type)obj).printJavaCode(new ResultSet()).toString();
return printJavaCode(new ResultSet()).toString().equals(name2); //return printJavaCode(new ResultSet()).toString().equals(name2);
return ((Type)obj).name.equals(name);
} }
else{ else{
return false; return false;

View File

@ -7,6 +7,7 @@ import java.util.Vector;
import de.dhbwstuttgart.syntaxtree.Class; import de.dhbwstuttgart.syntaxtree.Class;
import de.dhbwstuttgart.syntaxtree.type.Pair; import de.dhbwstuttgart.syntaxtree.type.Pair;
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
// ino.class.FC_TTO.28013.description type=javadoc // ino.class.FC_TTO.28013.description type=javadoc
/** /**
@ -70,5 +71,12 @@ public class FC_TTO
public String toString(){ public String toString(){
return "FC: "+getFC()+"\nTTO: "+getTTO()+"\nCLASSVEC: "+getClasses(); return "FC: "+getFC()+"\nTTO: "+getTTO()+"\nCLASSVEC: "+getClasses();
} }
public void generateFullyNamedTypes(TypeAssumptions ass) {
for(Pair p : this.FC){
p.TA1 = ass.getTypeFor(p.TA1, null);
p.TA2 = ass.getTypeFor(p.TA2, null);
}
}
} }
// ino.end // ino.end

View File

@ -1833,7 +1833,7 @@ throws MatchException
// ino.end // ino.end
// ino.method.SubstHashtable2VectorPair.28076.definition // ino.method.SubstHashtable2VectorPair.28076.definition
public static Vector<Pair> SubstHashtable2VectorPair (Hashtable ht) public static Vector<Pair> SubstHashtable2VectorPair (Hashtable<JavaClassName, Type> ht)
// ino.end // ino.end
// ino.method.SubstHashtable2VectorPair.28076.body // ino.method.SubstHashtable2VectorPair.28076.body
{ {

View File

@ -1,13 +1,12 @@
import java.util.Vector; import java.util.Vector;
class Matrix extends Vector<Vector<java.lang.Integer>> { class Matrix extends Vector<Vector<Integer>> {
Matrix mul(m){ void mul(m){
ret; v1;
ret = new Matrix(); v1 = this.elementAt(1);
i; erg;
i = this.size(); erg = v1.elementAt(1);
}
return ret;
}
} }

View File

@ -11,6 +11,6 @@ public class Matrix {
public void run(){ public void run(){
Vector<String> mustContain = new Vector<String>(); Vector<String> mustContain = new Vector<String>();
//mustContain.add("TestIfStmt var"); //mustContain.add("TestIfStmt var");
MultipleTypesInsertTester.testSingleInsert(this.TEST_FILE, mustContain); //MultipleTypesInsertTester.testSingleInsert(this.TEST_FILE, mustContain);
} }
} }

View File

@ -0,0 +1,5 @@
class RelOpTest{
i = 1 + 1;
j = 1 * 1;
k = 1 / 0;
}

View File

@ -0,0 +1,18 @@
package plugindevelopment.TypeInsertTests;
import java.util.Vector;
import org.junit.Test;
public class OperatorTest {
private static final String TEST_FILE = "OperatorTest.jav";
@Test
public void run(){
Vector<String> mustContain = new Vector<String>();
mustContain.add("Integer i");
mustContain.add("Integer j");
mustContain.add("Integer k");
MultipleTypesInsertTester.testSingleInsert(this.TEST_FILE, mustContain);
}
}