Fix style issues in test_suite_md.function
diff --git a/tests/suites/test_suite_md.function b/tests/suites/test_suite_md.function
index 6c34984..5c453e4 100644
--- a/tests/suites/test_suite_md.function
+++ b/tests/suites/test_suite_md.function
@@ -134,18 +134,18 @@
unsigned char output[100];
const mbedtls_md_info_t *md_info = NULL;
- memset(md_name, 0x00, 100);
- memset(src_str, 0x00, 1000);
- memset(hash_str, 0x00, 1000);
- memset(output, 0x00, 100);
+ memset( md_name, 0x00, 100 );
+ memset( src_str, 0x00, 1000 );
+ memset( hash_str, 0x00, 1000 );
+ memset( output, 0x00, 100 );
- strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
- strncpy( (char *) md_name, text_md_name, sizeof(md_name) - 1 );
+ strncpy( (char *) src_str, text_src_string, sizeof( src_str ) - 1 );
+ strncpy( (char *) md_name, text_md_name, sizeof( md_name ) - 1 );
md_info = mbedtls_md_info_from_string(md_name);
TEST_ASSERT( md_info != NULL );
TEST_ASSERT ( 0 == mbedtls_md( md_info, src_str, strlen( (char *) src_str ), output ) );
- hexify( hash_str, output, mbedtls_md_get_size(md_info) );
+ hexify( hash_str, output, mbedtls_md_get_size( md_info ) );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
}
@@ -161,19 +161,19 @@
int src_len;
const mbedtls_md_info_t *md_info = NULL;
- memset(md_name, 0x00, 100);
- memset(src_str, 0x00, 10000);
- memset(hash_str, 0x00, 10000);
- memset(output, 0x00, 100);
+ memset( md_name, 0x00, 100 );
+ memset( src_str, 0x00, 10000 );
+ memset( hash_str, 0x00, 10000 );
+ memset( output, 0x00, 100 );
- strncpy( (char *) md_name, text_md_name, sizeof(md_name) - 1 );
- md_info = mbedtls_md_info_from_string(md_name);
+ strncpy( (char *) md_name, text_md_name, sizeof( md_name ) - 1 );
+ md_info = mbedtls_md_info_from_string( md_name );
TEST_ASSERT( md_info != NULL );
src_len = unhexify( src_str, hex_src_string );
TEST_ASSERT ( 0 == mbedtls_md( md_info, src_str, src_len, output ) );
- hexify( hash_str, output, mbedtls_md_get_size(md_info) );
+ hexify( hash_str, output, mbedtls_md_get_size( md_info ) );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
}
@@ -195,10 +195,10 @@
mbedtls_md_init( &ctx );
mbedtls_md_init( &ctx_copy );
- memset(md_name, 0x00, 100);
- memset(src_str, 0x00, 1000);
- memset(hash_str, 0x00, 1000);
- memset(output, 0x00, 100);
+ memset( md_name, 0x00, 100 );
+ memset( src_str, 0x00, 1000 );
+ memset( hash_str, 0x00, 1000 );
+ memset( output, 0x00, 100 );
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
strncpy( (char *) md_name, text_md_name, sizeof(md_name) - 1 );
@@ -217,16 +217,16 @@
TEST_ASSERT ( 0 == mbedtls_md_update( &ctx, src_str + halfway, len - halfway ) );
TEST_ASSERT ( 0 == mbedtls_md_finish( &ctx, output ) );
- hexify( hash_str, output, mbedtls_md_get_size(md_info) );
+ hexify( hash_str, output, mbedtls_md_get_size( md_info ) );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
/* Test clone */
- memset(hash_str, 0x00, 1000);
- memset(output, 0x00, 100);
+ memset( hash_str, 0x00, 1000 );
+ memset( output, 0x00, 100 );
TEST_ASSERT ( 0 == mbedtls_md_update( &ctx_copy, src_str + halfway, len - halfway ) );
TEST_ASSERT ( 0 == mbedtls_md_finish( &ctx_copy, output ) );
- hexify( hash_str, output, mbedtls_md_get_size(md_info) );
+ hexify( hash_str, output, mbedtls_md_get_size( md_info ) );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
exit:
@@ -249,12 +249,12 @@
mbedtls_md_init( &ctx );
mbedtls_md_init( &ctx_copy );
- memset(md_name, 0x00, 100);
- memset(src_str, 0x00, 10000);
- memset(hash_str, 0x00, 10000);
- memset(output, 0x00, 100);
+ memset( md_name, 0x00, 100 );
+ memset( src_str, 0x00, 10000 );
+ memset( hash_str, 0x00, 10000 );
+ memset( output, 0x00, 100 );
- strncpy( (char *) md_name, text_md_name, sizeof(md_name) - 1 );
+ strncpy( (char *) md_name, text_md_name, sizeof( md_name ) - 1 );
md_info = mbedtls_md_info_from_string(md_name);
TEST_ASSERT( md_info != NULL );
TEST_ASSERT ( 0 == mbedtls_md_setup( &ctx, md_info, 0 ) );
@@ -270,16 +270,16 @@
TEST_ASSERT ( 0 == mbedtls_md_update( &ctx, src_str + halfway, src_len - halfway) );
TEST_ASSERT ( 0 == mbedtls_md_finish( &ctx, output ) );
- hexify( hash_str, output, mbedtls_md_get_size(md_info) );
+ hexify( hash_str, output, mbedtls_md_get_size( md_info ) );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
/* Test clone */
- memset(hash_str, 0x00, 10000);
- memset(output, 0x00, 100);
+ memset( hash_str, 0x00, 10000 );
+ memset( output, 0x00, 100 );
TEST_ASSERT ( 0 == mbedtls_md_update( &ctx_copy, src_str + halfway, src_len - halfway ) );
TEST_ASSERT ( 0 == mbedtls_md_finish( &ctx_copy, output ) );
- hexify( hash_str, output, mbedtls_md_get_size(md_info) );
+ hexify( hash_str, output, mbedtls_md_get_size( md_info ) );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
exit:
@@ -299,13 +299,13 @@
int key_len, src_len;
const mbedtls_md_info_t *md_info = NULL;
- memset(md_name, 0x00, 100);
- memset(src_str, 0x00, 10000);
- memset(key_str, 0x00, 10000);
- memset(hash_str, 0x00, 10000);
- memset(output, 0x00, 100);
+ memset( md_name, 0x00, 100 );
+ memset( src_str, 0x00, 10000 );
+ memset( key_str, 0x00, 10000 );
+ memset( hash_str, 0x00, 10000 );
+ memset( output, 0x00, 100 );
- strncpy( (char *) md_name, text_md_name, sizeof(md_name) - 1 );
+ strncpy( (char *) md_name, text_md_name, sizeof( md_name ) - 1 );
md_info = mbedtls_md_info_from_string( md_name );
TEST_ASSERT( md_info != NULL );
@@ -313,7 +313,7 @@
src_len = unhexify( src_str, hex_src_string );
TEST_ASSERT ( mbedtls_md_hmac( md_info, key_str, key_len, src_str, src_len, output ) == 0 );
- hexify( hash_str, output, mbedtls_md_get_size(md_info) );
+ hexify( hash_str, output, mbedtls_md_get_size( md_info ) );
TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
}
@@ -334,13 +334,13 @@
mbedtls_md_init( &ctx );
- memset(md_name, 0x00, 100);
- memset(src_str, 0x00, 10000);
- memset(key_str, 0x00, 10000);
- memset(hash_str, 0x00, 10000);
- memset(output, 0x00, 100);
+ memset( md_name, 0x00, 100 );
+ memset( src_str, 0x00, 10000 );
+ memset( key_str, 0x00, 10000 );
+ memset( hash_str, 0x00, 10000 );
+ memset( output, 0x00, 100 );
- strncpy( (char *) md_name, text_md_name, sizeof(md_name) - 1 );
+ strncpy( (char *) md_name, text_md_name, sizeof( md_name ) - 1 );
md_info = mbedtls_md_info_from_string( md_name );
TEST_ASSERT( md_info != NULL );
TEST_ASSERT ( 0 == mbedtls_md_setup( &ctx, md_info, 1 ) );
@@ -355,19 +355,19 @@
TEST_ASSERT ( 0 == mbedtls_md_hmac_update( &ctx, src_str + halfway, src_len - halfway ) );
TEST_ASSERT ( 0 == mbedtls_md_hmac_finish( &ctx, output ) );
- hexify( hash_str, output, mbedtls_md_get_size(md_info) );
+ hexify( hash_str, output, mbedtls_md_get_size( md_info ) );
TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
/* Test again, for reset() */
- memset(hash_str, 0x00, 10000);
- memset(output, 0x00, 100);
+ memset( hash_str, 0x00, 10000 );
+ memset( output, 0x00, 100 );
TEST_ASSERT ( 0 == mbedtls_md_hmac_reset( &ctx ) );
TEST_ASSERT ( 0 == mbedtls_md_hmac_update( &ctx, src_str, halfway ) );
TEST_ASSERT ( 0 == mbedtls_md_hmac_update( &ctx, src_str + halfway, src_len - halfway ) );
TEST_ASSERT ( 0 == mbedtls_md_hmac_finish( &ctx, output ) );
- hexify( hash_str, output, mbedtls_md_get_size(md_info) );
+ hexify( hash_str, output, mbedtls_md_get_size( md_info ) );
TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
exit:
@@ -383,16 +383,16 @@
unsigned char output[100];
const mbedtls_md_info_t *md_info = NULL;
- memset(md_name, 0x00, 100);
- memset(hash_str, 0x00, 1000);
- memset(output, 0x00, 100);
+ memset( md_name, 0x00, 100 );
+ memset( hash_str, 0x00, 1000 );
+ memset( output, 0x00, 100 );
- strncpy( (char *) md_name, text_md_name, sizeof(md_name) - 1 );
+ strncpy( (char *) md_name, text_md_name, sizeof( md_name ) - 1 );
md_info = mbedtls_md_info_from_string( md_name );
TEST_ASSERT( md_info != NULL );
TEST_ASSERT( mbedtls_md_file( md_info, filename, output ) == 0 );
- hexify( hash_str, output, mbedtls_md_get_size(md_info) );
+ hexify( hash_str, output, mbedtls_md_get_size( md_info ) );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
}