diff --git a/tests/scripts/generate_test_code.py b/tests/scripts/generate_test_code.py index 18a29d1e6..839fccddd 100755 --- a/tests/scripts/generate_test_code.py +++ b/tests/scripts/generate_test_code.py @@ -322,7 +322,7 @@ def gen_function_wrapper(name, local_vars, args_dispatch): :param name: Test function name :param local_vars: Local variables declaration code :param args_dispatch: List of dispatch arguments. - Ex: ['(char *)params[0]', '*((int *)params[1])'] + Ex: ['(char *) params[0]', '*((int *) params[1])'] :return: Test function wrapper. """ # Then create the wrapper @@ -488,7 +488,7 @@ def parse_function_argument(arg, arg_idx, args, local_vars, args_dispatch): typ, _ = m.groups() if typ in SIGNED_INTEGER_TYPES: args.append('int') - args_dispatch.append('((mbedtls_test_argument_t*)params[%d])->sint' % arg_idx) + args_dispatch.append('((mbedtls_test_argument_t *) params[%d])->sint' % arg_idx) return 1 if typ in STRING_TYPES: args.append('char*') @@ -498,7 +498,7 @@ def parse_function_argument(arg, arg_idx, args, local_vars, args_dispatch): args.append('hex') # create a structure pointer_initializer = '(uint8_t *) params[%d]' % arg_idx - len_initializer = '((mbedtls_test_argument_t*)params[%d])->len' % (arg_idx+1) + len_initializer = '((mbedtls_test_argument_t *) params[%d])->len' % (arg_idx+1) local_vars.append(' data_t data%d = {%s, %s};\n' % (arg_idx, pointer_initializer, len_initializer)) args_dispatch.append('&data%d' % arg_idx) diff --git a/tests/scripts/test_generate_test_code.py b/tests/scripts/test_generate_test_code.py index 48d3e53af..fe748aeb4 100755 --- a/tests/scripts/test_generate_test_code.py +++ b/tests/scripts/test_generate_test_code.py @@ -487,8 +487,8 @@ class ParseFuncSignature(TestCase): self.assertEqual(local, '') self.assertEqual(arg_dispatch, ['(char *) params[0]', - '((mbedtls_test_argument_t*)params[1])->sint', - '((mbedtls_test_argument_t*)params[2])->sint']) + '((mbedtls_test_argument_t *) params[1])->sint', + '((mbedtls_test_argument_t *) params[2])->sint']) def test_hex_params(self): """ @@ -500,10 +500,10 @@ class ParseFuncSignature(TestCase): self.assertEqual(args, ['char*', 'hex', 'int']) self.assertEqual(local, ' data_t data1 = {(uint8_t *) params[1], ' - '((mbedtls_test_argument_t*)params[2])->len};\n') + '((mbedtls_test_argument_t *) params[2])->len};\n') self.assertEqual(arg_dispatch, ['(char *) params[0]', '&data1', - '((mbedtls_test_argument_t*)params[3])->sint']) + '((mbedtls_test_argument_t *) params[3])->sint']) def test_unsupported_arg(self): """