[LTP] [PATCH 1/1] testinfo.pl: Properly handle NULL

Cyril Hrubis chrubis@suse.cz
Thu Jan 9 16:09:25 CET 2025


Hi!
> While at it, add missing comma to the arguments.
> 
> Fixes: 946d20bdaf ("metadata: metaparse: Better array parsing.")
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> NOTE: if we don't want to have NULL in the docs (see e.g. hugemmap10),
> we can simply filer it:

That is a question on how should be the save_restore formatted in the
docs. I guess that as a quick fix this is fine.

Acked-by: Cyril Hrubis <chrubis@suse.cz>

> $content .= paragraph(table_escape(join(', ', grep defined, @$v2)));
> 
>  docparse/testinfo.pl | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/docparse/testinfo.pl b/docparse/testinfo.pl
> index 78433c40a3..487b7d5f22 100755
> --- a/docparse/testinfo.pl
> +++ b/docparse/testinfo.pl
> @@ -408,7 +408,11 @@ sub content_all_tests
>  				# two dimensional array
>  				if (ref(@$v[0]) eq 'ARRAY') {
>  					for my $v2 (@$v) {
> -						$content .= paragraph(table_escape(join(' ', @$v2)));
> +						# convert NULL to "NULL" string to be printed
> +						for my $v3 (@$v2) {
> +							$v3 = "NULL" if (!defined $v3);
> +						}
> +						$content .= paragraph(table_escape(join(', ', @$v2)));
>  					}
>  				} else {
>  					# one dimensional array
> -- 
> 2.47.1
> 

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list