fixed some more tests

This commit is contained in:
JonathanFleischmann 2024-07-03 22:50:32 +02:00
parent 82f62667ec
commit 04a84806b1
5 changed files with 0 additions and 50 deletions

View File

@ -15,11 +15,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
*/
public class CallVariableOutsideScope {
@BeforeEach
public void dontPrintAnything() {
System.setOut(null);
}
// Having a variable declared inside an Else-block and trying to call it outside the block.
@Test
public void CallVariableOutsideScopeOfElse() {
@ -55,9 +50,4 @@ public class CallVariableOutsideScope {
public void CallVariableOutsideScopeOfWhile() {
assertThrows(Exception.class, () -> Compiler.generateByteCodeArrayFromFiles(List.of("src/test/testFiles/Negative/CallVariableOutsideScope/OfWhile.java")));
}
@AfterEach
public void printNormal() {
System.setOut(System.out);
}
}

View File

@ -15,11 +15,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
*/
public class ForbiddenParticularitiesInImplementation {
@BeforeEach
public void dontPrintAnything() {
System.setOut(null);
}
// Using any access modifier other than public
@Test
public void ForbiddenParticularitiesInImplementationAccessModifier() {
@ -75,9 +70,4 @@ public class ForbiddenParticularitiesInImplementation {
"src/test/testFiles/Negative/ForbiddenParticularitiesInImplementation/" +
"UsingSystemOut.java")));
}
@AfterEach
public void printNormal() {
System.setOut(System.out);
}
}

View File

@ -16,11 +16,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
*/
public class MissingComponents {
@BeforeEach
public void dontPrintAnything() {
System.setOut(null);
}
@Test
public void MissingComponentsBraceInClass() {
assertThrows(Exception.class, () -> {
@ -308,9 +303,4 @@ public class MissingComponents {
"src/test/testFiles/Negative/MissingComponents/Return.java"));
});
}
@AfterEach
public void printNormal() {
System.setOut(System.out);
}
}

View File

@ -11,11 +11,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
public class UsingSameName {
@BeforeEach
public void dontPrintAnything() {
System.setOut(null);
}
@Test
public void UsingSameNameForParameterAndVariable() {
assertThrows(Exception.class, () -> Compiler.generateByteCodeArrayFromFiles(List.of(
@ -33,9 +28,4 @@ public class UsingSameName {
assertThrows(Exception.class, () -> Compiler.generateByteCodeArrayFromFiles(List.of(
"src/test/testFiles/Negative/UsingSameName/ForTwoVariables.java")));
}
@AfterEach
public void printNormal() {
System.setOut(System.out);
}
}

View File

@ -11,11 +11,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
public class WrongType {
@BeforeEach
public void dontPrintAnything() {
System.setOut(null);
}
@Test
public void WrongTypeCheckTypeDifferencesBetweenBoolAndChar() {
assertThrows(Exception.class, () -> Compiler.generateByteCodeArrayFromFiles(List.of(
@ -304,9 +299,4 @@ public class WrongType {
assertThrows(Exception.class, () -> Compiler.generateByteCodeArrayFromFiles(List.of(
"src/test/testFiles/Negative/WrongType/InReturnStatementWithinVoidMethod.java")));
}
@AfterEach
public void printNormal() {
System.setOut(System.out);
}
}