From 470b57572c189268691b965e68c3d2dbcf910822 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 26 Feb 2013 17:39:12 -0800 Subject: [PATCH] Represent TU by its file name instead of content. --- .../comenthandler/CommentHandlingTest.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/comenthandler/CommentHandlingTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/comenthandler/CommentHandlingTest.java index cda751ea9f3..2846fdcb38c 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/comenthandler/CommentHandlingTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/comenthandler/CommentHandlingTest.java @@ -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() {