1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

crecoskie June 13, 2005

- fix for Bugzilla 99483 (NPE in MBS if you have a file with no extension)
This commit is contained in:
Chris Recoskie 2005-06-14 02:08:29 +00:00
parent 35cc111224
commit 9f79372988
3 changed files with 23 additions and 0 deletions

View file

@ -60,6 +60,7 @@ public class ManagedProject30MakefileTests extends TestCase {
suite.addTest(new ManagedProject30MakefileTests("test30CopyandDeploy"));
suite.addTest(new ManagedProject30MakefileTests("test30DeleteFile"));
suite.addTest(new ManagedProject30MakefileTests("test30NoFilesToBuild"));
suite.addTest(new ManagedProject30MakefileTests("testFileWithNoExtension"));
suite.addTest(new ManagedProject30MakefileTests("testPreAndPostProcessBuildSteps"));
suite.addTest(new ManagedProject30MakefileTests("test30_1"));
suite.addTest(new ManagedProject30MakefileTests("test30_2"));
@ -392,6 +393,21 @@ public class ManagedProject30MakefileTests extends TestCase {
buildDegenerativeProjects(projects, makefiles);
}
/**
* (non-Javadoc)
* tests 3.0 managed build system with a project which has a file with no file extesnion
*/
public void testFileWithNoExtension()
{
IPath[] makefiles = {
Path.fromOSString("makefile"),
Path.fromOSString("objects.mk"),
Path.fromOSString("sources.mk"),
Path.fromOSString("subdir.mk")};
IProject[] projects = createProjects("testFileWithNoExtension", null, null, true);
buildProjects(projects, makefiles);
}
/* (non-Javadoc)
* tests 3.0 style tool integration: create pre-build and post-build steps and verify that
* the proper commands are generated in the makefile which is created by the managedbuild system

View file

@ -228,6 +228,13 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
for (int j=0; j<projResources.length; j++) {
if (projResources[j].getType() == IResource.FILE) {
String fileExt = projResources[j].getFileExtension();
// fix for NPE, bugzilla 99483
if(fileExt == null)
{
fileExt = "";
}
for (int k=0; k<exts.length; k++) {
if (fileExt.equals(exts[k])) {
if (!useFileExts) {