Xcode code coverage incorrectly reports unreachable code
| Originator: | keithbsmiley | ||
| Number: | rdar://23224011 | Date Originated: | 22-Oct-2015 01:26 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 7.1 |
| Classification: | UI/Usability | Reproducible: | Always |
Summary: Xcode code coverage reports that the last line of a function hasn't been hit when it is impossible to reach because of an else statement above. Steps to reproduce: 1. Create a function that contains an if/else statement 2. Return from both halves of the if statement 3. Write tests that hit each half of the if 4. View the code coverage OR: 1. Run the tests in the example project 2. View the code coverage Expected results: Code coverage should be 100% Actual results: Code coverage reports that you're missing the last line of your function, which is unreachable. Notes: See coverage.png for the incorrect reporting.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
https://github.com/keith/radars/tree/master/CodeCoverageIfBug