mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 21:05:37 +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.ASTCommenter;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
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
|
* 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();
|
return output.toString().trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSignature(IASTNode actNode) {
|
private String getSignature(IASTNode node) {
|
||||||
if (actNode instanceof IASTCompositeTypeSpecifier) {
|
if (node instanceof IASTCompositeTypeSpecifier) {
|
||||||
IASTCompositeTypeSpecifier comp = (IASTCompositeTypeSpecifier) actNode;
|
IASTCompositeTypeSpecifier comp = (IASTCompositeTypeSpecifier) node;
|
||||||
return comp.getName().toString();
|
return comp.getName().toString();
|
||||||
} else if (actNode instanceof IASTEnumerationSpecifier) {
|
} else if (node instanceof IASTEnumerationSpecifier) {
|
||||||
IASTEnumerationSpecifier comp = (IASTEnumerationSpecifier) actNode;
|
IASTEnumerationSpecifier comp = (IASTEnumerationSpecifier) node;
|
||||||
return comp.getName().toString();
|
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() {
|
private static String getSeparatingRegexp() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue