Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorNathan Ridge2017-09-26 17:57:03 +0000
committerNathan Ridge2017-10-04 02:25:02 +0000
commitc7e475e50ea6f0ffca55783cd66b962035b1ffbf (patch)
tree6d11e162aba7e0a15bc4c199a0c00a62ef1a446c /core
parent33d33a8cd6081beac4d62e3556d82f818122cb55 (diff)
downloadorg.eclipse.cdt-c7e475e50ea6f0ffca55783cd66b962035b1ffbf.tar.gz
org.eclipse.cdt-c7e475e50ea6f0ffca55783cd66b962035b1ffbf.tar.xz
org.eclipse.cdt-c7e475e50ea6f0ffca55783cd66b962035b1ffbf.zip
Bug 524338 - Make sure SemanticHighlightingTest.teardown() is called even if an exception was thrown during the test run
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/SemanticHighlightingTest.java15
1 files changed, 10 insertions, 5 deletions
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 {

Back to the top