From patchwork Thu Mar 14 14:44:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160353 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15595491jad; Thu, 14 Mar 2019 07:45:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOQZhEpaKf6ru7EZeD1Y18yKLbR2DyU/bmAgC6NorxvEXwwxd7DMmqJB6l5rJZyveZUyET X-Received: by 2002:ac8:33cf:: with SMTP id d15mr9331320qtb.149.1552574706831; Thu, 14 Mar 2019 07:45:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574706; cv=none; d=google.com; s=arc-20160816; b=lsmUENvcO8ncbToXBXxmx01oAuc1ETusIyU08n++56Pf7jaFvn3bw+zCHIJyVRR4aP cvLjRGsUNOf492mhxCfatlXlMFyQqvAc6gMuhqtQXLFPE4h5e2i524zRb0Vlok7m3yfT ZYi/CFCTGoDgCvxv7OZVfwn9RV7XyHPHebldekn+hWxTjQPkxtJ05eoFd/B6ppHPLGlP v6OLK9Q+EiIl7eIMwFhWtQ00BJsRJnVhTfJVPbyWioWS5ybhKf3Tl5m4WkyAt+eDlMC6 k5NUiK9SL7RxVwuRxANd8knuqEYXkmyyOlqHurwe9y9jQByvOJ3ZApr0XuRU5h4PnvA5 YqSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=8hwdut9TZaviSC3lhpSar1+2IeTzSSe/z0d9edOmSP0=; b=Dc3TrNSnh5YtDtAl9YAylGzoINqouUskL6TtMKOAM8N3iCPoPO+zQKec8NgNh1l1uN cQ9uaw4YmGYYQfUmSWtAVjKtLj1r7ZlG7kDXW30VOyzd/TApmlCIpNfpb8qRAOv40Uip XLVBN75R9Px1z+K0hSRqalaYaXHfEH6Y85bFSCZMDjsKJsRs3JHKnWsu5lrbBW4UO+qL 3oobPge+PVndsa1MjyEgW8Op3J3DrEWhIvViM8sFMJ6A3fr0L47u0gccTTNwAx7rt5Zh PVpbt/jLtrhjNDpQiYf23xJMtlwiRSMjf85sEOZMN53mQ+KERB5fUeKWca13VU5rt7yf UFlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id d12si4726333qtd.228.2019.03.14.07.45.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:45:06 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 58B3D67BCE; Thu, 14 Mar 2019 14:45:05 +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 210AF6BF71; Thu, 14 Mar 2019 14:45:05 +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 AFC933D38A; Thu, 14 Mar 2019 14:45:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2EEiosp024678 for ; Thu, 14 Mar 2019 10:44:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D12860FE5; Thu, 14 Mar 2019 14:44:50 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-177.rdu2.redhat.com [10.10.124.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9284A60FD6; Thu, 14 Mar 2019 14:44:48 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:44:11 -0400 Message-Id: <7ce3cbe2cb0f11241884f5ca15f4f84d0585ce2f.1552574299.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 18/21] tests: qemuxml2argv: add testInfoClear 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: , 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.28]); Thu, 14 Mar 2019 14:45:06 +0000 (UTC) This is closer to the pattern of qemuxml2xml tests, and will make things easier if we extend testInfo to contain more freeable data Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Andrea Bolognani diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 496e33f4e5..813871d6b8 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -665,6 +665,12 @@ testInfoSetArgs(struct testInfo *info, ...) return ret; } +static void +testInfoClear(struct testInfo *info) +{ + virObjectUnref(info->qemuCaps); +} + # define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX" static int @@ -811,10 +817,9 @@ mymain(void) if (virTestRun("QEMU XML-2-ARGV " _name "." arch "-" ver, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ - virObjectUnref(info.qemuCaps); \ + testInfoClear(&info); \ } while (0) - # define DO_TEST_CAPS_ARCH_VER(name, arch, ver) \ DO_TEST_CAPS_INTERNAL(name, arch, ver, ARG_END) @@ -853,7 +858,7 @@ mymain(void) if (virTestRun("QEMU XML-2-ARGV " _name, \ testCompareXMLToArgv, &info) < 0) \ ret = -1; \ - virObjectUnref(info.qemuCaps); \ + testInfoClear(&info); \ } while (0) # define DO_TEST(name, ...) \