Re: [PATCH] fuzz: add basic fuzz testing for git command
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Sep 13, 2022, 15:57 UTC
- Message-ID
- <220913.864jxb6z8u.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <pull.1351.git.1663078962231.gitgitgadget@gmail.com>
On Tue, Sep 13 2022, Arthur Chan via GitGitGadget wrote:
> From: Arthur Chan <arthur.chan@adalogics.com> > [...]
Just a quick comment. The coding style of this project is to:
> +void randomize_git_files(char *dir, char *name_set[], int files_count, char *data, int size) {...try to wrap at 79 columns.
> + int data_size = size / files_count;
...and to use \t for indentation, not spaces.
> + for(int i=0; i<files_count; i++) {...and e.g. to use "for (", not "for(", spaces around "<" etc. We also tend to pre-declare "int" instead of putting it in "for" etc.
> +void generate_random_file(char *data, int size) {Can we really not use the APIs we have already for this (maybe not due to the fuzz testing aspect of this...)
> + ret += system("git add TEMP-*-TEMP");
> + ret += system("git commit -m\"New Commit\"");(I have not looked deeply). We usually write *.sh tests in t/*.sh, can this really not be driven by that sort of infrastructure?