Re: [LTP] [PATCH v4] syscalls/fallocate04: add new fallocate() test

Cyril Hrubis
2015-04-27T14:07:48Z

Hi!
> diff --git a/testcases/kernel/syscalls/fallocate/fallocate04.c b/testcases/kernel/syscalls/fallocate/fallocate04.c
> new file mode 100644
> index 0000000..f99492d
> --- /dev/null
> +++ b/testcases/kernel/syscalls/fallocate/fallocate04.c
> @@ -0,0 +1,273 @@
> +/*
> + * Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it would be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program. If not, see <http://www.gnu.org/licenses/>.
> + *
> + * Author: Alexey Kodanev <alexey.kodanev@oracle.com>
> + */

What about adding a short comment here, with high level description of
the testcase? It's a bit easier to dive in the code if you know the big
picture beforehand.

> +#define _GNU_SOURCE
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <errno.h>
> +#include <sys/stat.h>
> +#include <fcntl.h>
> +#include <unistd.h>

The rest looks fine. I may be tempted not to use tst_brkm(TCONF, ...) in
the test functions and do tst_resm(TCONF, ...); return; instead, but
that is minor thing.

--
Cyril Hrubis
chrubis@suse.cz