From e58a3323c8d086bc699ece9de857c6335bc76af3 Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Thu, 13 Dec 2012 10:17:57 -0500 Subject: [PATCH] bug 396411: JUnit failure, correction of expected results for Unix --- .../core/tests/ManagedBuildCoreTests20.java | 42 ++++++++++++++----- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCoreTests20.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCoreTests20.java index 805d83df23d..73c4d90863a 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCoreTests20.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildCoreTests20.java @@ -51,9 +51,11 @@ import org.eclipse.core.resources.IWorkspaceRunnable; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; /* @@ -232,21 +234,39 @@ public class ManagedBuildCoreTests20 extends TestCase { } //These are the expected path settings - final String[] expectedPaths = { - toOSString("/usr/include"), - toOSString("/opt/gnome/include"), - toOSString("C:\\home\\tester/include"), - // relative path makes 2 entries - project.getLocation().append("includes").toOSString(), - "includes", - "/usr/gnu/include", // This one set to ICSettingEntry.RESOLVED - }; + IPath buildCWD = project.getLocation().append("Sub Config"); + + final String[] expectedPaths; + if (new Path("C:\\home\\tester/include").isAbsolute()) { + // Windows + expectedPaths = new String[] { + toOSString("/usr/include"), + toOSString("/opt/gnome/include"), + toOSString("C:\\home\\tester/include"), + // relative paths make 2 entries + project.getLocation().append("includes").toOSString(), + "includes", // FIXME this is incorrect, the original entry set via extension point is "../includes" + "/usr/gnu/include", // Not converted to OS string due to being flagged as ICSettingEntry.RESOLVED + }; + } else { + // Unix + expectedPaths = new String[] { + toOSString("/usr/include"), + toOSString("/opt/gnome/include"), + // relative paths make 2 entries + buildCWD.append("C:\\home\\tester/include").toOSString(), + "C:\\home\\tester/include", + project.getLocation().append("includes").toOSString(), + "includes", // FIXME this is incorrect, the original entry set via extension point is "../includes" + "/usr/gnu/include", // Not converted to OS string due to being flagged as ICSettingEntry.RESOLVED + }; + } // Create a new managed project based on the sub project type IProjectType projType = ManagedBuildManager.getExtensionProjectType("test.sub"); assertNotNull(projType); - // Create the managed-project (.cdtbuild) for our project + // Create the managed-project for our project IManagedProject newProject = null; try { newProject = ManagedBuildManager.createManagedProject(project, projType); @@ -527,7 +547,7 @@ public class ManagedBuildCoreTests20 extends TestCase { IProjectType projType = ManagedBuildManager.getExtensionProjectType("test.root"); assertNotNull(projType); - // Create the managed-project (.cdtbuild) for our project that builds a dummy executable + // Create the managed-project for our project that builds a dummy executable IManagedProject newProject = ManagedBuildManager.createManagedProject(project, projType); assertEquals(newProject.getName(), projType.getName()); assertFalse(newProject.equals(projType));