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/hmac_drbg.c b/library/hmac_drbg.c
index bf5f9b5..2961750 100644
--- a/library/hmac_drbg.c
+++ b/library/hmac_drbg.c
@@ -355,10 +355,10 @@
goto exit;
if( fwrite( buf, 1, sizeof( buf ), f ) != sizeof( buf ) )
- {
+ { // LCOV_EXCL_START
ret = MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR;
goto exit;
- }
+ } // LCOV_EXCL_STOP
ret = 0;
@@ -387,10 +387,10 @@
}
if( fread( buf, 1, n, f ) != n )
- {
+ { // LCOV_EXCL_START
fclose( f );
return( MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR );
- }
+ } // LCOV_EXCL_STOP
fclose( f );