From nobody Mon Feb 9 06:33:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1601898672; cv=none; d=zohomail.com; s=zohoarc; b=kpNk7k/HAAI7JfGkR7Fqs5lQkr/sQk9woj7DkTXDVwiRGYawkyg24quIqsXnP+Kf899BhgMxV+dXzr9vEAFX5OjDZwILXpYF32577rEOeZO9+PF9SL2kUzo9Qddx5U6cPVIdAFP7vtqBUWnl8tyVwbJtqiWpN07tt5lGoh81ons= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601898672; 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; bh=lsZUVGI1JW2Cgd/50xz31mQ2ZWih61hNSSNIfYOtNEI=; b=kPamzukCHsPOR5x0G2CK5UJ3uPdAG2P7LiTQjV42RIE0nGCVoaoFxJwWF7CzvKG37jI2fOU9GXWvZDWDWrLhDDd9s0Gv5ZoitdBQYD59lRKcfzuLq/3o8b4ri+IVgVCqn25GuoF45rTJ35h0wCSg2oblEAVAX5LuraXL5b/irYM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601898672844324.74400707780444; Mon, 5 Oct 2020 04:51:12 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-138-4gGrfM6MMPKA_dQXmpbLWg-1; Mon, 05 Oct 2020 07:49:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BE5DE64081; Mon, 5 Oct 2020 11:49:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 956905C1BD; Mon, 5 Oct 2020 11:49:48 +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 5FE94181A884; Mon, 5 Oct 2020 11:49:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 095BnfxO028062 for ; Mon, 5 Oct 2020 07:49:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 51A5119C4F; Mon, 5 Oct 2020 11:49:41 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E5622635E for ; Mon, 5 Oct 2020 11:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601898671; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lsZUVGI1JW2Cgd/50xz31mQ2ZWih61hNSSNIfYOtNEI=; b=GJWqb3ZKl4pu9RRP1Ky5A/T4XivwdOKf7RA4M4ZAxSuiuvAv2NkfZFVlphxbZX02+8SqML MAd4DQU5SDeRNN2AMIrIHhisESbIuI3z8D5agam7wSd5jhDWuM4Ma6kgl9jxyzYeiv1lku CeHj8DKe8bKNfu1HXax+v47EXcm7DW8= X-MC-Unique: 4gGrfM6MMPKA_dQXmpbLWg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v2 3/7] virbitmaptest: Use separate output strings in 'test5' Date: Mon, 5 Oct 2020 13:49:25 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The test validates two outputs. Don't reuse 'str' for both. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virbitmaptest.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c index 98ac06c406..dc23431645 100644 --- a/tests/virbitmaptest.c +++ b/tests/virbitmaptest.c @@ -329,7 +329,8 @@ test5(const void *v G_GNUC_UNUSED) size_t i; ssize_t j; int ret =3D -1; - char *str =3D NULL; + g_autofree char *actual1 =3D NULL; + g_autofree char *actual2 =3D NULL; bitmap =3D virBitmapNewData(data, sizeof(data)); if (!bitmap) @@ -359,19 +360,17 @@ test5(const void *v G_GNUC_UNUSED) data2[4] !=3D 0x04) goto error; - if (!(str =3D virBitmapDataFormat(data, sizeof(data)))) + if (!(actual1 =3D virBitmapDataFormat(data, sizeof(data)))) goto error; - if (STRNEQ(str, "0,9,34")) + if (STRNEQ(actual1, "0,9,34")) goto error; - VIR_FREE(str); - if (!(str =3D virBitmapDataFormat(data2, len2))) + if (!(actual2 =3D virBitmapDataFormat(data2, len2))) goto error; - if (STRNEQ(str, "0,2,9,15,34")) + if (STRNEQ(actual2, "0,2,9,15,34")) goto error; ret =3D 0; error: - VIR_FREE(str); virBitmapFree(bitmap); VIR_FREE(data2); return ret; --=20 2.26.2