Re: [PATCH v2] fat: Add KUnit tests for checksums and timestamps

2020-10-20 Thread OGAWA Hirofumi
David Gow writes: >> Hm, can this export only if FAT_KUNIT_TEST is builtin or module (maybe >> #if IS_ENABLED(...))? And #if will also be worked as the comment too. >> > > That's possible, but I'd prefer to export it unconditionally for two reasons: > 1. It'd make it possible to build the fat_tes

Re: [PATCH v2] fat: Add KUnit tests for checksums and timestamps

2020-10-20 Thread David Gow
On Tue, Oct 20, 2020 at 2:51 PM OGAWA Hirofumi wrote: > > David Gow writes: > > > diff --git a/fs/fat/misc.c b/fs/fat/misc.c > > index f1b2a1fc2a6a..445ad3542e74 100644 > > --- a/fs/fat/misc.c > > +++ b/fs/fat/misc.c > > @@ -229,6 +229,7 @@ void fat_time_fat2unix(struct msdos_sb_info *sbi, > > s

Re: [PATCH v2] fat: Add KUnit tests for checksums and timestamps

2020-10-19 Thread OGAWA Hirofumi
David Gow writes: > diff --git a/fs/fat/misc.c b/fs/fat/misc.c > index f1b2a1fc2a6a..445ad3542e74 100644 > --- a/fs/fat/misc.c > +++ b/fs/fat/misc.c > @@ -229,6 +229,7 @@ void fat_time_fat2unix(struct msdos_sb_info *sbi, struct > timespec64 *ts, > ts->tv_nsec = 0; > } > } >

[PATCH v2] fat: Add KUnit tests for checksums and timestamps

2020-10-19 Thread David Gow
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 timestam