Kleine Änderungen an Tests

This commit is contained in:
JanUlrich 2014-03-13 01:21:02 +01:00
parent d7e6a7848d
commit 8060278e3f
5 changed files with 74 additions and 105 deletions

View File

@ -189,6 +189,7 @@ public class LambdaTest {
}catch(Exception e){
e.printStackTrace();
assertNotNull("Fehler bei Typinferenzalgorithmus. Message: "+e.getMessage(), resultSet);
fail();
}
return resultSet;
}

View File

@ -21,7 +21,7 @@ public class BytecodeTester{
public static Vector<ClassFile> testCodegen(String sourceCode){
MyCompilerAPI compiler = MyCompiler.getAPI();
compiler.parse("class EmptyClass{}");
compiler.parse(sourceCode);
Vector<ClassFile> ret = null;
try {
ret = compiler.codeGeneration(null);

View File

@ -24,7 +24,7 @@ public class GeneralTest extends TestCase{
}
assertTrue("Es darf nur eine ClassFile erstellt werden", cfs.size()==1);
try {
FileOutputStream output = new FileOutputStream(new File(BytecodeTester.rootDirectory+"target-file"));
FileOutputStream output = new FileOutputStream(new File(BytecodeTester.rootDirectory+"FieldTest.class"));
output.write(cfs.firstElement().getBytecode());
} catch (IOException e) {
e.printStackTrace();

View File

@ -1,3 +1,9 @@
interface TestInterface{
methode();
}
class TestClass implements TestInterface{
methode(){
return "test";
}
}

View File

@ -1,123 +1,85 @@
Class DEBUG [Typeinference] Erstellte Assumptions: this: MatrixMethod Assumptions:
[MethodAssumption: Matrix null { []]
Class DEBUG [Typeinference] Erstellte Assumptions: this: ConstructorTest1Method Assumptions:
[MethodAssumption: ConstructorTest1 null { [no type [var], (var = int 1)]]
FieldVar Assumptions:
[typinferenz.assumptions.FieldAssumption@cd7e6ef]
[]
LocalVar Assumptions:
[]
Parameter Assumptions:
[]
Block DEBUG [Typeinference] Prozessing statement: null Return null (( [ f, ]) -> null { [null Return null (f.apply( [ null (this(null)), m, ]))])
Block DEBUG [Typeinference] Prozessing statement: null Return null (f.apply( [ null (this(null)), m, ]))
Block DEBUG [Typeinference] Prozessing statement: TPH CJ Return TPH CF (f: TPH CD.apply( [ Matrix (this(null)), m: TPH CB, ]))
Block DEBUG [Typeinference] Prozessing statement: TPH CK Return TPH CE (( [ TPH CD f, ]) -> TPH CJ { [TPH CJ Return TPH CF (f: TPH CD.apply( [ Matrix (this(null)), m: TPH CB, ]))])
Class DEBUG [Typeinference] Erstellte Constraints: TPH BZ < TPH BZ
[(TPH CG <. TPH CF), (Matrix <. TPH CH), (TPH CB <. TPH CI), (TPH CD <. FunN), ]
TPH CF < TPH CJ
Fun1< TPH CJ, TPH CD > < TPH CE
TPH CE < TPH CK
Fun1< TPH CK, TPH CB > < TPH CC
TPH CC < TPH BZ
Block DEBUG [Typeinference] Prozessing statement: no type [var]
Block DEBUG [Typeinference] Prozessing statement: (var = int 1)
Block DEBUG [Typeinference] Prozessing statement: void(var: TPH D = int 1)
Block DEBUG [Typeinference] Prozessing statement: TPH D [var]
Class DEBUG [Typeinference] Erstellte Constraints: int < TPH D
TPH D < TPH E
SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH BZ <. TPH BZ), (TPH CG <. TPH CF), (Matrix <. TPH CH), (TPH CB <. TPH CI), (TPH CD <. FunN), (TPH CF <. TPH CJ), (Fun1< TPH CJ, TPH CD > <. TPH CE), (TPH CE <. TPH CK), (Fun1< TPH CK, TPH CB > <. TPH CC), (TPH CC <. TPH BZ)]]
SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Matrix), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? extends GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? super GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Matrix >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]]
SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(int <. TPH D), (TPH D <. TPH E)]]
SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH E = int), (TPH D = int)]]
SourceFile DEBUG [Typeinference]
JavaFiles:
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Matrix), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH E = int), (TPH D = int)]
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
SourceFile DEBUG [Typeinference] class ConstructorTest1 extends Object
{
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
return (FunN f) -> {
return f.apply(this, m);;
};
};
Matrix Matrix()
ConstructorTest1 ConstructorTest1()
{
int var;
var = 1;
}
}
Class DEBUG [Typeinference] Erstellte Assumptions: this: ConstructorTest2Method Assumptions:
[MethodAssumption: void void { [(var = NEW ConstructorTest1)], MethodAssumption: ConstructorTest2 null { []]
FieldVar Assumptions:
[typinferenz.assumptions.FieldAssumption@27beded]
LocalVar Assumptions:
[]
Parameter Assumptions:
[]
Block DEBUG [Typeinference] Prozessing statement: (var = NEW ConstructorTest1)
Block DEBUG [Typeinference] Prozessing statement: void(var: TPH B = NEW ConstructorTest1)
Class DEBUG [Typeinference] Erstellte Constraints: TPH B < TPH B
[(ConstructorTest1 <. ConstructorTest1), (ConstructorTest1 <. ConstructorTest1), ]
ConstructorTest1 < TPH B
TPH B < TPH G
void < void
SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH B <. TPH B), (ConstructorTest1 <. ConstructorTest1), (ConstructorTest1 <. TPH B), (TPH B <. TPH G), (void <. void)], [(TPH B <. TPH B), (ConstructorTest1 <. ConstructorTest1), (ConstructorTest1 <. TPH B), (TPH B <. TPH G), (void <. void)]]
SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH G = ConstructorTest1), (TPH B = ConstructorTest1)]]
SourceFile DEBUG [Typeinference]
JavaFiles:
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH G = ConstructorTest1), (TPH B = ConstructorTest1)]
SourceFile DEBUG [Typeinference] class ConstructorTest2 extends Object
{
ConstructorTest1 var;
void method()
{
var = new ConstructorTest1();
}
ConstructorTest2 ConstructorTest2()
{
}
}
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH G = ConstructorTest1), (TPH B = ConstructorTest1)]]
SourceFile DEBUG [Typeinference]
JavaFiles:
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH G = ConstructorTest1), (TPH B = ConstructorTest1)]
SourceFile DEBUG [Typeinference] class ConstructorTest2 extends Object
{
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
return (FunN f) -> {
return f.apply(this, m);;
};
};
Matrix Matrix()
{
}
}
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
return (FunN f) -> {
return f.apply(this, m);;
};
};
Matrix Matrix()
{
}
}
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? extends GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
return (FunN f) -> {
return f.apply(this, m);;
};
};
Matrix Matrix()
{
}
}
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? super GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
return (FunN f) -> {
return f.apply(this, m);;
};
};
Matrix Matrix()
{
}
}
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
return (FunN f) -> {
return f.apply(this, m);;
};
};
Matrix Matrix()
{
}
}
SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Matrix >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]
SourceFile DEBUG [Typeinference] class <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
return (FunN f) -> {
return f.apply(this, m);;
};
};
Matrix Matrix()
ConstructorTest1 var;
void method()
{
var = new ConstructorTest1();
}
ConstructorTest2 ConstructorTest2()
{
}
}