An even worse problem is that it seems that the line counts before @throw in the same condition block are also closed. Therefore, simply writing the code before @throw as a marker will not help solve the problem.
However, I found that conditions, including variables ("if (YES)", "if (1 == 1)" not in cases, "are always lockable. Thus, the difficult thing we could do is first define a trivial condition variable, and then add a condition test, including this variable before @throw.
static BOOL __trivialYES = YES; //for cover @throw, and never use 'const'
then
if(__trivialYES) @throw ...;
This should help solve the problem, and for your convenience, you can define your own macro to do this.
#define #throw if (__trivialYES)
and then the throw statement:
and this is likely to make the coverage test more effective.
PS: "#throw" is just a macro example. This is the same as another macro. "#" is just a valid character (for some precompilers) that makes it special.
source share