So in my PR, I added a specific unit test testDeinit() for testing deinit();
I can confirm that the deinit() diff has been 100% tested, I can see breakpoints hit as well as test logs showing the missing covered code is run.
You can see the log here:https://github.com/liuxuan30/TelloSwift/pull/5/checks?check_run_id=361723920
Search “Detect timer in use yet invalidated”, and it will guide you to the specific test log
You can see the test log shows:
[TELLO-FREE-] [TELLO-DESTROYED-] [TELLO-FREE-] [TELLO-FREE-] MUST CALL shutdown() first, trying to close the channel only, event group may escape [TELLO-FREE-] [TELLO-FREE-] Detect timer in use yet invalidated [TELLO-FREE-] MUST CALL shutdown() first, trying to close the channel only, event group may escape
which means, all the if condition in deinit() is hit, so it should be 100% covered.
To be clear,
TelloSwift.swift line 82 - 83, 86-89 should be hit, not missing.
I’m not sure why codecov would think it’s not covered, while it has been tested.
Description of the issue
Steps to Reproduce
Run the test testDeinit(), make sure deinit() is tested
check codecov report, it says deinit diff is not covered in full.
Expected behavior: [What you expect to happen]
deinit() diff should be 100% covered.
Actual behavior: [What actually happens]
deinit() diff is not covered