Re: [PATCH 1/2] tests: display info about what failed in media/tree URI tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2018-11-19 at 12:40 +0000, Daniel P. Berrangé wrote:
> On Mon, Nov 19, 2018 at 01:26:43PM +0100, Fabiano Fidêncio wrote:
> > On Mon, 2018-11-19 at 11:43 +0000, Daniel P. Berrangé wrote:
> > > Make it possible to debug failures by displaying the URL,
> > > curl error code/message and http code.
> > > 
> > > Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
> > > ---
> > >  tests/test-mediauris.c | 4 ++++
> > >  tests/test-treeuris.c  | 4 ++++
> > >  2 files changed, 8 insertions(+)
> > > 
> > > diff --git a/tests/test-mediauris.c b/tests/test-mediauris.c
> > > index 443fdc3..c906f08 100644
> > > --- a/tests/test-mediauris.c
> > > +++ b/tests/test-mediauris.c
> > > @@ -46,6 +46,10 @@ static void test_media(OsinfoMediaList
> > > *medialist,
> > > GError **error, CURL *curl)
> > >          curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE,
> > > &response_code);
> > >  
> > >          g_test_message("res=%d, %s; code=%ld", res,
> > > curl_easy_strerror(res), response_code);
> > > +        if (res != CURLE_OK) {
> > > +            g_printerr("Failed URI %s res=%d (%s) code=%ld\n",
> > > +                       url, res, curl_easy_strerror(res), 
> > 
> > We have a small problem on using g_printerr() though. It'll make
> > the
> > test to abort in the first failure it faces and it's not something
> > we
> > would like to do.
> 
> Err, no it doesn't.   g_printerr() just prints to stderr, it never
> aborts.

Argh, you're totally right and I got confused here with something else.
I'll push the patches now.

[snip]

Best Regards,
-- 
Fabiano Fidêncio

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux