On Fri, Aug 30, 2013 at 09:44:59AM +0800, Wang Shilong wrote:
> On 08/30/2013 03:29 AM, Josef Bacik wrote:
> >The plan is to have a bunch of unit tests that run when btrfs is loaded when you
> >build with the appropriate config option. My ultimate goal is to have a test
> >for every non-static function we have, but at first I'm going to focus on the
> >things that cause us the most problems. To start out with this just adds a
> >tests/ directory and moves the existing free space cache tests into that
> >directory and sets up all of the infrastructure. Thanks,
> >
> >Signed-off-by: Josef Bacik <jbacik@xxxxxxxxxxxx>
>
> Nothing serious, use checkpatch.pl and i get the following warnings:
>
> WARNING: kfree(NULL) is safe this check is probably not required
> #132: FILE: fs/btrfs/free-space-cache.c:3035:
> + if (map)
> + kfree(map);
>
Good point about this, I will do it.
> WARNING: line over 80 characters
> #882: FILE: fs/btrfs/tests/free-space-tests.c:211:
> + ret = test_add_free_space_entry(cache, 4 * 1024 * 1024, 1 * 1024 *
> 1024, 1);
>
> WARNING: line over 80 characters
> #927: FILE: fs/btrfs/tests/free-space-tests.c:256:
> + ret = test_add_free_space_entry(cache, 1 * 1024 * 1024, 4 * 1024 *
> 1024, 1);
>
> WARNING: line over 80 characters
> #947: FILE: fs/btrfs/tests/free-space-tests.c:276:
> + ret = test_add_free_space_entry(cache, 4 * 1024 * 1024, 4 * 1024 *
> 1024, 1);
>
> WARNING: line over 80 characters
> #953: FILE: fs/btrfs/tests/free-space-tests.c:282:
> + ret = test_add_free_space_entry(cache, 2 * 1024 * 1024, 2 * 1024 *
> 1024, 0);
>
> WARNING: line over 80 characters
> #1016: FILE: fs/btrfs/tests/free-space-tests.c:345:
> + ret = test_add_free_space_entry(cache, 1 * 1024 * 1024, 2 * 1024 *
> 1024, 1);
>
> WARNING: line over 80 characters
> #1022: FILE: fs/btrfs/tests/free-space-tests.c:351:
> + ret = test_add_free_space_entry(cache, 3 * 1024 * 1024, 1 * 1024 *
> 1024, 0);
>
> WARNING: line over 80 characters
> #1030: FILE: fs/btrfs/tests/free-space-tests.c:359:
> + test_msg("Error removing bitmap and extent overlapping %d\n", ret);
>
Yeah I skipped the 80 char limit in here to make the tests a little easier to
read. Thanks,
Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html