Prevent double initialization in codegen tests, fix ScriptGenTest#testDependentScripts

Add an assertion to prevent duplicate initialization of CodegenTestFiles
instance in CodegenTestCase, which was happening in ScriptGenTest with multiple
invocation of loadFile()
This commit is contained in:
Alexander Udalov
2016-09-28 12:45:44 +03:00
parent 9fb9c12f5e
commit 74d6ef73d4
5 changed files with 9 additions and 9 deletions
@@ -109,9 +109,10 @@ public class OuterClassGenTest extends CodegenTestCase {
public void testLocalObjectInLambdaInlinedIntoObject() throws Exception {
OuterClassInfo intoObjectInfo = new OuterClassInfo("foo/Bar", "objectInLambdaInlinedIntoObject", "()V");
doCustomTest("foo/Bar\\$objectInLambdaInlinedIntoObject\\$\\$inlined\\$inlineFoo\\$1", intoObjectInfo, "inlineObject");
}
public void testLocalObjectInLambdaInlinedIntoObject2() throws Exception {
OuterClassInfo objectInLambda = new OuterClassInfo("foo/Bar$objectInLambdaInlinedIntoObject$$inlined$inlineFoo$1", "run", "()V");
doCustomTest("foo/Bar\\$objectInLambdaInlinedIntoObject\\$\\$inlined\\$inlineFoo\\$1\\$lambda\\$1",
objectInLambda, "inlineObject");
@@ -134,9 +135,10 @@ public class OuterClassGenTest extends CodegenTestCase {
public void testLambdaInLambdaInlinedIntoObject() throws Exception {
OuterClassInfo intoObjectInfo = new OuterClassInfo("foo/Bar", "objectInLambdaInlinedIntoObject", "()V");
doCustomTest("foo/Bar\\$objectInLambdaInlinedIntoObject\\$\\$inlined\\$inlineFoo\\$1", intoObjectInfo, "inlineLambda");
}
public void testLambdaInLambdaInlinedIntoObject2() throws Exception {
OuterClassInfo objectInLambda = new OuterClassInfo("foo/Bar$objectInLambdaInlinedIntoObject$$inlined$inlineFoo$1", "invoke", "()V");
doCustomTest("foo/Bar\\$objectInLambdaInlinedIntoObject\\$\\$inlined\\$inlineFoo\\$1\\$lambda\\$1",
objectInLambda, "inlineLambda");