gali8 / Tesseract-OCR-iOS

Tesseract OCR iOS is a Framework for iOS7+, compiled also for armv7s and arm64.
http://www.nexor.it
MIT License
4.22k stars 949 forks source link

Increasing code coverage. Test 8 bit images. #192

Closed ws233 closed 9 years ago

ws233 commented 9 years ago

I will add more here soon. Pls, don't merge yet.

ws233 commented 9 years ago

I've added more tests coverring recognizedPDFForImages function using. But unfortunatelly I don't know how to cover those 'return nil;' lines from that function. Any ideas?

kevincon commented 9 years ago

Hmm, yeah I'm not sure they're reachable given our protections in other places in the code. I would be okay with marking them to be excluded by the testing coverage. It looks like Coveralls supports lcov's line exclusion marker LCOV_EXCL_LINE (https://github.com/eddyxu/cpp-coveralls/blob/a98de58fbe68b9eb77bb299c7236c582215e0fa6/cpp_coveralls/coverage.py#L197). So for example, you could add a comment at the end of the lines like this:

return nil; // LCOV_EXCL_LINE

What do you think?

ws233 commented 9 years ago

Hm... Let me try this.

ws233 commented 9 years ago

I've found an error in our initialization code and the test, which I wrote to cover that code. So I've fixed both in the last commit.

ws233 commented 9 years ago

and // LCOV_EXCL_LINE doesn't work in catch block due to unknown reason.

ws233 commented 9 years ago

Seems I've finished with the code coverage.

kevincon commented 9 years ago

Nice job! :) Ready for me to merge this PR?

ws233 commented 9 years ago

Yes, I am. Could you merge it, pls, and close related ticket?