Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2014-08-04 16:44:21 +0000
committerSergey Prigogin2014-08-04 16:44:21 +0000
commit914dc65ffb3268c75aa042280a82f6e10f0b98ef (patch)
treeaf21057cd93123b588e466b0e319419f94bf56b1
parentaf7c0a635b7ee21662f122f4ab54244f2184dbae (diff)
downloadorg.eclipse.cdt-914dc65ffb3268c75aa042280a82f6e10f0b98ef.tar.gz
org.eclipse.cdt-914dc65ffb3268c75aa042280a82f6e10f0b98ef.tar.xz
org.eclipse.cdt-914dc65ffb3268c75aa042280a82f6e10f0b98ef.zip
More descriptive names of temporary files.
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/ResourceLookupTests.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/GeneratePDOMApplicationTest.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMCPPBugsTest.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMProviderTests.java25
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java2
5 files changed, 18 insertions, 15 deletions
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/ResourceLookupTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/ResourceLookupTests.java
index 31083a4ae6..ff2434d6ce 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/ResourceLookupTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/ResourceLookupTests.java
@@ -217,7 +217,7 @@ public class ResourceLookupTests extends BaseTestCase {
fProject.create(new NullProgressMonitor());
fProject.open(new NullProgressMonitor());
createFolder(fProject, "folder1");
- File f= createTempFile("extern", "h");
+ File f= createTempFile("extern", ".h");
IPath location= Path.fromOSString(f.getAbsolutePath());
IFile file1= fProject.getFile("linked1");
IFile file2= fProject.getFile("linked2.h");
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/GeneratePDOMApplicationTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/GeneratePDOMApplicationTest.java
index c735452918..38afbfcc9f 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/GeneratePDOMApplicationTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/GeneratePDOMApplicationTest.java
@@ -75,7 +75,7 @@ public class GeneratePDOMApplicationTest extends PDOMTestBase {
protected void setUp() throws Exception {
super.setUp();
projectsToDeleteOnTearDown.clear();
- target = nonExistentTempFile("temp", "pdom");
+ target = nonExistentTempFile("temp", ".pdom");
}
@Override
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMCPPBugsTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMCPPBugsTest.java
index 8021e00789..9000c3c9cf 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMCPPBugsTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMCPPBugsTest.java
@@ -109,7 +109,7 @@ public class PDOMCPPBugsTest extends BaseTestCase {
// this test is currently failing on the cdt test build machine, but
// not on my local linux or windows boxes.
- File tmp = nonExistentTempFile("temp", "pdom");
+ File tmp = nonExistentTempFile("temp", ".pdom");
IIndexLocationConverter cvr= new ResourceContainerRelativeLocationConverter(cproject.getProject());
final PDOMManager pdomManager = CCoreInternals.getPDOMManager();
pdomManager.exportProjectPDOM(cproject, tmp, cvr, null);
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMProviderTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMProviderTests.java
index 192cb26885..777c34b899 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMProviderTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMProviderTests.java
@@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.cdt.internal.pdom.tests;
+import static org.eclipse.cdt.core.testplugin.CProjectHelper.createCCProject;
+
import java.io.File;
import java.net.URI;
@@ -53,10 +55,10 @@ public class PDOMProviderTests extends PDOMTestBase {
}
public void testLifeCycle() throws Exception {
- final File tempPDOM= createTempFile("foo", "bar");
+ final File tempPDOM= createTempFile("temp", ".pdom");
{
- ICProject cproject= CProjectHelper.createCCProject("foo" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
+ ICProject cproject= createCCProject("foo" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject.getProject(), new Path("/this.h"), "class A {};\n\n");
waitForIndexer(cproject);
@@ -77,7 +79,7 @@ public class PDOMProviderTests extends PDOMTestBase {
}
final URI baseURI= new File("c:/ExternalSDK/").toURI();
- final ICProject cproject2= CProjectHelper.createCCProject("bar" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
+ final ICProject cproject2= createCCProject("bar" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject2.getProject(), new Path("/source.cpp"), "namespace X { class A {}; }\n\n");
waitForIndexer(cproject2);
@@ -125,10 +127,10 @@ public class PDOMProviderTests extends PDOMTestBase {
}
public void testCommonSDK() throws Exception {
- final File tempPDOM= createTempFile("foo", "bar");
+ final File tempPDOM= createTempFile("temp", ".pdom");
{
- ICProject cproject= CProjectHelper.createCCProject("foo" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
+ ICProject cproject= createCCProject("foo" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject.getProject(), new Path("/this.h"), "class A {};\n\n");
waitForIndexer(cproject);
@@ -148,12 +150,12 @@ public class PDOMProviderTests extends PDOMTestBase {
CProjectHelper.delete(cproject);
}
- final ICProject cproject3= CProjectHelper.createCCProject("bar" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
+ final ICProject cproject3= createCCProject("bar" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject3.getProject(), new Path("/source.cpp"), "namespace Y { class A {}; }\n\n");
waitForIndexer(cproject3);
final URI baseURI= new File("c:/ExternalSDK/").toURI();
- final ICProject cproject2= CProjectHelper.createCCProject("baz" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
+ final ICProject cproject2= createCCProject("baz" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject2.getProject(), new Path("/source.cpp"), "namespace X { class A {}; }\n\n");
waitForIndexer(cproject2);
@@ -182,7 +184,7 @@ public class PDOMProviderTests extends PDOMTestBase {
return cproject2.equals(project) || cproject3.equals(project);
}
}
- ));
+ ));
{
IIndex index= CCorePlugin.getIndexManager().getIndex(cproject2, A_FRAGMENT_OPTIONS);
@@ -243,10 +245,10 @@ public class PDOMProviderTests extends PDOMTestBase {
}
public void testVersionMismatchOfExternalPDOM_178998() throws Exception {
- final File tempPDOM= createTempFile("foo", "bar");
+ final File tempPDOM= createTempFile("temp", ".pdom");
{
- ICProject cproject= CProjectHelper.createCCProject("foo" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
+ ICProject cproject= createCCProject("foo" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject.getProject(), new Path("/this.h"), "class A {};\n\n");
waitForIndexer(cproject);
ResourceContainerRelativeLocationConverter cvr= new ResourceContainerRelativeLocationConverter(cproject.getProject());
@@ -265,7 +267,8 @@ public class PDOMProviderTests extends PDOMTestBase {
}
final URI baseURI= new File("c:/ExternalSDK/").toURI();
- final ICProject cproject2= CProjectHelper.createCCProject("baz" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
+ final ICProject cproject2=
+ createCCProject("baz" + System.currentTimeMillis(), null, IPDOMManager.ID_FAST_INDEXER);
TestSourceReader.createFile(cproject2.getProject(), new Path("/source.cpp"), "namespace X { class A {}; }\n\n");
waitForIndexer(cproject2);
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 1145066387..081bc7302e 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
@@ -110,7 +110,7 @@ public class BaseTestCase extends TestCase {
protected File nonExistentTempFile(String prefix, String suffix) {
File file= new File(System.getProperty("java.io.tmpdir"),
- prefix + System.currentTimeMillis() + '.' + suffix);
+ prefix + System.currentTimeMillis() + suffix);
filesToDeleteOnTearDown.add(file);
return file;
}

Back to the top