[sheepdog] [PATCH v1] unittest: fix coredump bug for unit-test
Ruoyu
liangry at ucweb.com
Tue Jul 1 04:33:51 CEST 2014
Look goods to me, thanks!
On 2014年06月30日 18:31, Robin Dong wrote:
> From: Robin Dong <sanbai at taobao.com>
>
> Test case in test_hash.c will call create_vdisks() which need to
> check sys->cinfo.flags, but variable 'sys' is uninitialized in
> unit-test environment. Therefore we need to init 'sys' before
> calling create_vdisks().
>
> Reported-by: Ruoyu <liangry at ucweb.com>
> Signed-off-by: Robin Dong <sanbai at taobao.com>
> ---
> tests/unit/sheep/test_hash.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tests/unit/sheep/test_hash.c b/tests/unit/sheep/test_hash.c
> index 26386b9..7779288 100644
> --- a/tests/unit/sheep/test_hash.c
> +++ b/tests/unit/sheep/test_hash.c
> @@ -605,7 +605,9 @@ static Suite *test_suite(void)
>
> int main(void)
> {
> + struct system_info __sys;
> int number_failed;
> + sys = &__sys;
> Suite *s = test_suite();
> SRunner *sr = srunner_create(s);
> srunner_run_all(sr, CK_NORMAL);
More information about the sheepdog
mailing list