Exclude a few lines from lcov coverage stats:
- "fail" branches in selftests
- "should never happen" errors in SSL
- cipher_xxx() failures in SSL
- some things that fail only if malloc() fails
- some things that fail only if fread/fwrite()/ftell() fails
(after fopen() succeeded)
- some things that fail only if a parameter is invalid, but the parameter was
actually validated earlier
- generated code in library/error.c
diff --git a/library/pk.c b/library/pk.c
index 10bd0a5..eddcdd7 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -104,7 +104,7 @@
return( MBEDTLS_ERR_PK_BAD_INPUT_DATA );
if( ( ctx->pk_ctx = info->ctx_alloc_func() ) == NULL )
- return( MBEDTLS_ERR_PK_ALLOC_FAILED );
+ return( MBEDTLS_ERR_PK_ALLOC_FAILED ); // LCOV_EXCL_LINE;
ctx->pk_info = info;
@@ -127,7 +127,7 @@
return( MBEDTLS_ERR_PK_BAD_INPUT_DATA );
if( ( ctx->pk_ctx = info->ctx_alloc_func() ) == NULL )
- return( MBEDTLS_ERR_PK_ALLOC_FAILED );
+ return( MBEDTLS_ERR_PK_ALLOC_FAILED ); // LCOV_EXCL_LINE
ctx->pk_info = info;