Testfall für Bug 48: Uninizierte Variablen erstellt

This commit is contained in:
Enrico Schrödter 2016-05-12 21:14:57 +02:00
parent 58db64ad22
commit 47c2b78713
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,15 @@
import java.util.Vector;
class UninitializedVariable{
Integer method(Integer v) {
return v;
}
public static void main(String[] args) {
UninitializedVariable ol;
ol = new UninitializedVariable();
Integer v;
ol.method(v);
}
}

View File

@ -0,0 +1,39 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import junit.framework.TestCase;
import org.junit.Test;
import plugindevelopment.TypeInsertTester;
import de.dhbwstuttgart.core.MyCompiler;
import de.dhbwstuttgart.core.MyCompilerAPI;
import de.dhbwstuttgart.logger.LoggerConfiguration;
import de.dhbwstuttgart.logger.Section;
import de.dhbwstuttgart.parser.JavaParser.yyException;
import de.dhbwstuttgart.typeinference.ByteCodeResult;
import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class UninitializedVariableTest extends SourceFileBytecodeTest{
@Override
protected void init() {
testName = "UninitializedVariable";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test
public void testConstruct() throws Exception{
ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}