lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ-ks9nDLGvzZ+NDAJsk2Hy1=hsCzayg4-65gk60T_WJZzOUzA@mail.gmail.com>
Date: Thu, 6 Mar 2025 09:41:44 -0500
From: Tamir Duberstein <tamird@...il.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Arpitha Raghunandan <98.arpi@...il.com>, David Gow <davidgow@...gle.com>, 
	Steven Rostedt <rostedt@...dmis.org>, Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, 
	Rasmus Villemoes <linux@...musvillemoes.dk>, Sergey Senozhatsky <senozhatsky@...omium.org>, 
	Andrew Morton <akpm@...ux-foundation.org>, Shuah Khan <shuah@...nel.org>, 
	Jonathan Corbet <corbet@....net>, Geert Uytterhoeven <geert@...ux-m68k.org>, 
	Madhavan Srinivasan <maddy@...ux.ibm.com>, Michael Ellerman <mpe@...erman.id.au>, 
	Nicholas Piggin <npiggin@...il.com>, Christophe Leroy <christophe.leroy@...roup.eu>, 
	Naveen N Rao <naveen@...nel.org>, Brendan Higgins <brendan.higgins@...ux.dev>, 
	linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org, 
	linux-doc@...r.kernel.org, linux-m68k@...ts.linux-m68k.org, 
	linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v5 1/3] printf: convert self-test to KUnit

On Thu, Mar 6, 2025 at 9:25 AM Tamir Duberstein <tamird@...il.com> wrote:
>
> On Thu, Mar 6, 2025 at 7:25 AM Petr Mladek <pmladek@...e.com> wrote:
> >
> > On Fri 2025-02-21 15:34:30, Tamir Duberstein wrote:
> > > Convert the printf() self-test to a KUnit test.
> > >
> > > [...]
> > >
>
> > 2. What was the motivation to remove the trailing '\n', please?
> >
> >    It actually makes a difference from the printk() POV. Messages without
> >    the trailing '\n' are _not_ flushed to the console until another
> >    message is added. The reason is that they might still be appended
> >    by pr_cont(). And printk() emits only complete lines to the
> >    console.
> >
> >    In general, messages should include the trailing '\n' unless the
> >    code wants to append something later or the trailing '\n' is
> >    added by another layer of the code. It does not seem to be this case.
> >
> >
> > >                       bufsize, fmt, ret, elen);
> > > -             return 1;
> > > +             return;
> > >       }
> >
> > [...]
>
> I noticed in my testing that the trailing \n didn't change the test
> output, but I didn't know the details you shared about the trailing
> \n. I'll restore them, unless we jump straight to the KUNIT macros per
> the discussion above.

Ah, I forgot that `tc_fail` already delegates to KUNIT_FAIL. This was
the reason I removed the trailing newlines -- there is a mix of
present and absent trailing newlines in KUNIT_* macros, and it's not
clear to me what the correct thing is. For instance, the examples in
Documentation/dev-tools/kunit/{start,usage}.rst omit the trailing newlines.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ