[DTrace-devel] [PATCH 1/4] test: Turn char[16] into string to ignore garbage bytes
Kris Van Hees
kris.van.hees at oracle.com
Tue Oct 7 15:37:40 UTC 2025
On Mon, Oct 06, 2025 at 05:57:23PM -0400, eugene.loh at oracle.com wrote:
> From: Eugene Loh <eugene.loh at oracle.com>
>
> In commit 308e996c0 ("cg, agg: fix alignment of key components"), a new
> test test/unittest/aggs/tst.chararray-key.d used a char[16] as an agg key.
> The problem is that the char array, curpsinfo->pr_fname, could have
> garbage bytes after the first NUL byte, polluting test output.
>
> Since we do not care about any such garbage bytes, convert to a string.
>
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
> test/unittest/aggs/tst.chararray-key.d | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/unittest/aggs/tst.chararray-key.d b/test/unittest/aggs/tst.chararray-key.d
> index af45d4a5e..2bb638372 100644
> --- a/test/unittest/aggs/tst.chararray-key.d
> +++ b/test/unittest/aggs/tst.chararray-key.d
> @@ -15,7 +15,7 @@
>
> BEGIN
> {
> - @[curpsinfo->pr_fname] = count();
> + @[(string)curpsinfo->pr_fname] = count();
> exit(0);
> }
>
> --
> 2.47.3
>
More information about the DTrace-devel
mailing list