Test update
This commit is contained in:
parent
8f55a15aef
commit
51240806b9
@ -76,10 +76,9 @@ public class CompareByteCodeBehaviour {
|
||||
Constructor<?> constructor2 = constructors2[0];
|
||||
constructor1.setAccessible(true);
|
||||
constructor2.setAccessible(true);
|
||||
Object[] constructorArgs1 = getDefaultArguments(constructor1.getParameters());
|
||||
Object[] constructorArgs2 = getDefaultArguments(constructor2.getParameters());
|
||||
Object obj1 = constructor1.newInstance(constructorArgs1);
|
||||
Object obj2 = constructor2.newInstance(constructorArgs2);
|
||||
Object[] constructorArgs = getDefaultArguments(constructor1.getParameters());
|
||||
Object obj1 = constructor1.newInstance(constructorArgs);
|
||||
Object obj2 = constructor2.newInstance(constructorArgs);
|
||||
|
||||
// Get methods
|
||||
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());
|
||||
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;
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ public class TestAll {
|
||||
Program ast = FakultaetASTTyped.getProgram();
|
||||
String className = "Fakultaet";
|
||||
String javacode = "src/test/resources/basicClasses/Fakultaet.java";
|
||||
byteCodeTester.testByteCodeFromTypedAst(classPath, ast ,className);
|
||||
//byteCodeTester.testClassFileFromScratch(classPath, javacode, className);
|
||||
//byteCodeTester.testByteCodeFromTypedAst(classPath, ast ,className);
|
||||
byteCodeTester.testClassFileFromScratch(classPath, javacode, className);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -58,7 +58,7 @@ public class TestAll {
|
||||
Program ast = CharArgumentASTTyped.getProgram();
|
||||
String className = "CharArgument";
|
||||
String javacode = "src/test/resources/SimpleTests/CharArgument.java";
|
||||
byteCodeTester.testByteCodeFromTypedAst(classPath, ast ,className);
|
||||
//byteCodeTester.testByteCodeFromTypedAst(classPath, ast ,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 {
|
||||
|
||||
char c;
|
||||
public char c;
|
||||
|
||||
public CharArgument() {
|
||||
this.c = foo('a');
|
||||
}
|
||||
|
||||
char foo(char c) {
|
||||
public char foo(char 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