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

Alex Hung alex.hung at canonical.com
Wed Aug 15 17:54:22 UTC 2018


On 2018-08-15 06:11 AM, 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: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list