diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java index b9ab582e367..4ff0042aedd 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java @@ -184,9 +184,7 @@ public class SemanticHighlightingTest extends TestCase { return document.getPositions(positionCategory); } - private void makeAssertions(boolean isCpp) throws Exception { - setup(isCpp); - + private void doMakeAssertions() throws Exception { IDocument document = fSourceViewer.getDocument(); int lines = document.getNumberOfLines(); @@ -217,8 +215,15 @@ public class SemanticHighlightingTest extends TestCase { } assertEqualMaps(actual, expected); - - teardown(); + } + + private void makeAssertions(boolean isCpp) throws Exception { + setup(isCpp); + try { + doMakeAssertions(); + } finally { + teardown(); + } } private void makeAssertions() throws Exception {