From nobody Wed Nov 27 02:29:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560267891; cv=none; d=zoho.com; s=zohoarc; b=R+txoeGIEGE+e+NU4MgDXVQeT0tAw8R5PXKc6V6tIuyz79XELoiFhc0JzHHc7KlJN5skcopbUp2koY621tjFbpoaMAd7IRm7FwOblW4SEAPB+XNwnkDPlGBSMbUwVn/WN1314H371/otV7Vhvxk/Nw5kvH6MuHpeNoZyEE6i6i0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560267891; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=IozorymBQHSvHoI7PJPWM0nyQfn1WKblp8HSiWG19lk=; b=mOW1aSTpveE1ZdR3LOiTLLzGZIGnTTZLCzz7puxXUqAmkuYtVOVzr2oU2Dy6Sbweev0QJh4ScuuoYENK3gl0dxQnf9nB8KHO+5q9yPqg20LzXzyTjew3u5sLmUsSe1wNXDZPyg8+TWf05+DHqlQHR632FPBax2LMLSa3G4mPI+A= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560267891317589.7781732567187; Tue, 11 Jun 2019 08:44:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0922B37E8E; Tue, 11 Jun 2019 15:44:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CCB79611D3; Tue, 11 Jun 2019 15:44:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8DD31206D3; Tue, 11 Jun 2019 15:44:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5BFhLuK009494 for ; Tue, 11 Jun 2019 11:43:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id CC8F260A35; Tue, 11 Jun 2019 15:43:21 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5710460DCE for ; Tue, 11 Jun 2019 15:43:21 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 11 Jun 2019 17:43:15 +0200 Message-Id: <1e9d359ad877f95eb5435477e6b51f1f5b6abceb.1560267765.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] tests: uri: Run all test cases on a single URI X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 11 Jun 2019 15:44:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Determine whether the test has failed after running all the cases so that we don't need to rerun it multiple times to see all problems. Signed-off-by: Peter Krempa --- tests/viruritest.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/tests/viruritest.c b/tests/viruritest.c index 336fffbf0f..04c237832d 100644 --- a/tests/viruritest.c +++ b/tests/viruritest.c @@ -51,6 +51,7 @@ static int testURIParse(const void *args) const struct URIParseData *data =3D args; char *uristr =3D NULL; size_t i; + bool fail =3D false; if (!(uri =3D virURIParse(data->uri))) goto cleanup; @@ -58,60 +59,62 @@ static int testURIParse(const void *args) if (STRNEQ(uri->scheme, data->scheme)) { VIR_TEST_DEBUG("Expected scheme '%s', actual '%s'", data->scheme, uri->scheme); - goto cleanup; + fail =3D true; } if (STRNEQ(uri->server, data->server)) { VIR_TEST_DEBUG("Expected server '%s', actual '%s'", data->server, uri->server); - goto cleanup; + fail =3D true; } if (uri->port !=3D data->port) { VIR_TEST_DEBUG("Expected port '%d', actual '%d'", data->port, uri->port); - goto cleanup; + fail =3D true; } if (STRNEQ_NULLABLE(uri->path, data->path)) { VIR_TEST_DEBUG("Expected path '%s', actual '%s'", data->path, uri->path); - goto cleanup; + fail =3D true; } if (STRNEQ_NULLABLE(uri->query, data->query)) { VIR_TEST_DEBUG("Expected query '%s', actual '%s'", data->query, uri->query); - goto cleanup; + fail =3D true; } if (STRNEQ_NULLABLE(uri->fragment, data->fragment)) { VIR_TEST_DEBUG("Expected fragment '%s', actual '%s'", data->fragment, uri->fragment); - goto cleanup; + fail =3D true; } for (i =3D 0; data->params && data->params[i].name && i < uri->paramsC= ount; i++) { if (STRNEQ_NULLABLE(data->params[i].name, uri->params[i].name)) { VIR_TEST_DEBUG("Expected param name %zu '%s', actual '%s'", i, data->params[i].name, uri->params[i].name); - goto cleanup; + fail =3D true; } if (STRNEQ_NULLABLE(data->params[i].value, uri->params[i].value)) { VIR_TEST_DEBUG("Expected param value %zu '%s', actual '%s'", i, data->params[i].value, uri->params[i].value); - goto cleanup; + fail =3D true; } } if (data->params && data->params[i].name) { VIR_TEST_DEBUG("Missing parameter %zu %s=3D%s", i, data->params[i].name, data->params[i].value); - goto cleanup; + fail =3D true; } if (i !=3D uri->paramsCount) { - VIR_TEST_DEBUG("Unexpected parameter %zu %s=3D%s", - i, uri->params[i].name, uri->params[i].value); - goto cleanup; + for (; i < uri->paramsCount; i++) { + VIR_TEST_DEBUG("Unexpected parameter %zu %s=3D%s", + i, uri->params[i].name, uri->params[i].value); + } + fail =3D true; } VIR_FREE(uri->query); @@ -123,9 +126,12 @@ static int testURIParse(const void *args) if (STRNEQ(uristr, data->uri_out)) { VIR_TEST_DEBUG("URI did not roundtrip, expect '%s', actual '%s'", data->uri_out, uristr); - goto cleanup; + fail =3D true; } + if (fail) + goto cleanup; + ret =3D 0; cleanup: VIR_FREE(uristr); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list