mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 00:06:32 +01:00
Add 'exit' label and variable initialization to relevant test suite functions
This commit is contained in:
parent
318d0fe844
commit
bd51b262d1
31 changed files with 235 additions and 28 deletions
|
|
@ -33,6 +33,9 @@ void md_process( )
|
|||
TEST_ASSERT( md_process( &ctx, buf ) == 0 );
|
||||
md_free( &ctx );
|
||||
}
|
||||
|
||||
exit:
|
||||
md_free( &ctx );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
|
|
@ -198,11 +201,13 @@ void md_text_multi( char *text_md_name, char *text_src_string,
|
|||
TEST_ASSERT ( ctx.md_ctx != NULL );
|
||||
TEST_ASSERT ( 0 == md_update( &ctx, src_str, strlen( (char *) src_str ) ) );
|
||||
TEST_ASSERT ( 0 == md_finish( &ctx, output ) );
|
||||
md_free( &ctx );
|
||||
|
||||
hexify( hash_str, output, md_get_size(md_info) );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
|
||||
|
||||
exit:
|
||||
md_free( &ctx );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
|
|
@ -236,11 +241,13 @@ void md_hex_multi( char *text_md_name, char *hex_src_string,
|
|||
TEST_ASSERT ( ctx.md_ctx != NULL );
|
||||
TEST_ASSERT ( 0 == md_update( &ctx, src_str, src_len ) );
|
||||
TEST_ASSERT ( 0 == md_finish( &ctx, output ) );
|
||||
md_free( &ctx );
|
||||
|
||||
hexify( hash_str, output, md_get_size(md_info) );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
|
||||
|
||||
exit:
|
||||
md_free( &ctx );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
|
|
@ -320,10 +327,12 @@ void md_hmac_multi( char *text_md_name, int trunc_size, char *hex_key_string,
|
|||
TEST_ASSERT ( 0 == md_hmac_reset( &ctx ) );
|
||||
TEST_ASSERT ( 0 == md_hmac_update( &ctx, src_str, src_len ) );
|
||||
TEST_ASSERT ( 0 == md_hmac_finish( &ctx, output ) );
|
||||
md_free( &ctx );
|
||||
|
||||
hexify( hash_str, output, md_get_size(md_info) );
|
||||
TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
|
||||
|
||||
exit:
|
||||
md_free( &ctx );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue