mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Represent TU by its file name instead of content.
This commit is contained in:
parent
361aa35205
commit
470b57572c
1 changed files with 9 additions and 6 deletions
|
@ -30,6 +30,7 @@ import org.eclipse.cdt.core.parser.tests.rewrite.TestSourceFile;
|
|||
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.ASTCommenter;
|
||||
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
/**
|
||||
* This test tests the behavior of the class ASTCommenter. It checks if the ASTCommenter assigns
|
||||
|
@ -158,15 +159,17 @@ public class CommentHandlingTest extends RewriteBaseTest {
|
|||
return output.toString().trim();
|
||||
}
|
||||
|
||||
private String getSignature(IASTNode actNode) {
|
||||
if (actNode instanceof IASTCompositeTypeSpecifier) {
|
||||
IASTCompositeTypeSpecifier comp = (IASTCompositeTypeSpecifier) actNode;
|
||||
private String getSignature(IASTNode node) {
|
||||
if (node instanceof IASTCompositeTypeSpecifier) {
|
||||
IASTCompositeTypeSpecifier comp = (IASTCompositeTypeSpecifier) node;
|
||||
return comp.getName().toString();
|
||||
} else if (actNode instanceof IASTEnumerationSpecifier) {
|
||||
IASTEnumerationSpecifier comp = (IASTEnumerationSpecifier) actNode;
|
||||
} else if (node instanceof IASTEnumerationSpecifier) {
|
||||
IASTEnumerationSpecifier comp = (IASTEnumerationSpecifier) node;
|
||||
return comp.getName().toString();
|
||||
} else if (node instanceof IASTTranslationUnit) {
|
||||
return Path.fromOSString(node.getFileLocation().getFileName()).lastSegment();
|
||||
}
|
||||
return actNode.getRawSignature();
|
||||
return node.getRawSignature();
|
||||
}
|
||||
|
||||
private static String getSeparatingRegexp() {
|
||||
|
|
Loading…
Add table
Reference in a new issue