From 5419b0a3dc05703cf0b0f9cb01863a077b1e9270 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Thu, 29 Mar 2012 20:47:01 +0400 Subject: [PATCH] Tests fixed after visibility changing --- compiler/testData/codegen/regressions/kt529.kt | 2 +- .../tests/nullabilityAndAutoCasts/kt362.jet | 11 +++++------ .../diagnostics/tests/override/SuspiciousCase1.jet | 2 +- .../org/jetbrains/jet/codegen/PropertyGenTest.java | 12 ------------ .../org/jetbrains/jet/types/JetTypeCheckerTest.java | 3 +-- 5 files changed, 8 insertions(+), 22 deletions(-) diff --git a/compiler/testData/codegen/regressions/kt529.kt b/compiler/testData/codegen/regressions/kt529.kt index be27ebbc55c..fca7f661181 100644 --- a/compiler/testData/codegen/regressions/kt529.kt +++ b/compiler/testData/codegen/regressions/kt529.kt @@ -70,7 +70,7 @@ class Luhny() { } } - private fun printAll() { + fun printAll() { while (!buffer.isEmpty()) print(buffer.removeFirst()) digits.clear() diff --git a/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt362.jet b/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt362.jet index 84ae23e9fb9..1c6ec48bea4 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt362.jet +++ b/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt362.jet @@ -6,13 +6,13 @@ package example; fun test() { val p = test.Public() if (p.public is Int) p.public + 1 - if (p.protected is Int) p.protected + 1 - if (p.i_protected is Int) p.i_protected + 1 + if (p.protected is Int) p.protected + 1 + if (p.i_protected is Int) p.i_protected + 1 if (p.internal is Int) p.internal + 1 val i = test.Public() if (i.public is Int) i.public + 1 - if (i.protected is Int) i.protected + 1 - if (i.i_protected is Int) i.i_protected + 1 + if (i.protected is Int) i.protected + 1 + if (i.i_protected is Int) i.i_protected + 1 if (i.internal is Int) i.internal + 1 } @@ -30,5 +30,4 @@ internal class Internal() { protected val protected : Int? = 1; internal protected val i_protected : Int? = 1; val internal : Int? = 1 -} - +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/SuspiciousCase1.jet b/compiler/testData/diagnostics/tests/override/SuspiciousCase1.jet index ff44b3984c3..4d70df96987 100644 --- a/compiler/testData/diagnostics/tests/override/SuspiciousCase1.jet +++ b/compiler/testData/diagnostics/tests/override/SuspiciousCase1.jet @@ -2,7 +2,7 @@ // this test checks it does it properly trait Foo

{ - fun quux(p: P, q: Int = 17) = 18 + fun quux(p: P, q: Int = 17) : Int = 18 } trait Bar : Foo diff --git a/compiler/tests/org/jetbrains/jet/codegen/PropertyGenTest.java b/compiler/tests/org/jetbrains/jet/codegen/PropertyGenTest.java index 9491c4932bf..a5e7eb58dd3 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/PropertyGenTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/PropertyGenTest.java @@ -78,18 +78,6 @@ public class PropertyGenTest extends CodegenTestCase { assertEquals(239, field.get(null)); } - public void testProtectedPropertyInNamespace() throws Exception { - loadText("protected val x : Int = 239"); - final Class nsClass = generateNamespaceClass(); - final Field[] fields = nsClass.getDeclaredFields(); - assertEquals(1, fields.length); - final Field field = fields[0]; - field.setAccessible(true); - assertEquals("x", field.getName()); - assertEquals(Modifier.PROTECTED | Modifier.STATIC | Modifier.FINAL, field.getModifiers()); - assertEquals(239, field.get(null)); - } - public void testFieldPropertyAccess() throws Exception { loadFile("properties/fieldPropertyAccess.jet"); // System.out.println(generateToText()); diff --git a/compiler/tests/org/jetbrains/jet/types/JetTypeCheckerTest.java b/compiler/tests/org/jetbrains/jet/types/JetTypeCheckerTest.java index 0c4a6874137..671c8dbb6f9 100644 --- a/compiler/tests/org/jetbrains/jet/types/JetTypeCheckerTest.java +++ b/compiler/tests/org/jetbrains/jet/types/JetTypeCheckerTest.java @@ -664,9 +664,8 @@ public class JetTypeCheckerTest extends JetLiteFixture { @Override public Set getFunctions(@NotNull String name) { Set writableFunctionGroup = Sets.newLinkedHashSet(); - ModuleDescriptor module = new ModuleDescriptor("TypeCheckerTest"); for (String funDecl : FUNCTION_DECLARATIONS) { - FunctionDescriptor functionDescriptor = descriptorResolver.resolveFunctionDescriptor(module, this, JetPsiFactory.createFunction(getProject(), funDecl), JetTestUtils.DUMMY_TRACE); + FunctionDescriptor functionDescriptor = descriptorResolver.resolveFunctionDescriptor(this.getContainingDeclaration(), this, JetPsiFactory.createFunction(getProject(), funDecl), JetTestUtils.DUMMY_TRACE); if (name.equals(functionDescriptor.getName())) { writableFunctionGroup.add(functionDescriptor); }