Avoid exceptions in test setUp cause tearDown would not be invoked
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import kotlin.InlineOption.*
|
||||
|
||||
class A {
|
||||
fun foo() {
|
||||
inlineFun { "test" }
|
||||
}
|
||||
|
||||
inline fun inlineFun(lambda: () -> Unit) {
|
||||
inline fun inlineFun(inlineOptions(ONLY_LOCAL_RETURN) lambda: () -> Unit) {
|
||||
val s = object {
|
||||
fun run() {
|
||||
lambda()
|
||||
|
||||
@@ -30,24 +30,14 @@ import java.util.List;
|
||||
import static org.jetbrains.org.objectweb.asm.Opcodes.*;
|
||||
|
||||
public class InnerClassInfoGenTest extends CodegenTestCase {
|
||||
private ClassFileFactory factory;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||
loadFile("innerClassInfo/" + getTestName(true) + ".kt");
|
||||
factory = generateClassesInFile();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
factory = null;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
|
||||
public void testInnerClassInfo() {
|
||||
InnerClassAttribute innerB = new InnerClassAttribute("A$B", "A", "B", ACC_PUBLIC | ACC_STATIC | ACC_FINAL);
|
||||
InnerClassAttribute innerC = new InnerClassAttribute("A$B$C", "A$B", "C", ACC_PUBLIC | ACC_FINAL);
|
||||
@@ -96,7 +86,7 @@ public class InnerClassInfoGenTest extends CodegenTestCase {
|
||||
|
||||
@NotNull
|
||||
private List<InnerClassAttribute> extractInnerClasses(@NotNull String className) {
|
||||
OutputFile outputFile = factory.get(className + ".class");
|
||||
OutputFile outputFile = generateClassesInFile().get(className + ".class");
|
||||
assertNotNull(outputFile);
|
||||
byte[] bytes = outputFile.asByteArray();
|
||||
ClassReader reader = new ClassReader(bytes);
|
||||
|
||||
Reference in New Issue
Block a user