1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 10:46:02 +02:00

Bug 579669: Remove testProject in finally block

These tests were not cleaning up properly if they failed.

Change-Id: Ic649335dd439a1cc29dd2784b203158e49d4bb1c
This commit is contained in:
Jonah Graham 2022-04-12 13:41:36 -04:00
parent af2b4aba4b
commit e954ff6fe1

View file

@ -309,7 +309,8 @@ public class CModelTests extends TestCase {
// bug 275609
public void testSourceExclusionFilters_275609() throws Exception {
ICProject testProject;
ICProject testProject = null;
try {
testProject = CProjectHelper.createCProject("bug257609", "none", IPDOMManager.ID_NO_INDEXER);
if (testProject == null)
fail("Unable to create project");
@ -387,17 +388,21 @@ public class CModelTests extends TestCase {
assertEquals(subFolder1, nonCResources[0]);
assertEquals(subFolder2, nonCResources[1]);
assertEquals(file0, nonCResources[2]);
} finally {
try {
if (testProject != null) {
testProject.getProject().delete(true, true, monitor);
}
} catch (CoreException e) {
}
}
}
// bug 179474
public void testSourceExclusionFilters_179474() throws Exception {
ICProject testProject;
ICProject testProject = null;
try {
testProject = CProjectHelper.createCProject("bug179474", "none", IPDOMManager.ID_NO_INDEXER);
if (testProject == null)
fail("Unable to create project");
@ -468,12 +473,15 @@ public class CModelTests extends TestCase {
nonCResources = sourceRoot.getNonCResources();
assertTrue(Arrays.asList(nonCResources).contains(fileA));
} finally {
try {
if (testProject != null) {
testProject.getProject().delete(true, true, monitor);
}
} catch (CoreException e) {
}
}
}
// bug 294965
public void testBinaryInProjectRoot_294965() throws Exception {