more refactoring. didn't really get anywhere, but everything still works

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1045 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2002-10-02 20:22:10 +00:00
parent 8b51e7b5cd
commit defd29aead

View File

@ -37,63 +37,4 @@ public class SymbolTableTest extends TestCase {
s.add(scope);
assertEquals(scope, s.get(0));
}
/*
public void testAdd() {
SymbolTable s = new SymbolTable();
s.addDeclaration(NameDeclarationTest.FOO);
try {
s.addDeclaration(NameDeclarationTest.FOO);
} catch (RuntimeException e) {
return; // cool
}
throw new RuntimeException("Should have thrown RuntimeException");
}
public void testParentContains() {
SymbolTable table = new SymbolTable();
table.openScope(new LocalScope());
table.addDeclaration(new NameDeclaration(NameDeclarationTest.createNode("bar", 12), Kind.UNKNOWN));
table.addDeclaration(new NameDeclaration(NameDeclarationTest.createNode("baz", 12), Kind.UNKNOWN));
assertTrue(table.getUnusedNameDeclarations().hasNext());
table.leaveScope();
assertTrue(!table.getUnusedNameDeclarations().hasNext());
}
public void testRecordUsage() {
SymbolTable s = new SymbolTable();
s.addDeclaration(NameDeclarationTest.FOO);
assertTrue(s.getUnusedNameDeclarations().hasNext());
s.lookup(new NameOccurrence(NameDeclarationTest.FOO_NODE));
assertTrue(!s.getUnusedNameDeclarations().hasNext());
}
public void testRecordOccurrence() {
SymbolTable table = new SymbolTable();
table.openScope(new LocalScope());
table.lookup(new NameOccurrence(NameDeclarationTest.FOO_NODE));
assertTrue(!table.getUnusedNameDeclarations().hasNext());
}
public void testRecordOccurrence2() {
SymbolTable s = new SymbolTable();
s.lookup(new NameOccurrence(NameDeclarationTest.FOO_NODE));
assertTrue(!s.getUnusedNameDeclarations().hasNext());
}
public void testRecordUsageParent() {
SymbolTable parent = new SymbolTable();
parent.addDeclaration(NameDeclarationTest.FOO);
parent.openScope(new LocalScope());
parent.leaveScope();
assertEquals(NameDeclarationTest.FOO, parent.getUnusedNameDeclarations().next());
}
public void testRecordUsageParent2() {
SymbolTable parent = new SymbolTable();
parent.addDeclaration(NameDeclarationTest.FOO);
parent.openScope(new LocalScope());
parent.lookup(new NameOccurrence(NameDeclarationTest.FOO_NODE));
assertTrue(!parent.getUnusedNameDeclarations().hasNext());
}
*/
}