From nobody Mon Apr 29 02:43:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1600946387; cv=none; d=zohomail.com; s=zohoarc; b=JZY/lnHm3eBXLGw4FcR3qEhF11IgTP8xvNL3p5oaVIwdTKwv8rtqeCn2rxAwfzUubvMpJh17+wYrvjE60puovw4FcyBhAmqbW+3rirCtQ0CzOKZ1xYo4G2dsnmvE18eZpejPJYdPO9BDgugm9dEoW0IrHXloQfehlh6J/zv4OGs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600946387; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=z2Pm8eSfAuHI7BMYsxD/ziJnjDh6XPjod89PDzh4SH8=; b=Po820zYb8UVM/Z6FRoeiDgqUrt/AqB6LbVFi1gzCM3Kj1fgMnuw6xD7LuhhSN1nLrgU1NOEm0vo22Vr176avhdrPZEYVBk3vR9KiosVnvWPMILqI0zFTZs300jzaDFSLgRovRypCuZ43T5/9lM2mEXv4FeQrXV8T4o/92sA1ZbE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600946387307422.983972081489; Thu, 24 Sep 2020 04:19:47 -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-362-2f8-LsZ7Ol-dnyuk6w_PoQ-1; Thu, 24 Sep 2020 07:19:42 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E6867188C122; Thu, 24 Sep 2020 11:19:37 +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 B8A979CBA; Thu, 24 Sep 2020 11:19:37 +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 6D5EC44A7A; Thu, 24 Sep 2020 11:19:37 +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 08OBJagZ006836 for ; Thu, 24 Sep 2020 07:19:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id AFFC460CCC; Thu, 24 Sep 2020 11:19:36 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 199F660C15 for ; Thu, 24 Sep 2020 11:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600946386; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=z2Pm8eSfAuHI7BMYsxD/ziJnjDh6XPjod89PDzh4SH8=; b=bPWMjYoMQC90nQ21EWyzWUM97vioZ1lrRXgR876CX2YcTlyDXusaBGdeBObEjontAqpkWz 2q4eoun9OosFP8pHW1TaUW+SkaZ4Ma3ughdWrpkBe+iHoQSgsSQUjtE0ZAxKOVXZhujAb8 xePQAftCYWVlVH0N8Y5AT6U4y3Ox+ss= X-MC-Unique: 2f8-LsZ7Ol-dnyuk6w_PoQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemuxml2argvtest: Append newline to tested error messages Date: Thu, 24 Sep 2020 13:19:31 +0200 Message-Id: <9453b9afb38ea4537598c2e8dfb8e73d94b90a2e.1600946371.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.11 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" 'virTestCompareToFile' automatically fixes newline if it is not present in the input string but is present in the file. In this case we need to append the erorr messages with a newline so that VIR_TEST_REGENERATE_OUTPUT produces files which will pass syntax-check. Fixes: 9ec77eef2df Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemuxml2argvtest.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a3c91fd5de..2b97eb80a4 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -621,9 +621,11 @@ testCompareXMLToArgv(const void *data) VIR_TEST_DEBUG("no error was reported for expected parse error= "); goto cleanup; } - if (flags & FLAG_EXPECT_PARSE_ERROR && - virTestCompareToFile(err->message, info->errfile) >=3D 0) - goto ok; + if (flags & FLAG_EXPECT_PARSE_ERROR) { + g_autofree char *tmperr =3D g_strdup_printf("%s\n", NULLSTR(er= r->message)); + if (virTestCompareToFile(tmperr, info->errfile) >=3D 0) + goto ok; + } goto cleanup; } if (flags & FLAG_EXPECT_PARSE_ERROR) { @@ -663,9 +665,11 @@ testCompareXMLToArgv(const void *data) VIR_TEST_DEBUG("no error was reported for expected failure"); goto cleanup; } - if (flags & FLAG_EXPECT_FAILURE && - virTestCompareToFile(err->message, info->errfile) >=3D 0) - goto ok; + if (flags & FLAG_EXPECT_FAILURE) { + g_autofree char *tmperr =3D g_strdup_printf("%s\n", NULLSTR(er= r->message)); + if (virTestCompareToFile(tmperr, info->errfile) >=3D 0) + goto ok; + } goto cleanup; } if (flags & FLAG_EXPECT_FAILURE) { --=20 2.26.2