I am trying to create a bunch of unit test cases for my program to get some good code coverage number. Let's suppose that the following is the code that I want to test against.
For those of you who have experience with unit testing, when you test the class A, would you intentionally make the "SomeFunction(...)" fail (if possible) so that your unit test case would cover(test) even the error-handling codes inside of the if(FAILED(hr)) block? I am trying to figure out where should I draw the line between the things I need to test and things that I don't need to test. Thanks!
HRESULT hr = S_OK;
hr = SomeFunction(...);
Log(L"some log message")
...Do some cleanups before exiting the function...