versuche bei new operator nochmals neue Typvariablen zu vergeben
This commit is contained in:
parent
7585fba4d3
commit
9ed65b547f
895
.idea/workspace.xml
generated
895
.idea/workspace.xml
generated
File diff suppressed because it is too large
Load Diff
@ -60,18 +60,6 @@ public class NewOperatorTest2 {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception exc) {
|
||||
|
60
test/strucTypes5/NewOperatorTest3.jav
Normal file
60
test/strucTypes5/NewOperatorTest3.jav
Normal file
@ -0,0 +1,60 @@
|
||||
|
||||
|
||||
|
||||
class Main {
|
||||
mainI () { return new A().mt( new MyInteger(), new MyInteger() ); }
|
||||
mainL () { return new A().mt( new MyList(), new MyList() ); }
|
||||
}
|
||||
|
||||
|
||||
class A{
|
||||
mt(x,y) { return x.sub(y); }
|
||||
}
|
||||
|
||||
|
||||
class MyInteger {
|
||||
|
||||
}
|
||||
|
||||
|
||||
class MyList{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
class Main {
|
||||
mainI () { return new A().mt( new MyInteger() , new MyInteger() , new MyInteger() ); }
|
||||
mainL () { return new A().mt( new MyList() , new MyList(), new MyList() ); }
|
||||
}
|
||||
|
||||
|
||||
class A{
|
||||
mt(x,y,z) { return x.sub(y).add(z); }
|
||||
}
|
||||
|
||||
|
||||
class MyInteger {
|
||||
|
||||
}
|
||||
|
||||
|
||||
class MyList{
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
61
test/strucTypes5/NewOperatorTest3.java
Normal file
61
test/strucTypes5/NewOperatorTest3.java
Normal file
@ -0,0 +1,61 @@
|
||||
package strucTypes5;
|
||||
|
||||
import de.dhbwstuttgart.parser.JavaTXParser;
|
||||
import de.dhbwstuttgart.strucTypes5.algo.TI;
|
||||
import de.dhbwstuttgart.strucTypes5.assumptions.AssumptionMap;
|
||||
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
||||
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
*
|
||||
* Test soll prüfen ob bei einem Aufruf von zwei mal der gleichen Klasse unterschiedlich neue Typvariablen vergeben werden
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class NewOperatorTest3 {
|
||||
private static final String rootDirectory = System.getProperty("user.dir") + "/test/strucTypes5/";
|
||||
|
||||
@Test
|
||||
public void run() {
|
||||
|
||||
|
||||
List<String> filenames = new ArrayList<String>();
|
||||
filenames.add("NewOperatorTest3.jav");
|
||||
|
||||
JavaTXParser parser = new JavaTXParser();
|
||||
try {
|
||||
for (String filename : filenames) {
|
||||
|
||||
System.out.println("Teste: " + filename);
|
||||
|
||||
SourceFile sf = parser.parse(new File(rootDirectory + filename));
|
||||
|
||||
SourceFile sfdebug = sf;
|
||||
|
||||
ClassOrInterface mainClass = sf.getClasses().get(0);
|
||||
ClassOrInterface aClass = sf.getClasses().get(1);
|
||||
|
||||
|
||||
AssumptionMap assumptionMap = new AssumptionMap();
|
||||
|
||||
TI ti = new TI(assumptionMap, aClass);
|
||||
|
||||
TI ti1 = new TI(ti.assresult, mainClass);
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception exc) {
|
||||
exc.printStackTrace();
|
||||
fail();
|
||||
}
|
||||
assertTrue("Tests durchlaufen", filenames.size() > 0);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user