public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] testinfo.pl: Properly handle NULL
@ 2025-01-09 14:28 Petr Vorel
  2025-01-09 14:31 ` Petr Vorel
  2025-01-09 15:09 ` Cyril Hrubis
  0 siblings, 2 replies; 4+ messages in thread
From: Petr Vorel @ 2025-01-09 14:28 UTC (permalink / raw)
  To: ltp

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:

$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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH 1/1] testinfo.pl: Properly handle NULL
  2025-01-09 14:28 [LTP] [PATCH 1/1] testinfo.pl: Properly handle NULL Petr Vorel
@ 2025-01-09 14:31 ` Petr Vorel
  2025-01-09 15:09 ` Cyril Hrubis
  1 sibling, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2025-01-09 14:31 UTC (permalink / raw)
  To: ltp

Hi Cyril,

> While at it, add missing comma to the arguments.

I forget to note perl error:

$ cd metadata; make
metadata/parse.sh > ltp.json
mkdir -p docparse
make -C docparse/ -f docparse/Makefile
make[1]: Entering directory 'docparse'
docparse/testinfo.pl metadata/ltp.json
INFO: using 'linux' as LINUX_GIT repository
INFO: using 'linux-stable' as LINUX_STABLE_GIT repository
INFO: using 'glibc' as GLIBC_GIT repository
INFO: using 'musl' as MUSL_GIT repository
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.
Use of uninitialized value in join or string at docparse/testinfo.pl line 411.

Kind regards,
Petr

> 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:

> $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

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH 1/1] testinfo.pl: Properly handle NULL
  2025-01-09 14:28 [LTP] [PATCH 1/1] testinfo.pl: Properly handle NULL Petr Vorel
  2025-01-09 14:31 ` Petr Vorel
@ 2025-01-09 15:09 ` Cyril Hrubis
  2025-01-09 16:10   ` Petr Vorel
  1 sibling, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2025-01-09 15:09 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

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

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH 1/1] testinfo.pl: Properly handle NULL
  2025-01-09 15:09 ` Cyril Hrubis
@ 2025-01-09 16:10   ` Petr Vorel
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2025-01-09 16:10 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril,

> > 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.

Right, merged as is for now. Thanks for your ack.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-09 16:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 14:28 [LTP] [PATCH 1/1] testinfo.pl: Properly handle NULL Petr Vorel
2025-01-09 14:31 ` Petr Vorel
2025-01-09 15:09 ` Cyril Hrubis
2025-01-09 16:10   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox