diff options
author | Andrew Ferguson | 2008-05-29 13:33:56 +0000 |
---|---|---|
committer | Andrew Ferguson | 2008-05-29 13:33:56 +0000 |
commit | d193d601b1b601f5f2c4814c8e3d8886fe48f5bd (patch) | |
tree | b264d4438d1d791cf87787fb8da2bd12ee6e20d8 | |
parent | ed6c4dc4a0490089fddf8c45183988db8c8802c6 (diff) | |
download | org.eclipse.cdt-d193d601b1b601f5f2c4814c8e3d8886fe48f5bd.tar.gz org.eclipse.cdt-d193d601b1b601f5f2c4814c8e3d8886fe48f5bd.tar.xz org.eclipse.cdt-d193d601b1b601f5f2c4814c8e3d8886fe48f5bd.zip |
234068: don't test windows paths on linux
-rw-r--r-- | core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMLocationTests.java | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMLocationTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMLocationTests.java index 67988ac974f..a3fe4b3e802 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMLocationTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMLocationTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Symbian Software Systems and others. + * Copyright (c) 2007, 2008 Symbian Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,6 +10,10 @@ *******************************************************************************/ package org.eclipse.cdt.internal.pdom.tests; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + import junit.framework.Test; import org.eclipse.cdt.core.dom.IPDOMManager; @@ -23,10 +27,11 @@ import org.eclipse.cdt.core.testplugin.util.TestSourceReader; import org.eclipse.cdt.internal.core.pdom.dom.PDOMProjectIndexLocationConverter; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Platform; import org.osgi.framework.Bundle; /** - * Tests behaviour related to location representation in the PDOM + * Tests behavior related to location representation in the PDOM */ public class PDOMLocationTests extends BaseTestCase { ICProject cproject; @@ -53,15 +58,25 @@ public class PDOMLocationTests extends BaseTestCase { public void testLocationConverter() { PDOMProjectIndexLocationConverter converter = new PDOMProjectIndexLocationConverter(cproject.getProject()); - String[] externals = new String[] { + String[] winExternals= new String[] { "c:/a/b/c/d.foo", "c:\\a\\b\\c\\d\\e.foo", "d:/foo.bar", - "d:\\Documents and Settings\\JDoe\\Eclipse Workspaces\\ProjectX\\foo.bar", + "d:\\Documents and Settings\\JDoe\\Eclipse Workspaces\\ProjectX\\foo.bar" + }; + String[] linuxExternals = new String[] { + "/home/jdoe/workspaces/projectx/foo", "/home/jdoe/eclipse workspaces/projectx/foo.bar" }; - for(int i=0; i<externals.length; i++) { - IIndexFileLocation loc = IndexLocationFactory.getExternalIFL(externals[i]); + + Set<String> externals= new HashSet(); + externals.addAll(Arrays.asList(linuxExternals)); + if(Platform.getOS().equals("win32")) { + externals.addAll(Arrays.asList(winExternals)); + } + + for(String ext : externals) { + IIndexFileLocation loc = IndexLocationFactory.getExternalIFL(ext); String raw = converter.toInternalFormat(loc); IIndexFileLocation roundtrip = converter.fromInternalFormat(raw); assertTrue(roundtrip!=null); |