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/x509_create.c b/library/x509_create.c
index 3b773c0..dc0c40a 100644
--- a/library/x509_create.c
+++ b/library/x509_create.c
@@ -131,7 +131,7 @@
(unsigned char *) data,
d - data ) == NULL )
{
- return( MBEDTLS_ERR_X509_ALLOC_FAILED );
+ return( MBEDTLS_ERR_X509_ALLOC_FAILED ); // LCOV_EXCL_LINE
}
while( c < end && *(c + 1) == ' ' )
@@ -171,7 +171,7 @@
if( ( cur = mbedtls_asn1_store_named_data( head, oid, oid_len,
NULL, val_len + 1 ) ) == NULL )
{
- return( MBEDTLS_ERR_X509_ALLOC_FAILED );
+ return( MBEDTLS_ERR_X509_ALLOC_FAILED ); // LCOV_EXCL_LINE
}
cur->val.p[0] = critical;