mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Remove temporary files after test.
This commit is contained in:
parent
f335591877
commit
0052d43d96
1 changed files with 6 additions and 7 deletions
|
@ -13,8 +13,6 @@ package org.eclipse.cdt.internal.pdom.tests;
|
|||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
|
||||
import junit.framework.Test;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.tag.ITag;
|
||||
import org.eclipse.cdt.core.index.IIndexFileLocation;
|
||||
import org.eclipse.cdt.core.index.IIndexLocationConverter;
|
||||
|
@ -26,8 +24,11 @@ import org.eclipse.cdt.internal.core.pdom.WritablePDOM;
|
|||
import org.eclipse.cdt.internal.core.pdom.tag.PDOMTag;
|
||||
import org.eclipse.cdt.internal.core.pdom.tag.PDOMTagIndex;
|
||||
|
||||
import junit.framework.Test;
|
||||
|
||||
// copy/pasted from BTreeTests
|
||||
public class PDOMTagIndexTests extends BaseTestCase {
|
||||
private File pdomFile;
|
||||
private PDOM pdom;
|
||||
|
||||
public static Test suite() {
|
||||
|
@ -51,12 +52,9 @@ public class PDOMTagIndexTests extends BaseTestCase {
|
|||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
// Create a dummy instance of the PDOM for the various tests to operate
|
||||
// upon. Also acquire the PDOM's write lock to simulate the condition
|
||||
// under which the tag index is normally accessed.
|
||||
File tmpFile = File.createTempFile(getClass().getSimpleName() + '.'
|
||||
pdomFile = File.createTempFile(getClass().getSimpleName() + '.'
|
||||
+ Double.toString(Math.random()).substring(2), null);
|
||||
pdom = new WritablePDOM(tmpFile, new MockIndexLocationConverter(),
|
||||
pdom = new WritablePDOM(pdomFile, new MockIndexLocationConverter(),
|
||||
LanguageManager.getInstance().getPDOMLinkageFactoryMappings());
|
||||
pdom.acquireWriteLock(null);
|
||||
}
|
||||
|
@ -64,6 +62,7 @@ public class PDOMTagIndexTests extends BaseTestCase {
|
|||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
pdom.close();
|
||||
pdomFile.delete();
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue