You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dealing with branch coverage, I have seen many instances of code like this:
auto sharedPtr = weakPtr.lock();
if (sharedPtr != nullptr) {
...
}
In 99.9% of cases, sharedPtr != nullptr is always true, which means that our branch coverage can never be 100% and that is completely fine.
However, after a very quick look at the overall codebase, I could see that there are cases where we do NOT check for sharedPtr != nullptr and that is (very) bad practice. So, if anything, we really ought to ensure that our whole codebase always check for sharedPtr != nullptr.
The text was updated successfully, but these errors were encountered:
Dealing with branch coverage, I have seen many instances of code like this:
In 99.9% of cases,
sharedPtr != nullptr
is alwaystrue
, which means that our branch coverage can never be 100% and that is completely fine.However, after a very quick look at the overall codebase, I could see that there are cases where we do NOT check for
sharedPtr != nullptr
and that is (very) bad practice. So, if anything, we really ought to ensure that our whole codebase always check forsharedPtr != nullptr
.The text was updated successfully, but these errors were encountered: