[Libosinfo] [PATCH] Enhance test-isodetect: continue after failure

Daniel P. Berrangé berrange at redhat.com
Tue Oct 16 08:39:19 UTC 2018


On Mon, Oct 15, 2018 at 07:43:59PM +0200, Věra Cholasta wrote:
> ---
>  tests/test-isodetect.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c
> index 76f0c5a..f40f5cc 100644
> --- a/tests/test-isodetect.c
> +++ b/tests/test-isodetect.c
> @@ -390,17 +390,16 @@ static void test_one(const gchar *vendor)
>  
>      g_assert_nonnull(isos);
>  
> -    tmp = isos;
> -    while (tmp) {
> +    for (tmp = isos; tmp; tmp = tmp->next) {
>          struct ISOInfo *info  = tmp->data;
>          gboolean matched = osinfo_db_identify_media(db, info->media);
>          OsinfoOs *os;
>  
>          g_test_message("checking OS %s for ISO %s",
>                         info->shortid, info->filename);
> +        g_assert_true(matched);
>          if (!matched) {
> -            g_error("ISO %s was not matched by OS %s",
> -                    info->filename, info->shortid);
> +            continue;

You've removed the message that tells us what actually failed.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the Libosinfo mailing list