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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 29 Feb 2024 09:36:20 -0800
From: "T.J. Mercier" <tjmercier@...gle.com>
To: Muhammad Usama Anjum <usama.anjum@...labora.com>
Cc: Shuah Khan <shuah@...nel.org>, kernel@...labora.com, linux-kselftest@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] selftests/dmabuf-heap: conform test to TAP format output

On Thu, Feb 29, 2024 at 1:03 AM Muhammad Usama Anjum
<usama.anjum@...labora.com> wrote:
>
> On 2/28/24 11:51 PM, T.J. Mercier wrote:
> > On Tue, Feb 27, 2024 at 4:21 AM Muhammad Usama Anjum
> > <usama.anjum@...labora.com> wrote:
> >
> > ..
> >
> >> +static int numer_of_heaps(void)
> >> +{
> >> +       DIR *d = opendir(DEVPATH);
> >> +       struct dirent *dir;
> >> +       int heaps = 0;
> >> +
> >> +       while ((dir = readdir(d))) {
> >> +               if (!strncmp(dir->d_name, ".", 2))
> >> +                       continue;
> >> +               if (!strncmp(dir->d_name, "..", 3))
> >> +                       continue;
> >> +               heaps++;
> >> +       }
> >> +
> >> +       return heaps;
> >>  }
> >>
> >>  int main(void)
> >>  {
> >> -       DIR *d;
> >>         struct dirent *dir;
> >> -       int ret = -1;
> >> +       DIR *d;
> >> +
> >> +       ksft_print_header();
> >>
> >>         d = opendir(DEVPATH);
> >>         if (!d) {
> >> -               printf("No %s directory?\n", DEVPATH);
> >> -               return -1;
> >> +               ksft_print_msg("No %s directory?\n", DEVPATH);
> >> +               return KSFT_SKIP;
> >>         }
> >>
> >> -       while ((dir = readdir(d)) != NULL) {
> >> +       ksft_set_plan(9 * numer_of_heaps());
> >
> > Shouldn't this be 5 (one for each test_alloc_* below) instead of 9?
> This number 9 doesn't represent number of functions. It represents the
> number of test-cases. One function may have multiple of these. (Hence this
> number is equal to the number of ksft_test_results_*() functions calls).

Ah yes, thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ