Test update
This commit is contained in:
parent
8f55a15aef
commit
51240806b9
@ -76,10 +76,9 @@ public class CompareByteCodeBehaviour {
|
|||||||
Constructor<?> constructor2 = constructors2[0];
|
Constructor<?> constructor2 = constructors2[0];
|
||||||
constructor1.setAccessible(true);
|
constructor1.setAccessible(true);
|
||||||
constructor2.setAccessible(true);
|
constructor2.setAccessible(true);
|
||||||
Object[] constructorArgs1 = getDefaultArguments(constructor1.getParameters());
|
Object[] constructorArgs = getDefaultArguments(constructor1.getParameters());
|
||||||
Object[] constructorArgs2 = getDefaultArguments(constructor2.getParameters());
|
Object obj1 = constructor1.newInstance(constructorArgs);
|
||||||
Object obj1 = constructor1.newInstance(constructorArgs1);
|
Object obj2 = constructor2.newInstance(constructorArgs);
|
||||||
Object obj2 = constructor2.newInstance(constructorArgs2);
|
|
||||||
|
|
||||||
// Get methods
|
// Get methods
|
||||||
Method[] methods1 = new Method[this.methodArray1.size()];
|
Method[] methods1 = new Method[this.methodArray1.size()];
|
||||||
|
@ -77,10 +77,6 @@ public class CompareByteCodeSyntax {
|
|||||||
System.out.println("Annotations do not match for methods " + method1.getName() + " and " + method2.getName());
|
System.out.println("Annotations do not match for methods " + method1.getName() + " and " + method2.getName());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (method1.getModifiers() != method2.getModifiers()) {
|
|
||||||
System.out.println("Modifiers do not match for methods " + method1.getName() + " and " + method2.getName());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,8 @@ public class TestAll {
|
|||||||
Program ast = FakultaetASTTyped.getProgram();
|
Program ast = FakultaetASTTyped.getProgram();
|
||||||
String className = "Fakultaet";
|
String className = "Fakultaet";
|
||||||
String javacode = "src/test/resources/basicClasses/Fakultaet.java";
|
String javacode = "src/test/resources/basicClasses/Fakultaet.java";
|
||||||
byteCodeTester.testByteCodeFromTypedAst(classPath, ast ,className);
|
//byteCodeTester.testByteCodeFromTypedAst(classPath, ast ,className);
|
||||||
//byteCodeTester.testClassFileFromScratch(classPath, javacode, className);
|
byteCodeTester.testClassFileFromScratch(classPath, javacode, className);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -58,7 +58,7 @@ public class TestAll {
|
|||||||
Program ast = CharArgumentASTTyped.getProgram();
|
Program ast = CharArgumentASTTyped.getProgram();
|
||||||
String className = "CharArgument";
|
String className = "CharArgument";
|
||||||
String javacode = "src/test/resources/SimpleTests/CharArgument.java";
|
String javacode = "src/test/resources/SimpleTests/CharArgument.java";
|
||||||
byteCodeTester.testByteCodeFromTypedAst(classPath, ast ,className);
|
//byteCodeTester.testByteCodeFromTypedAst(classPath, ast ,className);
|
||||||
byteCodeTester.testClassFileFromScratch(classPath, javacode, className);
|
byteCodeTester.testClassFileFromScratch(classPath, javacode, className);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
7
src/test/resources/FailTests/AddIntBool.java
Normal file
7
src/test/resources/FailTests/AddIntBool.java
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
class AddIntBool {
|
||||||
|
|
||||||
|
public int add(int myInt, bool myBool) {
|
||||||
|
int result = myInt + myBool;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Binary file not shown.
@ -1,12 +1,12 @@
|
|||||||
class CharArgument {
|
class CharArgument {
|
||||||
|
|
||||||
char c;
|
public char c;
|
||||||
|
|
||||||
public CharArgument() {
|
public CharArgument() {
|
||||||
this.c = foo('a');
|
this.c = foo('a');
|
||||||
}
|
}
|
||||||
|
|
||||||
char foo(char c) {
|
public char foo(char c) {
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
src/test/resources/basicClasses/EmptyClassWithConstructor.class
Normal file
BIN
src/test/resources/basicClasses/EmptyClassWithConstructor.class
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user