ACK: [PATCH 02/27] fwts_framework: no need to pass tests_to_skip as it is locally scoped

ivanhu ivan.hu at canonical.com
Thu Aug 16 09:11:32 UTC 2018



On 08/15/2018 09:11 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> List tests_to_skip is locally scoped in the source, so there is no
> need to pass it as an argument into a couple of functions.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/lib/src/fwts_framework.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index 60b9bd66..47299ef4 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -984,11 +984,11 @@ static void fwts_framework_heading_info(
>   *  fwts_framework_skip_test()
>   *	try to find a test in list of tests to be skipped, return NULL of cannot be found
>   */
> -static fwts_framework_test *fwts_framework_skip_test(fwts_list *tests_to_skip, fwts_framework_test *test)
> +static fwts_framework_test *fwts_framework_skip_test(fwts_framework_test *test)
>  {
>  	fwts_list_link *item;
>  
> -	fwts_list_foreach(item, tests_to_skip)
> +	fwts_list_foreach(item, &tests_to_skip)
>  		if (test == fwts_list_data(fwts_framework_test *, item))
>  			return test;
>  
> @@ -999,7 +999,7 @@ static fwts_framework_test *fwts_framework_skip_test(fwts_list *tests_to_skip, f
>   *  fwts_framework_skip_test_parse()
>   *	parse optarg of comma separated list of tests to skip
>   */
> -static int fwts_framework_skip_test_parse(const char *arg, fwts_list *tests_to_skip)
> +static int fwts_framework_skip_test_parse(const char *arg)
>  {
>  	char *str;
>  	char *token;
> @@ -1011,7 +1011,7 @@ static int fwts_framework_skip_test_parse(const char *arg, fwts_list *tests_to_s
>  			fprintf(stderr, "No such test '%s'\n", token);
>  			return FWTS_ERROR;
>  		} else
> -			fwts_list_append(tests_to_skip, test);
> +			fwts_list_append(&tests_to_skip, test);
>  	}
>  
>  	return FWTS_OK;
> @@ -1249,7 +1249,7 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
>  					| FWTS_FLAG_SHOW_PROGRESS_DIALOG;
>  			break;
>  		case 24: /* --skip-test */
> -			if (fwts_framework_skip_test_parse(optarg, &tests_to_skip) != FWTS_OK)
> +			if (fwts_framework_skip_test_parse(optarg) != FWTS_OK)
>  				return FWTS_COMPLETE;
>  			break;
>  		case 25: /* --quiet */
> @@ -1404,7 +1404,7 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
>  		fw->flags |= FWTS_FLAG_SHOW_TESTS;
>  		break;
>  	case 'S': /* --skip-test */
> -		if (fwts_framework_skip_test_parse(optarg, &tests_to_skip) != FWTS_OK)
> +		if (fwts_framework_skip_test_parse(optarg) != FWTS_OK)
>  			return FWTS_COMPLETE;
>  		break;
>  	case 't': /* --table-path */
> @@ -1569,7 +1569,7 @@ int fwts_framework_args(const int argc, char **argv)
>  			goto tidy;
>  		}
>  
> -		if (fwts_framework_skip_test(&tests_to_skip, test) == NULL)
> +		if (fwts_framework_skip_test(test) == NULL)
>  			fwts_list_append(&tests_to_run, test);
>  	}
>  
> @@ -1582,7 +1582,7 @@ int fwts_framework_args(const int argc, char **argv)
>  	fwts_list_foreach(item, &fwts_framework_test_list) {
>  		fwts_framework_test *test = fwts_list_data(fwts_framework_test*, item);
>  		if (fw->flags & test->flags & FWTS_FLAG_RUN_ALL)
> -			if (fwts_framework_skip_test(&tests_to_skip, test) == NULL)
> +			if (fwts_framework_skip_test(test) == NULL)
>  				fwts_list_append(&tests_to_run, test);
>  	}
>  
Acked-by: Ivan Hu <ivan.hu at canonical.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/8b21bfd8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/8b21bfd8/attachment.sig>


More information about the fwts-devel mailing list