From nobody Sun Feb 8 03:38:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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=1571925427; cv=none; d=zoho.com; s=zohoarc; b=IrU5cx9hnmdthzd+qmk/hHcg5jeovvxc+Ue65vk9ous9EBMsxZMPcXMama91qtKTwfLHPXQPdNWleMH4QyM3iI6CJqH7G3hFuWKoy1Sdrr5p2ZA21Uscpdu7wEb9a1NzmdHN/TtrCW9P9xnvbmrudR4//ZbhXJtVERAT9oF15+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571925427; 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=HiY3pK72Ny+ntUyLJ5JlHNOfs3jVw19aovt3Lq0/AR0=; b=l6/Dykp9/a4ISPPRfqg7Cojxv/RgSfT1s1PSr0eJesbSwLgbTy4UFpHYjqgir1zWq+9zzIB2Yg6jiW7emcox9QI15KI60phk/NFKxKF9mYDlndBA0pjlCckcisNWQ1MuD3OmkMr5p/fxjxfxHNOhcuwsZLcIjlkM58MKsEObmZ8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1571925427318308.0491710046455; Thu, 24 Oct 2019 06:57:07 -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-194-u-jzUtWCMoW1Pi9jK7D7Ig-1; Thu, 24 Oct 2019 09:57:02 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 59FA7100551E; Thu, 24 Oct 2019 13:56:56 +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 341695DA8D; Thu, 24 Oct 2019 13:56:56 +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 EC69C4E58C; Thu, 24 Oct 2019 13:56:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9ODus1L026364 for ; Thu, 24 Oct 2019 09:56:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 06FB010098FB; Thu, 24 Oct 2019 13:56:54 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8411110027A9 for ; Thu, 24 Oct 2019 13:56:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571925426; 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=HiY3pK72Ny+ntUyLJ5JlHNOfs3jVw19aovt3Lq0/AR0=; b=hcyZInx/c3XCLkZQqooAqUgvhZ2n9OzsK4AEspsYZgE6uIqAwMQmVXzbXPN+ZXqT1zNIUv F4u1RKNJL8TA2oLX0eJOhKgocrwvOL8CHkqmD9uOOcKd1eyLpx86l4sQInTw4IZ+2LdQ+2 xLMX6ch8OPllTxoPS4smHy9PEP1ZYkI= From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 24 Oct 2019 15:56:26 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/19] tests: virbuffer: Drop 'infinite loop' tests 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.14 X-MC-Unique: u-jzUtWCMoW1Pi9jK7D7Ig-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The tests are deeply based on internals of virBuffer which will be replaced in an upcoming patch with glib's GString. Remove the tests. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/virbuftest.c | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/tests/virbuftest.c b/tests/virbuftest.c index 246c572bd2..21b6295bb3 100644 --- a/tests/virbuftest.c +++ b/tests/virbuftest.c @@ -13,45 +13,6 @@ struct testInfo { int doEscape; }; -static int testBufInfiniteLoop(const void *data) -{ - virBuffer bufinit =3D VIR_BUFFER_INITIALIZER; - virBufferPtr buf =3D &bufinit; - char *addstr =3D NULL, *bufret =3D NULL; - int ret =3D -1; - const struct testInfo *info =3D data; - int len; - - virBufferAddChar(buf, 'a'); - - /* - * Infinite loop used to trigger if: - * (strlen + 1 > 1000) && (strlen =3D=3D buf-size - buf-use - 1) - * which was the case after the above addchar at the time of the bug. - * This test is a bit fragile, since it relies on virBuffer internals. - */ - len =3D buf->size - buf->use - 1; - if (virAsprintf(&addstr, "%*s", len, "a") < 0) - goto out; - - if (info->doEscape) - virBufferEscapeString(buf, "%s", addstr); - else - virBufferAsprintf(buf, "%s", addstr); - - ret =3D 0; - out: - bufret =3D virBufferContentAndReset(buf); - if (!bufret) { - VIR_TEST_DEBUG("Buffer had error set"); - ret =3D -1; - } - - VIR_FREE(addstr); - VIR_FREE(bufret); - return ret; -} - static int testBufAutoIndent(const void *data G_GNUC_UNUSED) { virBuffer bufinit =3D VIR_BUFFER_INITIALIZER; @@ -450,8 +411,6 @@ mymain(void) ret =3D -1; \ } while (0) - DO_TEST("EscapeString infinite loop", testBufInfiniteLoop, 1); - DO_TEST("VSprintf infinite loop", testBufInfiniteLoop, 0); DO_TEST("Auto-indentation", testBufAutoIndent, 0); DO_TEST("Trim", testBufTrim, 0); DO_TEST("AddBuffer", testBufAddBuffer, 0); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list