mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Compiler warnings + Generics
This commit is contained in:
parent
513a9a614f
commit
a7da2de702
5 changed files with 69 additions and 100 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2011 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -18,7 +18,6 @@ import junit.framework.Assert;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
|
@ -76,7 +75,7 @@ public class BuildSystemTestHelper {
|
||||||
Configuration config = new Configuration(mProj, (Configuration)cfgs[i], id, false, true, false);
|
Configuration config = new Configuration(mProj, (Configuration)cfgs[i], id, false, true, false);
|
||||||
CConfigurationData data = config.getConfigurationData();
|
CConfigurationData data = config.getConfigurationData();
|
||||||
Assert.assertNotNull("data is null for created configuration", data);
|
Assert.assertNotNull("data is null for created configuration", data);
|
||||||
ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
|
||||||
}
|
}
|
||||||
coreModel.setProjectDescription(project, des);
|
coreModel.setProjectDescription(project, des);
|
||||||
return project;
|
return project;
|
||||||
|
@ -123,9 +122,9 @@ public class BuildSystemTestHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
static public void checkDiff(Object[] arr1, Object[] arr2){
|
static public void checkDiff(Object[] arr1, Object[] arr2){
|
||||||
LinkedHashSet set1 = new LinkedHashSet(Arrays.asList(arr1));
|
LinkedHashSet<? extends Object> set1 = new LinkedHashSet<Object>(Arrays.asList(arr1));
|
||||||
LinkedHashSet set2 = new LinkedHashSet(Arrays.asList(arr2));
|
LinkedHashSet<? extends Object> set2 = new LinkedHashSet<Object>(Arrays.asList(arr2));
|
||||||
LinkedHashSet set1Copy = new LinkedHashSet(set1);
|
LinkedHashSet<? extends Object> set1Copy = new LinkedHashSet<Object>(set1);
|
||||||
set1.removeAll(set2);
|
set1.removeAll(set2);
|
||||||
set2.removeAll(set1Copy);
|
set2.removeAll(set1Copy);
|
||||||
|
|
||||||
|
@ -141,7 +140,7 @@ public class BuildSystemTestHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static public String collectionToString(Collection c){
|
static public String collectionToString(Collection<? extends Object> c){
|
||||||
return arrayToString(c.toArray());
|
return arrayToString(c.toArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2009 Intel Corporation and others.
|
* Copyright (c) 2007, 2011 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -14,7 +14,6 @@ import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
|
|
||||||
public class DiffUtil {
|
public class DiffUtil {
|
||||||
private static final String DIFF_CMD = "diff -ub";
|
private static final String DIFF_CMD = "diff -ub";
|
||||||
|
@ -41,22 +40,9 @@ public class DiffUtil {
|
||||||
if(in == null)
|
if(in == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
String charSet = null;
|
|
||||||
BufferedReader br;
|
BufferedReader br;
|
||||||
if (null == charSet) {
|
br = new BufferedReader(new InputStreamReader(in));
|
||||||
br = new BufferedReader(new InputStreamReader(in));
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
br = new BufferedReader(new InputStreamReader(in, charSet));
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String line;
|
String line;
|
||||||
String prev_key = null; // previous key read and saved in envVars
|
|
||||||
String prev_value = null; // value of previous key
|
|
||||||
StringBuffer buf = new StringBuffer();
|
StringBuffer buf = new StringBuffer();
|
||||||
try {
|
try {
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
/**
|
/**
|
||||||
* Table of IPath -> ExpectedChange
|
* Table of IPath -> ExpectedChange
|
||||||
*/
|
*/
|
||||||
private Hashtable fExpectedChanges = new Hashtable();
|
private Hashtable<IPath, ExpectedChange> fExpectedChanges = new Hashtable<IPath, ExpectedChange>();
|
||||||
boolean fIsDeltaValid = true;
|
boolean fIsDeltaValid = true;
|
||||||
private StringBuffer fMessage = new StringBuffer();
|
private StringBuffer fMessage = new StringBuffer();
|
||||||
/**
|
/**
|
||||||
|
@ -165,7 +165,6 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
* @param resource the resource that is expected to change
|
* @param resource the resource that is expected to change
|
||||||
* @param status the type of change (ADDED, REMOVED, CHANGED)
|
* @param status the type of change (ADDED, REMOVED, CHANGED)
|
||||||
* @param changeFlags the type of change (CONTENT, SYNC, etc)
|
* @param changeFlags the type of change (CONTENT, SYNC, etc)
|
||||||
* @see IResourceConstants
|
|
||||||
*/
|
*/
|
||||||
public void addExpectedChange(IResource resource, int status, int changeFlags) {
|
public void addExpectedChange(IResource resource, int status, int changeFlags) {
|
||||||
addExpectedChange(resource, null, status, changeFlags, null, null);
|
addExpectedChange(resource, null, status, changeFlags, null, null);
|
||||||
|
@ -178,8 +177,6 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
* @param resource the resource that is expected to change
|
* @param resource the resource that is expected to change
|
||||||
* @param status the type of change (ADDED, REMOVED, CHANGED)
|
* @param status the type of change (ADDED, REMOVED, CHANGED)
|
||||||
* @param changeFlags the type of change (CONTENT, SYNC, etc)
|
* @param changeFlags the type of change (CONTENT, SYNC, etc)
|
||||||
* @param movedPath or null
|
|
||||||
* @see IResourceConstants
|
|
||||||
*/
|
*/
|
||||||
public void addExpectedChange(IResource resource, int status, int changeFlags, IPath movedFromPath, IPath movedToPath) {
|
public void addExpectedChange(IResource resource, int status, int changeFlags, IPath movedFromPath, IPath movedToPath) {
|
||||||
addExpectedChange(resource, null, status, changeFlags, movedFromPath, movedToPath);
|
addExpectedChange(resource, null, status, changeFlags, movedFromPath, movedToPath);
|
||||||
|
@ -193,8 +190,6 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
* @param topLevelParent Do not added expected changes above this parent
|
* @param topLevelParent Do not added expected changes above this parent
|
||||||
* @param status the type of change (ADDED, REMOVED, CHANGED)
|
* @param status the type of change (ADDED, REMOVED, CHANGED)
|
||||||
* @param changeFlags the type of change (CONTENT, SYNC, etc)
|
* @param changeFlags the type of change (CONTENT, SYNC, etc)
|
||||||
* @param movedPath or null
|
|
||||||
* @see IResourceConstants
|
|
||||||
*/
|
*/
|
||||||
public void addExpectedChange(IResource resource, IResource topLevelParent, int status, int changeFlags) {
|
public void addExpectedChange(IResource resource, IResource topLevelParent, int status, int changeFlags) {
|
||||||
addExpectedChange(resource, topLevelParent, status, changeFlags, null, null);
|
addExpectedChange(resource, topLevelParent, status, changeFlags, null, null);
|
||||||
|
@ -208,8 +203,6 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
* @param topLevelParent Do not added expected changes above this parent
|
* @param topLevelParent Do not added expected changes above this parent
|
||||||
* @param status the type of change (ADDED, REMOVED, CHANGED)
|
* @param status the type of change (ADDED, REMOVED, CHANGED)
|
||||||
* @param changeFlags the type of change (CONTENT, SYNC, etc)
|
* @param changeFlags the type of change (CONTENT, SYNC, etc)
|
||||||
* @param movedPath or null
|
|
||||||
* @see IResourceConstants
|
|
||||||
*/
|
*/
|
||||||
public void addExpectedChange(IResource resource, IResource topLevelParent, int status, int changeFlags, IPath movedFromPath, IPath movedToPath) {
|
public void addExpectedChange(IResource resource, IResource topLevelParent, int status, int changeFlags, IPath movedFromPath, IPath movedToPath) {
|
||||||
resetIfNecessary();
|
resetIfNecessary();
|
||||||
|
@ -234,7 +227,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
private void checkChanges(IResourceDelta delta) {
|
private void checkChanges(IResourceDelta delta) {
|
||||||
IResource resource = delta.getResource();
|
IResource resource = delta.getResource();
|
||||||
|
|
||||||
ExpectedChange expectedChange = (ExpectedChange) fExpectedChanges.remove(resource.getFullPath());
|
ExpectedChange expectedChange = fExpectedChanges.remove(resource.getFullPath());
|
||||||
|
|
||||||
int status = delta.getKind();
|
int status = delta.getKind();
|
||||||
int changeFlags = delta.getFlags();
|
int changeFlags = delta.getFlags();
|
||||||
|
@ -259,12 +252,12 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
IResourceDelta[] changedChildren = delta.getAffectedChildren(IResourceDelta.CHANGED, IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS | IContainer.INCLUDE_HIDDEN);
|
IResourceDelta[] changedChildren = delta.getAffectedChildren(IResourceDelta.CHANGED, IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS | IContainer.INCLUDE_HIDDEN);
|
||||||
IResourceDelta[] removedChildren = delta.getAffectedChildren(IResourceDelta.REMOVED, IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS | IContainer.INCLUDE_HIDDEN);
|
IResourceDelta[] removedChildren = delta.getAffectedChildren(IResourceDelta.REMOVED, IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS | IContainer.INCLUDE_HIDDEN);
|
||||||
|
|
||||||
Hashtable h = new Hashtable(affectedChildren.length + 1);
|
Hashtable<IResource, IResourceDelta> h = new Hashtable<IResource, IResourceDelta>(affectedChildren.length + 1);
|
||||||
|
|
||||||
for (int i = 0; i < addedChildren.length; ++i) {
|
for (int i = 0; i < addedChildren.length; ++i) {
|
||||||
IResourceDelta childDelta1 = addedChildren[i];
|
IResourceDelta childDelta1 = addedChildren[i];
|
||||||
IResource childResource = childDelta1.getResource();
|
IResource childResource = childDelta1.getResource();
|
||||||
IResourceDelta childDelta2 = (IResourceDelta) h.get(childResource);
|
IResourceDelta childDelta2 = h.get(childResource);
|
||||||
if (childDelta2 != null) {
|
if (childDelta2 != null) {
|
||||||
recordDuplicateChild(childResource.getFullPath(), childDelta2.getKind(), childDelta1.getKind(), IResourceDelta.ADDED);
|
recordDuplicateChild(childResource.getFullPath(), childDelta2.getKind(), childDelta1.getKind(), IResourceDelta.ADDED);
|
||||||
} else {
|
} else {
|
||||||
|
@ -278,7 +271,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
for (int i = 0; i < changedChildren.length; ++i) {
|
for (int i = 0; i < changedChildren.length; ++i) {
|
||||||
IResourceDelta childDelta1 = changedChildren[i];
|
IResourceDelta childDelta1 = changedChildren[i];
|
||||||
IResource childResource = childDelta1.getResource();
|
IResource childResource = childDelta1.getResource();
|
||||||
IResourceDelta childDelta2 = (IResourceDelta) h.get(childResource);
|
IResourceDelta childDelta2 = h.get(childResource);
|
||||||
if (childDelta2 != null) {
|
if (childDelta2 != null) {
|
||||||
recordDuplicateChild(childResource.getFullPath(), childDelta2.getKind(), childDelta1.getKind(), IResourceDelta.CHANGED);
|
recordDuplicateChild(childResource.getFullPath(), childDelta2.getKind(), childDelta1.getKind(), IResourceDelta.CHANGED);
|
||||||
} else {
|
} else {
|
||||||
|
@ -292,7 +285,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
for (int i = 0; i < removedChildren.length; ++i) {
|
for (int i = 0; i < removedChildren.length; ++i) {
|
||||||
IResourceDelta childDelta1 = removedChildren[i];
|
IResourceDelta childDelta1 = removedChildren[i];
|
||||||
IResource childResource = childDelta1.getResource();
|
IResource childResource = childDelta1.getResource();
|
||||||
IResourceDelta childDelta2 = (IResourceDelta) h.get(childResource);
|
IResourceDelta childDelta2 = h.get(childResource);
|
||||||
if (childDelta2 != null) {
|
if (childDelta2 != null) {
|
||||||
recordDuplicateChild(childResource.getFullPath(), childDelta2.getKind(), childDelta1.getKind(), IResourceDelta.REMOVED);
|
recordDuplicateChild(childResource.getFullPath(), childDelta2.getKind(), childDelta1.getKind(), IResourceDelta.REMOVED);
|
||||||
} else {
|
} else {
|
||||||
|
@ -306,7 +299,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
for (int i = 0; i < affectedChildren.length; ++i) {
|
for (int i = 0; i < affectedChildren.length; ++i) {
|
||||||
IResourceDelta childDelta1 = affectedChildren[i];
|
IResourceDelta childDelta1 = affectedChildren[i];
|
||||||
IResource childResource = childDelta1.getResource();
|
IResource childResource = childDelta1.getResource();
|
||||||
IResourceDelta childDelta2 = (IResourceDelta) h.remove(childResource);
|
IResourceDelta childDelta2 = h.remove(childResource);
|
||||||
if (childDelta2 == null) {
|
if (childDelta2 == null) {
|
||||||
int kind = childDelta1.getKind();
|
int kind = childDelta1.getKind();
|
||||||
//these kinds should have been added to h earlier
|
//these kinds should have been added to h earlier
|
||||||
|
@ -316,10 +309,10 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Enumeration keys = h.keys();
|
Enumeration<IResource> keys = h.keys();
|
||||||
while (keys.hasMoreElements()) {
|
while (keys.hasMoreElements()) {
|
||||||
IResource childResource = (IResource) keys.nextElement();
|
IResource childResource = keys.nextElement();
|
||||||
IResourceDelta childDelta = (IResourceDelta) h.get(childResource);
|
IResourceDelta childDelta = h.get(childResource);
|
||||||
recordMissingChild(childResource.getFullPath(), childDelta.getKind(), true);
|
recordMissingChild(childResource.getFullPath(), childDelta.getKind(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,8 +322,8 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
|
|
||||||
keys = h.keys();
|
keys = h.keys();
|
||||||
while (keys.hasMoreElements()) {
|
while (keys.hasMoreElements()) {
|
||||||
IResource childResource = (IResource) keys.nextElement();
|
IResource childResource = keys.nextElement();
|
||||||
IResourceDelta childDelta = (IResourceDelta) h.get(childResource);
|
IResourceDelta childDelta = h.get(childResource);
|
||||||
internalVerifyDelta(childDelta);
|
internalVerifyDelta(childDelta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -352,7 +345,7 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpectedChange expectedChange = (ExpectedChange) fExpectedChanges.get(resource.getFullPath());
|
ExpectedChange expectedChange = fExpectedChanges.get(resource.getFullPath());
|
||||||
|
|
||||||
if (expectedChange != null) {
|
if (expectedChange != null) {
|
||||||
IPath expectedMovedFromPath = expectedChange.getMovedFromPath();
|
IPath expectedMovedFromPath = expectedChange.getMovedFromPath();
|
||||||
|
@ -460,23 +453,23 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
* are met after iterating over a resource delta.
|
* are met after iterating over a resource delta.
|
||||||
*/
|
*/
|
||||||
private void finishVerification() {
|
private void finishVerification() {
|
||||||
Hashtable resourcePaths = new Hashtable();
|
Hashtable<IPath, IPath> resourcePaths = new Hashtable<IPath, IPath>();
|
||||||
|
|
||||||
Enumeration keys = fExpectedChanges.keys();
|
Enumeration<IPath> keys = fExpectedChanges.keys();
|
||||||
while (keys.hasMoreElements()) {
|
while (keys.hasMoreElements()) {
|
||||||
Object key = keys.nextElement();
|
IPath key = keys.nextElement();
|
||||||
resourcePaths.put(key, key);
|
resourcePaths.put(key, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
keys = resourcePaths.keys();
|
keys = resourcePaths.keys();
|
||||||
while (keys.hasMoreElements()) {
|
while (keys.hasMoreElements()) {
|
||||||
IPath resourcePath = (IPath) keys.nextElement();
|
IPath resourcePath = keys.nextElement();
|
||||||
|
|
||||||
fMessage.append("Checking expectations for ");
|
fMessage.append("Checking expectations for ");
|
||||||
fMessage.append(resourcePath);
|
fMessage.append(resourcePath);
|
||||||
fMessage.append("\n");
|
fMessage.append("\n");
|
||||||
|
|
||||||
ExpectedChange expectedChange = (ExpectedChange) fExpectedChanges.remove(resourcePath);
|
ExpectedChange expectedChange = fExpectedChanges.remove(resourcePath);
|
||||||
if (expectedChange != null) {
|
if (expectedChange != null) {
|
||||||
// List an ignored resource
|
// List an ignored resource
|
||||||
if (fIgnoreResources.contains(expectedChange.fResource))
|
if (fIgnoreResources.contains(expectedChange.fResource))
|
||||||
|
@ -825,7 +818,6 @@ public class ResourceDeltaVerifier extends Assert implements IResourceChangeList
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part of the <code>IResourceChangedListener</code> interface.
|
* Part of the <code>IResourceChangedListener</code> interface.
|
||||||
* @see IResourceChangedListener
|
|
||||||
*/
|
*/
|
||||||
public void resourceChanged(IResourceChangeEvent e) {
|
public void resourceChanged(IResourceChangeEvent e) {
|
||||||
fMessage.append("Resource Changed Delta\n");
|
fMessage.append("Resource Changed Delta\n");
|
||||||
|
|
|
@ -107,7 +107,6 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
int expecectedNumTools = 5;
|
int expecectedNumTools = 5;
|
||||||
int numOrderCCompilerTool = 0;
|
int numOrderCCompilerTool = 0;
|
||||||
int expecectedCNature = ITool.FILTER_C;
|
int expecectedCNature = ITool.FILTER_C;
|
||||||
int expecectedCCNature = ITool.FILTER_CC;
|
|
||||||
|
|
||||||
// Check project attributes
|
// Check project attributes
|
||||||
//
|
//
|
||||||
|
@ -207,7 +206,6 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
String optionEnumCmd1 = option.getEnumCommand(optionDefaultValue);
|
String optionEnumCmd1 = option.getEnumCommand(optionDefaultValue);
|
||||||
assertEquals(optionEnumCmd1, (expectedOptionEnumCmd1arr[iconfig]));
|
assertEquals(optionEnumCmd1, (expectedOptionEnumCmd1arr[iconfig]));
|
||||||
List<String> expectedEnumList1arr = new ArrayList<String>();
|
List<String> expectedEnumList1arr = new ArrayList<String>();
|
||||||
String enumValues[] = option.getApplicableValues();
|
|
||||||
String[] expectedEnumList1Tokens = expectedEnumList1.split(","); //$NON-NLS-1$
|
String[] expectedEnumList1Tokens = expectedEnumList1.split(","); //$NON-NLS-1$
|
||||||
for (i = 0; i < expectedEnumList1Tokens.length; ++i) {
|
for (i = 0; i < expectedEnumList1Tokens.length; ++i) {
|
||||||
expectedEnumList1arr.add(expectedEnumList1Tokens[i].trim());
|
expectedEnumList1arr.add(expectedEnumList1Tokens[i].trim());
|
||||||
|
@ -286,7 +284,6 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
int expecectedNumTools = 5;
|
int expecectedNumTools = 5;
|
||||||
int numOrderCLinkerTool = 2;
|
int numOrderCLinkerTool = 2;
|
||||||
int expecectedCNature = ITool.FILTER_C;
|
int expecectedCNature = ITool.FILTER_C;
|
||||||
int expecectedCCNature = ITool.FILTER_CC;
|
|
||||||
|
|
||||||
// Check project attributes
|
// Check project attributes
|
||||||
//
|
//
|
||||||
|
@ -378,7 +375,6 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
//
|
//
|
||||||
option = tool.getOptionById(OptionId1A);
|
option = tool.getOptionById(OptionId1A);
|
||||||
assertTrue(option.isExtensionElement());
|
assertTrue(option.isExtensionElement());
|
||||||
String optionDefaultValue = (String)option.getDefaultValue();
|
|
||||||
assertEquals(option.getValueType(), (IOption.LIBRARIES));
|
assertEquals(option.getValueType(), (IOption.LIBRARIES));
|
||||||
assertEquals(option.getCommand(), (expectedOptionCmd1Aarr));
|
assertEquals(option.getCommand(), (expectedOptionCmd1Aarr));
|
||||||
assertEquals(option.getBrowseType(), (IOption.BROWSE_FILE));
|
assertEquals(option.getBrowseType(), (IOption.BROWSE_FILE));
|
||||||
|
@ -387,7 +383,6 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
//
|
//
|
||||||
option = tool.getOptionById(OptionId1B);
|
option = tool.getOptionById(OptionId1B);
|
||||||
assertTrue(option.isExtensionElement());
|
assertTrue(option.isExtensionElement());
|
||||||
optionDefaultValue = (String)option.getDefaultValue();
|
|
||||||
assertEquals(option.getValueType(), (IOption.STRING_LIST));
|
assertEquals(option.getValueType(), (IOption.STRING_LIST));
|
||||||
assertEquals(option.getCommand(), (expectedOptionCmd1Barr));
|
assertEquals(option.getCommand(), (expectedOptionCmd1Barr));
|
||||||
assertEquals(option.getBrowseType(), (IOption.BROWSE_DIR));
|
assertEquals(option.getBrowseType(), (IOption.BROWSE_DIR));
|
||||||
|
@ -396,7 +391,6 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
//
|
//
|
||||||
option = tool.getOptionById(OptionId1C);
|
option = tool.getOptionById(OptionId1C);
|
||||||
assertTrue(option.isExtensionElement());
|
assertTrue(option.isExtensionElement());
|
||||||
optionDefaultValue = (String)option.getDefaultValue();
|
|
||||||
assertEquals(option.getValueType(), (IOption.OBJECTS));
|
assertEquals(option.getValueType(), (IOption.OBJECTS));
|
||||||
assertEquals(option.getBrowseType(), (IOption.BROWSE_FILE));
|
assertEquals(option.getBrowseType(), (IOption.BROWSE_FILE));
|
||||||
|
|
||||||
|
@ -480,7 +474,6 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
boolean expectedOptionIdValue3 = false;
|
boolean expectedOptionIdValue3 = false;
|
||||||
int expecectedNumTools = 4;
|
int expecectedNumTools = 4;
|
||||||
int numOrderCppCompilerTool = 1;
|
int numOrderCppCompilerTool = 1;
|
||||||
int expecectedCNature = ITool.FILTER_C;
|
|
||||||
int expecectedCCNature = ITool.FILTER_CC;
|
int expecectedCCNature = ITool.FILTER_CC;
|
||||||
|
|
||||||
// Check project attributes
|
// Check project attributes
|
||||||
|
@ -580,7 +573,6 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
assertEquals(optionEnumCmd1, (expectedOptionEnumCmd1arr[iconfig]));
|
assertEquals(optionEnumCmd1, (expectedOptionEnumCmd1arr[iconfig]));
|
||||||
|
|
||||||
List<String> expectedEnumList1arr = new ArrayList<String>();
|
List<String> expectedEnumList1arr = new ArrayList<String>();
|
||||||
String enumValues[] = option.getApplicableValues();
|
|
||||||
String[] expectedEnumList1Tokens = expectedEnumList1.split(","); //$NON-NLS-1$
|
String[] expectedEnumList1Tokens = expectedEnumList1.split(","); //$NON-NLS-1$
|
||||||
for (i = 0; i < expectedEnumList1Tokens.length; ++i) {
|
for (i = 0; i < expectedEnumList1Tokens.length; ++i) {
|
||||||
expectedEnumList1arr.add(expectedEnumList1Tokens[i].trim());
|
expectedEnumList1arr.add(expectedEnumList1Tokens[i].trim());
|
||||||
|
|
|
@ -28,28 +28,28 @@ import org.eclipse.core.resources.IWorkspace;
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
public class ManagedBuildEnvironmentTests extends TestCase {
|
public class ManagedBuildEnvironmentTests extends TestCase {
|
||||||
final private String REQUIRED_TYPE = "cdt.managedbuild.target.testgnu.exe"; //$NON-NLS-1$
|
// final private String REQUIRED_TYPE = "cdt.managedbuild.target.testgnu.exe"; //$NON-NLS-1$
|
||||||
// test variable names
|
// test variable names
|
||||||
final private String NAME_CWD = "CWD"; //$NON-NLS-1$
|
final private String NAME_CWD = "CWD"; //$NON-NLS-1$
|
||||||
final private String NAME_PWD = "PWD"; //$NON-NLS-1$
|
final private String NAME_PWD = "PWD"; //$NON-NLS-1$
|
||||||
final private String NAME_CMN = "COMMON"; //$NON-NLS-1$
|
// final private String NAME_CMN = "COMMON"; //$NON-NLS-1$
|
||||||
final private String NAME_WSP = "WSP"; //$NON-NLS-1$
|
// final private String NAME_WSP = "WSP"; //$NON-NLS-1$
|
||||||
final private String NAME_PRJI = "PRJI"; //$NON-NLS-1$
|
// final private String NAME_PRJI = "PRJI"; //$NON-NLS-1$
|
||||||
final private String NAME_PRJL = "PRJL"; //$NON-NLS-1$
|
// final private String NAME_PRJL = "PRJL"; //$NON-NLS-1$
|
||||||
final private String NAME_CFGI = "CFGI"; //$NON-NLS-1$
|
// final private String NAME_CFGI = "CFGI"; //$NON-NLS-1$
|
||||||
final private String NAME_CFGL = "CFGL"; //$NON-NLS-1$
|
// final private String NAME_CFGL = "CFGL"; //$NON-NLS-1$
|
||||||
final private String NAME_CFGX = "CFGX"; //$NON-NLS-1$
|
// final private String NAME_CFGX = "CFGX"; //$NON-NLS-1$
|
||||||
final private String NAME_CFG = "CFG"; //$NON-NLS-1$
|
// final private String NAME_CFG = "CFG"; //$NON-NLS-1$
|
||||||
final private String NAME_REM1 = "REMTST1";//$NON-NLS-1$
|
// final private String NAME_REM1 = "REMTST1";//$NON-NLS-1$
|
||||||
final private String NAME_REM2 = "REMTST2";//$NON-NLS-1$
|
// final private String NAME_REM2 = "REMTST2";//$NON-NLS-1$
|
||||||
// test variable values
|
// test variable values
|
||||||
final private String VAL_CWDPWD = "CWD_&_PWD_should not be changed"; //$NON-NLS-1$
|
final private String VAL_CWDPWD = "CWD_&_PWD_should not be changed"; //$NON-NLS-1$
|
||||||
final private String VAL_DUMMY1 = "/a/b/c"; //$NON-NLS-1$
|
// final private String VAL_DUMMY1 = "/a/b/c"; //$NON-NLS-1$
|
||||||
final private String VAL_DUMMY2 = "/d/e/f"; //$NON-NLS-1$
|
// final private String VAL_DUMMY2 = "/d/e/f"; //$NON-NLS-1$
|
||||||
final private String VAL_PRO_INC = "/project/inc"; //$NON-NLS-1$
|
final private String VAL_PRO_INC = "/project/inc"; //$NON-NLS-1$
|
||||||
final private String VAL_PRO_LIB = "/project/lib"; //$NON-NLS-1$
|
final private String VAL_PRO_LIB = "/project/lib"; //$NON-NLS-1$
|
||||||
|
|
||||||
final private String LISTENER_DATA = "O1T1O1O2T2T1O1T1O2T2"; //$NON-NLS-1$
|
// final private String LISTENER_DATA = "O1T1O1O2T2T1O1T1O2T2"; //$NON-NLS-1$
|
||||||
|
|
||||||
// delimiters
|
// delimiters
|
||||||
final private String DEL_WIN = ";"; //$NON-NLS-1$
|
final private String DEL_WIN = ";"; //$NON-NLS-1$
|
||||||
|
@ -534,41 +534,41 @@ public class ManagedBuildEnvironmentTests extends TestCase {
|
||||||
/*
|
/*
|
||||||
* Print contents of env.var array, with given header.
|
* Print contents of env.var array, with given header.
|
||||||
*/
|
*/
|
||||||
private void printVar(String head, IBuildEnvironmentVariable[] vars) {
|
// private void printVar(String head, IBuildEnvironmentVariable[] vars) {
|
||||||
if (vars != null) {
|
// if (vars != null) {
|
||||||
if (vars.length > 0) {
|
// if (vars.length > 0) {
|
||||||
for (int i=0; i < vars.length; i++) {
|
// for (int i=0; i < vars.length; i++) {
|
||||||
System.out.println(head + "[" + i + "] " + //$NON-NLS-1$ //$NON-NLS-2$
|
// System.out.println(head + "[" + i + "] " + //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
vars[i].getName() + " = " + //$NON-NLS-1$
|
// vars[i].getName() + " = " + //$NON-NLS-1$
|
||||||
vars[i].getValue() + " / " + //$NON-NLS-1$
|
// vars[i].getValue() + " / " + //$NON-NLS-1$
|
||||||
vars[i].getOperation() + vars[i].getDelimiter());
|
// vars[i].getOperation() + vars[i].getDelimiter());
|
||||||
}
|
// }
|
||||||
} else { System.out.println(head + ": array is empty"); } //$NON-NLS-1$
|
// } else { System.out.println(head + ": array is empty"); } //$NON-NLS-1$
|
||||||
} else { System.out.println(head + ": array is null"); } //$NON-NLS-1$
|
// } else { System.out.println(head + ": array is null"); } //$NON-NLS-1$
|
||||||
}
|
// }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* check that ALL variables from list "a" have correspondence
|
* check that ALL variables from list "a" have correspondence
|
||||||
* in list "b"
|
* in list "b"
|
||||||
* empty list or null are treated as corresponding to anything
|
* empty list or null are treated as corresponding to anything
|
||||||
*/
|
*/
|
||||||
private boolean varListContainNames(IBuildEnvironmentVariable[] a, IBuildEnvironmentVariable[] b) {
|
// private boolean varListContainNames(IBuildEnvironmentVariable[] a, IBuildEnvironmentVariable[] b) {
|
||||||
if (a == null) return true;
|
// if (a == null) return true;
|
||||||
else if (a.length == 0) return true;
|
// else if (a.length == 0) return true;
|
||||||
else if (b == null) return false;
|
// else if (b == null) return false;
|
||||||
|
//
|
||||||
for (int i=0; i<a.length; i++) {
|
// for (int i=0; i<a.length; i++) {
|
||||||
boolean found = false;
|
// boolean found = false;
|
||||||
for (int j=0; j<b.length; j++) {
|
// for (int j=0; j<b.length; j++) {
|
||||||
if (a[i].getName().equals(b[j].getName())) {
|
// if (a[i].getName().equals(b[j].getName())) {
|
||||||
found = true;
|
// found = true;
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (!found) return false;
|
// if (!found) return false;
|
||||||
}
|
// }
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue