1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Remove warnings from the core test plugin

This commit is contained in:
David Daoust 2006-07-06 17:59:13 +00:00
parent 7706ce1070
commit c0faa8cedc
14 changed files with 27 additions and 28 deletions

View file

@ -32,7 +32,6 @@ import org.eclipse.cdt.core.model.IInclude;
import org.eclipse.cdt.core.model.IMacro;
import org.eclipse.cdt.core.model.IMethod;
import org.eclipse.cdt.core.model.IMethodDeclaration;
import org.eclipse.cdt.core.model.IMethodTemplate;
import org.eclipse.cdt.core.model.IMethodTemplateDeclaration;
import org.eclipse.cdt.core.model.INamespace;
import org.eclipse.cdt.core.model.IParent;

View file

@ -28,7 +28,7 @@ import org.eclipse.core.runtime.CoreException;
*/
public class CModelExceptionTest extends TestCase {
// Shared values setup and torn down
private Throwable throwableException;
// private Throwable throwableException;
private CModelStatus cModelStatus;
private CoreException coreException;

View file

@ -18,6 +18,7 @@ import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.testplugin.CProjectHelper;
@ -124,7 +125,7 @@ public class CModelTests extends TestCase {
assertTrue("hasCCNature works", (CoreModel.hasCCNature(testProject.getProject())));
CCProjectNature.removeCCNature(testProject.getProject(), monitor);
CCProjectNature.removeCNature(testProject.getProject(), monitor);
CProjectNature.removeCNature(testProject.getProject(), monitor);
assertTrue("hasCNature works without cnature", !CoreModel.hasCNature(testProject.getProject()));
assertTrue("hasCCNature works without ccnature or cnature", !(CoreModel.hasCCNature(testProject.getProject())));
try{

View file

@ -15,6 +15,7 @@
package org.eclipse.cdt.core.model.tests;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IMacro;
import junit.framework.Test;
import junit.framework.TestSuite;
@ -66,7 +67,7 @@ public class IMacroTests extends IntegratedCModelTest {
public void testGetElementName() throws CModelException {
ITranslationUnit tu = getTU();
List arrayElements = tu.getChildrenOfType( ITranslationUnit.C_MACRO );
List arrayElements = tu.getChildrenOfType( ICElement.C_MACRO );
String expectedList[] = new String[] {
"SINGLETON",
@ -83,7 +84,7 @@ public class IMacroTests extends IntegratedCModelTest {
public void testGetIdentifierList() throws CModelException {
ITranslationUnit tu = getTU();
List arrayElements = tu.getChildrenOfType( ITranslationUnit.C_MACRO );
List arrayElements = tu.getChildrenOfType( ICElement.C_MACRO );
String expectedList[] = new String[] {
"",
@ -100,7 +101,7 @@ public class IMacroTests extends IntegratedCModelTest {
public void testGetTokenSequence() throws CModelException {
ITranslationUnit tu = getTU();
List arrayElements = tu.getChildrenOfType( ITranslationUnit.C_MACRO );
List arrayElements = tu.getChildrenOfType( ICElement.C_MACRO );
String expectedList[] = new String[] {
"",

View file

@ -77,14 +77,14 @@ public abstract class AutomatedFramework extends TestCase {
filePath.endsWith(".C") || //$NON-NLS-1$
filePath.endsWith(".hxx") || filePath.endsWith(".hh") ) //$NON-NLS-1$ //$NON-NLS-2$
{
AutomatedTest.natures.put( filePath, "cpp" ); //$NON-NLS-1$
AutomatedFramework.natures.put( filePath, "cpp" ); //$NON-NLS-1$
} else if( filePath.endsWith(".c") ){ //$NON-NLS-1$
AutomatedTest.natures.put( filePath, "c" ); //$NON-NLS-1$
AutomatedFramework.natures.put( filePath, "c" ); //$NON-NLS-1$
} else {
AutomatedTest.natures.put( filePath, AutomatedTest.defaultNature );
AutomatedFramework.natures.put( filePath, AutomatedFramework.defaultNature );
}
AutomatedTest.fileList.add( file );
AutomatedFramework.fileList.add( file );
suite.addTest( newTest( file.getName().replace(',', '_') ) );
}
file = files[ i++ ];

View file

@ -74,18 +74,18 @@ public class CompleteParseASTSymbolIteratorTest extends CompleteParseBaseTest {
}
}
protected CompilationUnitCallback callback;
protected CompilationUnitCallback localCallback;
protected IASTScope parse(String code, boolean throwOnError, ParserLanguage language) throws ParserException, ParserFactoryError
{
callback = new CompilationUnitCallback();
localCallback = new CompilationUnitCallback();
IParser parser = ParserFactory.createParser(
ParserFactory.createScanner( new CodeReader(code.toCharArray()), new ScannerInfo(),
ParserMode.COMPLETE_PARSE, language, callback, new NullLogService(), null ), callback, ParserMode.COMPLETE_PARSE, language, null
ParserMode.COMPLETE_PARSE, language, localCallback, new NullLogService(), null ), localCallback, ParserMode.COMPLETE_PARSE, language, null
);
if( ! parser.parse() && throwOnError ) throw new ParserException( "FAILURE"); //$NON-NLS-1$
return callback.getCompilationUnit();
return localCallback.getCompilationUnit();
}
protected Iterator getDeclarations(IASTScope scope)

View file

@ -916,7 +916,7 @@ public class CompleteParseASTTemplateTest extends CompleteParseBaseTest {
IASTTemplateDeclaration spec2 = (IASTTemplateDeclaration) i.next();
IASTMethod f1 = (IASTMethod) spec1.getOwnedDeclaration();
IASTMethod f2 = (IASTMethod) spec2.getOwnedDeclaration();;
IASTMethod f2 = (IASTMethod) spec2.getOwnedDeclaration();
IASTFunction main = (IASTFunction) i.next();
assertFalse( i.hasNext() );

View file

@ -21,7 +21,6 @@ import org.eclipse.cdt.core.parser.ast.ASTClassKind;
import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
import org.eclipse.cdt.core.parser.ast.ASTUtil;
import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTClassReference;
@ -2228,7 +2227,7 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
Writer writer = new StringWriter();
writer.write( "class Thrown { };\n"); //$NON-NLS-1$
writer.write( "void foo() throw( Thrown );"); //$NON-NLS-1$
Iterator i = (Iterator) parse( writer.toString() ).getDeclarations();
Iterator i = parse( writer.toString() ).getDeclarations();
assertTrue( i.next() instanceof IASTAbstractTypeSpecifierDeclaration );
IASTFunction foo = (IASTFunction) i.next();
assertFalse( i.hasNext() );
@ -2344,7 +2343,7 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
IASTFunction foo = (IASTFunction) i.next();
Iterator parms = foo.getParameters();
IASTParameterDeclaration blank = (IASTParameterDeclaration)parms.next();
assertEquals( ASTUtil.getType( (IASTAbstractDeclaration)blank ), "volatile int&" ); //$NON-NLS-1$
assertEquals( ASTUtil.getType( blank ), "volatile int&" ); //$NON-NLS-1$
}

View file

@ -113,7 +113,7 @@ public class ScannerParserLoopTest extends FileBasePluginTest {
private static class TimeoutCallback extends NullSourceElementRequestor
implements ISourceElementRequestor {
private IParser parser;
private boolean timerStarted = false;
// private boolean timerStarted = false;
public void setParser(IParser parser) {
this.parser = parser;

View file

@ -238,7 +238,7 @@ public class TortureTest extends FractionalAutomatedTest {
if (isExpectedToPass(testCode, file)) {
ParseThread thread = new ParseThread();
thread.quickParse = quickParse;
thread.quickParseFlag = quickParse;
thread.code = testCode;
thread.cppNature = nature.equalsIgnoreCase("cpp"); //$NON-NLS-1$
thread.file = filePath;
@ -269,11 +269,11 @@ public class TortureTest extends FractionalAutomatedTest {
public String file;
public Throwable result = null;
public IParser parser = null;
public boolean quickParse = true;
public boolean quickParseFlag = true;
public void run(){
try {
ParserMode parserMode = quickParse ? ParserMode.QUICK_PARSE : ParserMode.COMPLETE_PARSE;
ParserMode parserMode = quickParseFlag ? ParserMode.QUICK_PARSE : ParserMode.COMPLETE_PARSE;
ParserLanguage language = cppNature ? ParserLanguage.CPP : ParserLanguage.C;
parser = ParserFactory.createParser(
ParserFactory.createScanner( new CodeReader( code.toCharArray() ), new ScannerInfo(), parserMode, language, nullCallback, new NullLogService(), null ), nullCallback, parserMode, language, null);

View file

@ -113,13 +113,13 @@ public class XMLDumper {
Method method = null;
try {
method = cls.getMethod(methodName, null);
method = cls.getMethod(methodName, (Class []) null);
} catch (NoSuchMethodException e) {
continue;
}
try {
value = method.invoke(obj, null);
value = method.invoke(obj, (Object []) null);
} catch (Exception e) {
value = e;
}

View file

@ -405,7 +405,7 @@ public static void endSplash() {
public static void main(String argString) throws Exception {
Vector list = new Vector(5);
for (StringTokenizer tokens = new StringTokenizer(argString, " "); tokens.hasMoreElements();)
list.addElement((String) tokens.nextElement());
list.addElement(tokens.nextElement());
main((String[]) list.toArray(new String[list.size()]));
}

View file

@ -53,7 +53,7 @@ public class NewMain extends Main {
public static void main(String argString) throws Exception {
Vector list= new Vector(5);
for (StringTokenizer tokens= new StringTokenizer(argString, " "); tokens.hasMoreElements();)
list.addElement((String) tokens.nextElement());
list.addElement(tokens.nextElement());
main((String[]) list.toArray(new String[list.size()]));
}

View file

@ -53,7 +53,6 @@ public class VerifyDialog extends TitleAreaDialog {
private Label _queryLabel;
Button _yesButton;
private Button _noButton;
private Button _checkList[];
private String _failureText;
@ -84,7 +83,7 @@ public class VerifyDialog extends TitleAreaDialog {
*/
protected void createButtonsForButtonBar(Composite parent) {
_yesButton = createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, true);
_noButton = createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, false);
createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, false);
}
/* (non-Javadoc)
* Method declared on Dialog.