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

Changed all QNX pr numbers to bugzilla pr numbers.

General code cleanup (removed unused imports/variables, etc)
This commit is contained in:
Peter Graves 2002-09-27 13:46:54 +00:00
parent 36cab0ce7c
commit 0716864d27
12 changed files with 16 additions and 71 deletions

View file

@ -4,8 +4,6 @@ package org.eclipse.cdt.core.model.tests;
* All Rights Reserved.
*/
import org.eclipse.cdt.internal.core.model.TranslationUnit;
import org.eclipse.cdt.testplugin.util.*;
import junit.framework.Test;
import junit.framework.TestSuite;

View file

@ -6,7 +6,6 @@ package org.eclipse.cdt.core.model.tests;
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@ -15,12 +14,8 @@ import junit.framework.TestSuite;
import org.eclipse.cdt.testplugin.*;
import org.eclipse.cdt.testplugin.util.*;
import org.eclipse.cdt.core.model.*;
import org.eclipse.core.internal.runtime.Log;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.internal.core.model.*;
@ -154,7 +149,7 @@ public class ArchiveTests extends TestCase {
} catch (IllegalArgumentException e) {
caught=true;
}
assertTrue("PR:12037 Created an archive with a C file", caught);
assertTrue("PR:23601 Created an archive with a C file", caught);
myArchive=null;
caught=false;
try {
@ -244,7 +239,6 @@ public class ArchiveTests extends TestCase {
ExpectedStrings expBin, expObj[];
String[] myStrings;
int x;
IArchive[] myArchives;
/****

View file

@ -6,7 +6,6 @@ package org.eclipse.cdt.core.model.tests;
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@ -15,12 +14,8 @@ import junit.framework.TestSuite;
import org.eclipse.cdt.testplugin.*;
import org.eclipse.cdt.testplugin.util.*;
import org.eclipse.cdt.core.model.*;
import org.eclipse.core.internal.runtime.Log;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.internal.core.model.*;
@ -198,7 +193,7 @@ public class BinaryTests extends TestCase {
} catch (IllegalArgumentException e) {
caught=true;
}
assertTrue("PR:13037 Created an Binary with a C file", caught);
assertTrue("PR:23601 Created an Binary with a C file", caught);
myBinary=null;
caught=false;
try {
@ -331,12 +326,12 @@ public class BinaryTests extends TestCase {
* Since there is no comment on this function, I have no idea what
* it is ment to do. Once I find out what it's ment to do, I will
* actually write some tests.
* PR13052
* PR23602
*/
assertTrue("Expected 76 Got: " + bigBinary.getData(), bigBinary.getData()==76);
assertTrue("Expected 8, Got: " + littleBinary.getData(), littleBinary.getData()==8);
} else
fail("PR:13052 No docs, can't test");
fail("PR:23602 No docs, can't test");
}
/***
@ -423,13 +418,13 @@ public class BinaryTests extends TestCase {
* Since there is no comment on this function, I have no idea what
* it is ment to do. Once I find out what it's ment to do, I will
* actually write some tests.
* PR13052
* PR23602
*/
assertTrue("Expected 296, Got: " + bigBinary.getText(), bigBinary.getText()==296);
assertTrue("Expected 296, Got: " + littleBinary.getText(), littleBinary.getText()==296);
} else
fail("PR:13052 No docs, can't test");
fail("PR:23602 No docs, can't test");
}
/***

View file

@ -15,9 +15,6 @@ import org.eclipse.cdt.testplugin.*;
import org.eclipse.cdt.core.model.*;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature;
/**
@ -146,7 +143,6 @@ public class CModelTests extends TestCase {
*/
public void testFileType() throws CoreException,FileNotFoundException {
ICProject testProject;
ICFile myfile;
testProject=CProjectHelper.createCProject("filetest", "none");
if (testProject==null)
fail("Unable to create project");

View file

@ -9,12 +9,9 @@ package org.eclipse.cdt.core.model.tests;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.eclipse.cdt.testplugin.*;
import org.eclipse.cdt.core.model.*;
import org.eclipse.cdt.internal.core.model.*;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
/**
* @author Peter Graves
*

View file

@ -6,14 +6,9 @@ package org.eclipse.cdt.core.model.tests;
*/
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Stack;
import junit.framework.TestCase;
@ -21,12 +16,8 @@ import junit.framework.TestSuite;
import org.eclipse.cdt.testplugin.*;
import org.eclipse.cdt.testplugin.util.*;
import org.eclipse.cdt.core.model.*;
import org.eclipse.core.internal.runtime.Log;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.internal.core.model.*;
@ -196,7 +187,7 @@ public class TranslationUnitTests extends TestCase {
} catch (IllegalArgumentException e) {
caught=true;
}
assertTrue("PR:13037 Created an TranslationUnit with a .o file", caught);
assertTrue("PR:23601 Created an TranslationUnit with a .o file", caught);
myTranslationUnit=null;
caught=false;
try {
@ -293,7 +284,7 @@ public class TranslationUnitTests extends TestCase {
expectedString.foundString(elements[x].getElementName());
}
}
assertTrue("PR:13062 " +expectedString.getMissingString(),expectedString.gotAll());
assertTrue("PR:23603 " +expectedString.getMissingString(),expectedString.gotAll());
assertTrue(expectedString.getExtraString(),!expectedString.gotExtra());
}
@ -319,7 +310,7 @@ public class TranslationUnitTests extends TestCase {
}
if (!missing.empty()) {
String output=new String("PR: 13062 Could not get elements: ");
String output=new String("PR:23603 Could not get elements: ");
while (!missing.empty())
output+=missing.pop() + " ";
assertTrue(output, false);
@ -342,7 +333,7 @@ public class TranslationUnitTests extends TestCase {
missing.push(expectedStringList[x]);
else {
if (expectedStringList[x].equals("mystruct_t")) {
assertTrue("PR: 13062 expected:" + expectedStringList[x] + " Got:" + myElement.getElementName(),
assertTrue("PR:23603 expected:" + expectedStringList[x] + " Got:" + myElement.getElementName(),
expectedStringList[x].equals(myElement.getElementName()));
} else {
assertTrue("Expected:" + expectedStringList[x] + " Got:" + myElement.getElementName(),
@ -353,7 +344,7 @@ public class TranslationUnitTests extends TestCase {
}
if (!missing.empty()) {
String output=new String("PR: 13062 Could not get elements: ");
String output=new String("PR: 23603 Could not get elements: ");
while (!missing.empty())
output+=missing.pop() + " ";
assertTrue(output, false);
@ -374,7 +365,7 @@ public class TranslationUnitTests extends TestCase {
if (myInclude==null)
fail("Unable to get include: " + includes[x]);
else
assertTrue("PR:BZ23478 Expected:"+includes[x] +" Got:"+ myInclude.getIncludeName(), includes[x].equals(myInclude.getIncludeName()));
assertTrue("PR:23478 Expected:"+includes[x] +" Got:"+ myInclude.getIncludeName(), includes[x].equals(myInclude.getIncludeName()));
}
@ -388,7 +379,7 @@ public class TranslationUnitTests extends TestCase {
ExpectedStrings myExp= new ExpectedStrings(includes);
int x;
TranslationUnit myTranslationUnit=CProjectHelper.findTranslationUnit(testProject,"exetest.c");
fail("Unable to test because we can't get the name of an include file (PR: BZ23478");
fail("PR:23478 Unable to test because we can't get the name of an include file");
myIncludes=myTranslationUnit.getIncludes();
for (x=0;x<myIncludes.length;x++) {
@ -400,7 +391,4 @@ public class TranslationUnitTests extends TestCase {
}
}

View file

@ -1,11 +1,7 @@
package org.eclipse.cdt.testplugin;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.zip.ZipFile;
import org.eclipse.cdt.core.CCorePlugin;
@ -21,9 +17,7 @@ import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.internal.core.model.ArchiveContainer;
import org.eclipse.cdt.core.model.IArchive;
import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.internal.core.model.CModelManager;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
@ -148,7 +142,6 @@ public class CProjectHelper {
* Attempts to find an archive with the given name in the workspace
*/
public static Archive findArchive(ICProject testProject,String name) {
Archive myArchive;
int x;
IArchive[] myArchives;
ArchiveContainer archCont;
@ -163,7 +156,6 @@ public class CProjectHelper {
myArchives=testProject.getArchiveContainer().getArchives();
if (myArchives.length<1)
return(null);
myArchive=null;
for (x=0;x<myArchives.length;x++) {
if (myArchives[x].getElementName().equals(name))
if (myArchives[x] instanceof Archive) {
@ -179,7 +171,6 @@ public class CProjectHelper {
* Attempts to find a binary with the given name in the workspace
*/
public static Binary findBinary(ICProject testProject,String name) {
Binary myBinary;
BinaryContainer binCont;
int x;
IBinary[] myBinaries;
@ -190,7 +181,6 @@ public class CProjectHelper {
myBinaries=binCont.getBinaries();
if (myBinaries.length<1)
return(null);
myBinary=null;
for (x=0;x<myBinaries.length;x++) {
if (myBinaries[x].getElementName().equals(name))
if (myBinaries[x] instanceof Binary) {
@ -206,13 +196,11 @@ public class CProjectHelper {
* Attempts to find an object with the given name in the workspace
*/
public static Binary findObject(ICProject testProject,String name) {
ICElement myICElement;
int x;
ICElement[] myElements;
myElements=testProject.getChildren();
if (myElements.length<1)
return(null);
myICElement=null;
for (x=0;x<myElements.length;x++) {
if (myElements[x].getElementName().equals(name))
if (myElements[x] instanceof ICElement) {
@ -227,13 +215,11 @@ public class CProjectHelper {
* Attempts to find a TranslationUnit with the given name in the workspace
*/
public static TranslationUnit findTranslationUnit(ICProject testProject,String name) {
ICElement myICElement;
int x;
ICElement[] myElements;
myElements=testProject.getChildren();
if (myElements.length<1)
return(null);
myICElement=null;
for (x=0;x<myElements.length;x++) {
if (myElements[x].getElementName().equals(name))
if (myElements[x] instanceof ICElement) {
@ -251,13 +237,11 @@ public class CProjectHelper {
* Attempts to find an element with the given name in the workspace
*/
public static ICElement findElement(ICProject testProject,String name) {
ICElement myICElement;
int x;
ICElement[] myElements;
myElements=testProject.getChildren();
if (myElements.length<1)
return(null);
myICElement=null;
for (x=0;x<myElements.length;x++) {
if (myElements[x].getElementName().equals(name))
if (myElements[x] instanceof ICElement) {

View file

@ -7,7 +7,6 @@ package org.eclipse.cdt.testplugin;
import junit.extensions.TestSetup;
import junit.framework.Test;
import org.eclipse.core.resources.IWorkspaceRoot;
public class CTestSetup extends TestSetup {

View file

@ -6,7 +6,6 @@ package org.eclipse.cdt.testplugin;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.util.Properties;

View file

@ -11,7 +11,6 @@ import junit.framework.TestSuite;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.testplugin.CProjectHelper;
import org.eclipse.cdt.testplugin.TestPluginLauncher;
import org.eclipse.core.runtime.Path;
public class HelloWorld extends TestCase {

View file

@ -86,7 +86,6 @@ public class ExpectedStrings {
return(missing);
}
public String getExtraString() {
int x;
String extra= new String("Extra elements: ");
while (!extraStrings.empty()) {
extra+=extraStrings.pop();

View file

@ -11,12 +11,9 @@ import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.eclipse.cdt.internal.corext.template.c.ICompilationUnit;
import org.eclipse.cdt.testplugin.TestPluginLauncher;
import org.eclipse.cdt.testplugin.util.DialogCheck;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.preference.IPreferenceNode;
import org.eclipse.jface.preference.PreferenceDialog;