All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan Higgins <brendanhiggins@google.com>
To: David Gow <davidgow@google.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	shuah@kernel.org, kunit-dev@googlegroups.com,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8] fat: Add KUnit tests for checksums and timestamps
Date: Tue, 4 May 2021 11:36:06 -0700	[thread overview]
Message-ID: <YJGUFrc8PJ0LAKiF@google.com> (raw)
In-Reply-To: <20210416065623.882364-1-davidgow@google.com>

On Thu, Apr 15, 2021 at 11:56:23PM -0700, David Gow wrote:
> Add some basic sanity-check tests for the fat_checksum() function and
> the fat_time_unix2fat() and fat_time_fat2unix() functions. These unit
> tests verify these functions return correct output for a number of test
> inputs.
> 
> These tests were inspored by -- and serve a similar purpose to -- the
                   ^^^^^^^^
        I am guessing this is supposed to be "inspired".

> timestamp parsing KUnit tests in ext4[1].
> 
> Note that, unlike fat_time_unix2fat, fat_time_fat2unix wasn't previously
> exported, so this patch exports it as well. This is required for the
> case where we're building the fat and fat_test as modules.
> 
> [1]:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ext4/inode-test.c
> 
> Signed-off-by: David Gow <davidgow@google.com>
> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

Aside from the nit above, and the *potential* nit and question below.
Everything here looks good to me.

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>

> ---
> 
> It's been a while, but this hopefully is a final version of the FAT KUnit
> patchset. It has a number of changes to keep it up-to-date with current
> KUnit standards, notably the use of parameterised tests and the addition
> of a '.kunitconfig' file to allow for easy testing. It also fixes an
> endianness tagging issue picked up by the kernel test robot under sparse
> on pa-risc.
> 
> Cheers,
> -- David

[...]

> diff --git a/fs/fat/fat_test.c b/fs/fat/fat_test.c
> new file mode 100644
> index 000000000000..febd25f57d4b
> --- /dev/null
> +++ b/fs/fat/fat_test.c
> @@ -0,0 +1,197 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * KUnit tests for FAT filesystems.
> + *
> + * Copyright (C) 2020 Google LLC.

Nit: I know you wrote this last year, but I have had other maintainers
tell me the Copyright date should be set to when the final version of
the patch is sent out.

I personally don't care, and I don't think you should resend this patch
just for that, but figured I would mention.

> + * Author: David Gow <davidgow@google.com>
> + */
> +
> +#include <kunit/test.h>
> +
> +#include "fat.h"
> +
> +static void fat_checksum_test(struct kunit *test)
> +{
> +	/* With no extension. */
> +	KUNIT_EXPECT_EQ(test, fat_checksum("VMLINUX    "), (u8)44);
> +	/* With 3-letter extension. */
> +	KUNIT_EXPECT_EQ(test, fat_checksum("README  TXT"), (u8)115);
> +	/* With short (1-letter) extension. */
> +	KUNIT_EXPECT_EQ(test, fat_checksum("ABCDEFGHA  "), (u8)98);

How do you get the magic values? Or is this just supposed to be a
regression test?

Not going to pretend I understand FAT, but everything else in this test
makes sense from a logical/testing/readability point of view.

Cheers!

[...]

  reply	other threads:[~2021-05-04 18:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16  6:56 [PATCH v8] fat: Add KUnit tests for checksums and timestamps David Gow
2021-05-04 18:36 ` Brendan Higgins [this message]
2021-05-05  6:48   ` David Gow
2021-05-05 17:44     ` Brendan Higgins
2021-05-05 22:22 ` Daniel Latypov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJGUFrc8PJ0LAKiF@google.com \
    --to=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.