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/base64.c b/library/base64.c
index 16c254d..d599a0f 100644
--- a/library/base64.c
+++ b/library/base64.c
@@ -251,12 +251,12 @@
if( mbedtls_base64_encode( buffer, sizeof( buffer ), &len, src, 64 ) != 0 ||
memcmp( base64_test_enc, buffer, 88 ) != 0 )
- {
+ { // LCOV_EXCL_START
if( verbose != 0 )
mbedtls_printf( "failed\n" );
return( 1 );
- }
+ } // LCOV_EXCL_STOP
if( verbose != 0 )
mbedtls_printf( "passed\n Base64 decoding test: " );
@@ -265,12 +265,12 @@
if( mbedtls_base64_decode( buffer, sizeof( buffer ), &len, src, 88 ) != 0 ||
memcmp( base64_test_dec, buffer, 64 ) != 0 )
- {
+ { // LCOV_EXCL_START
if( verbose != 0 )
mbedtls_printf( "failed\n" );
return( 1 );
- }
+ } // LCOV_EXCL_STOP
if( verbose != 0 )
mbedtls_printf( "passed\n\n" );