diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TestBase.java index f9adac7c4c8..67f4a04eb31 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TestBase.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TestBase.java @@ -505,16 +505,6 @@ public class AST2TestBase extends BaseTestCase { return TestSourceReader.getContentsForTest(plugin.getBundle(), "parser", getClass(), getName(), sections); } - protected static T assertInstance(Object o, Class clazz, Class... cs) { - assertNotNull("Expected object of " + clazz.getName() + " but got a null value", o); - assertTrue("Expected "+clazz.getName()+" but got "+o.getClass().getName(), clazz.isInstance(o)); - for (Class c : cs) { - assertNotNull("Expected object of " + c.getName() + " but got a null value", o); - assertTrue("Expected " + c.getName() + " but got " + o.getClass().getName(), c.isInstance(o)); - } - return clazz.cast(o); - } - protected static void assertField(IBinding binding, String fieldName, String ownerName) { assertInstance(binding, IField.class); assertEquals(fieldName, binding.getName()); diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java index 85f2821b0cc..606fb5ab88c 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java @@ -337,4 +337,16 @@ public class BaseTestCase extends TestCase { public static void waitUntilFileIsIndexed(IIndex index, IFile file) throws Exception { TestSourceReader.waitUntilFileIsIndexed(index, file, INDEXER_TIMEOUT_SEC * 1000); } + + // Assertion helpers + + protected static T assertInstance(Object o, Class clazz, Class... cs) { + assertNotNull("Expected object of " + clazz.getName() + " but got a null value", o); + assertTrue("Expected "+clazz.getName()+" but got "+o.getClass().getName(), clazz.isInstance(o)); + for (Class c : cs) { + assertNotNull("Expected object of " + c.getName() + " but got a null value", o); + assertTrue("Expected " + c.getName() + " but got " + o.getClass().getName(), c.isInstance(o)); + } + return clazz.cast(o); + } }