[libvirt] [PATCH 01/14] Add test case for virURIPtr classs

Daniel P. Berrange berrange at redhat.com
Fri Mar 23 12:14:17 UTC 2012


On Thu, Mar 22, 2012 at 11:54:07AM +0800, Osier Yang wrote:
> On 2012年03月21日 01:33, Daniel P. Berrange wrote:
> >From: "Daniel P. Berrange"<berrange at redhat.com>
> >
> >To ensure we properly escape&  unescape IPv6 numeric addresses,
> >add a test case
> >
> >* tests/Makefile.am, tests/viruritest.c: URI parsing test
> >---
> >  tests/Makefile.am  |    7 ++-
> >  tests/viruritest.c |  139 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 145 insertions(+), 1 deletions(-)
> >  create mode 100644 tests/viruritest.c
> >


> >+static int testURIParse(const void *args)
> >+{
> >+    int ret = -1;
> >+    virURIPtr uri = NULL;
> >+    const struct URIParseData *data = args;
> >+    char *uristr;
> >+
> >+    if (!(uri = virURIParse(data->uri))) {
> >+        virReportOOMError();
> 
> 
> It's not neccessary to be out of memory error, perhaps
> VIR_DEBUG with a msg is better here.

libxml doesn't do any usefull error reporting here so we
can't find out what is actually wrong :-(


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list