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

Vera Cholasta vbudikov at redhat.com
Tue Oct 16 17:47:16 UTC 2018


Hello,
thank you for yours review. I am sending you new version.

BR
Vera

On Tue, Oct 16, 2018 at 10:57 AM Daniel P. Berrangé <berrange at redhat.com>
wrote:

> 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 :|
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20181016/bcd06e10/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-test-isodetect-replace-while-loop-with-for-loop.patch
Type: text/x-patch
Size: 1074 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20181016/bcd06e10/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-test-isodetect-continue-after-failure.patch
Type: text/x-patch
Size: 1411 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20181016/bcd06e10/attachment-0001.bin>


More information about the Libosinfo mailing list