Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324324 - The LR Parser test utility function getCompletionNode gets a wrong offset.
Summary: The LR Parser test utility function getCompletionNode gets a wrong offset.
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 7.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 7.0.1   Edit
Assignee: Chris Recoskie CLA
QA Contact: Mike Kucera CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-02 11:42 EDT by John Liu CLA
Modified: 2010-09-02 15:23 EDT (History)
2 users (show)

See Also:


Attachments
a fix patch applied to org.eclipse.cdt.core.lrparser.tests (932 bytes, text/plain)
2010-09-02 13:38 EDT, John Liu CLA
recoskie: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Liu CLA 2010-09-02 11:42:19 EDT
Build Identifier: 

The test utility function getCompletionNode(String code, ILanguage lang) in the class org.eclipse.cdt.core.lrparser.tests.ParseHelper gets a wrong offset due to a NEWLINE('\n') character appended to the code. 

It works for some test cases when it hits a complete key word, such as a->, since appended '\n' won't affect the completion node result. For example, the test case testNewExpressions_Bug313982a in the class  org.eclipse.cdt.core.lrparser.tests.LRCompletionBasicTest works.

But it will fail some test cases when it needs to find a proposal to an incomplete keyword. For example, the test cases testNewExpressions_Bug313982b and testNewExpressions_Bug313982c in the class  org.eclipse.cdt.core.lrparser.tests.LRCompletionBasicTest will fail to find a right  completion node due to this bug problem.



Reproducible: Always
Comment 1 John Liu CLA 2010-09-02 13:38:23 EDT
Created attachment 178072 [details]
a fix patch applied to org.eclipse.cdt.core.lrparser.tests

The fix will fix the recent CDT build test failures of 6 test cases for testBug313982b and testBug313982c.
Comment 2 Chris Recoskie CLA 2010-09-02 14:46:09 EDT
Applied to cdt_7_0 and HEAD.