From nobody Wed Dec 17 05:37:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1693556381; cv=none; d=zohomail.com; s=zohoarc; b=Di5AWZAnsRssjWOE6zR7J6rmLqYDIxxdbd7bEJT24M6XYP23IsQt2O3ral346x6NnwZOQ2pCTJNuHUK0/ZcmopRoKfNyeYe/aPcNsXH+kuSzqrucK/7forlvDymFPdusQjxdH8pnBo8/R7ufe+2aHGDu1GZ0RE+h2L05l67gmMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693556381; h=Content-Type:Content-Transfer-Encoding:Cc: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=UdClfRezOolMxr2jVFgcV7roDqVEVVl5npOmfhx4kWA=; b=bb8mqnsIhDkxNCP4ZJb/zmwfFFvvTnEFc7AqU0OJQo/hs78tOBoedNnKVibCZKBF2UTdkCKxbFjMbUtjncBOv6bvwx0+NO06LKm/AkmAgpTOqx09vAY/kT/3z7DWObZwkbnBZBCpR1mdLA+9JZUzOhit47tQTeJhHUpB6NMR6Gs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693556381011659.8027478342035; Fri, 1 Sep 2023 01:19:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbzMD-0006z7-Sf; Fri, 01 Sep 2023 04:18:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbzMA-0006xt-RT for qemu-devel@nongnu.org; Fri, 01 Sep 2023 04:18:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbzM8-00013k-Lt for qemu-devel@nongnu.org; Fri, 01 Sep 2023 04:18:18 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-670-WckBBvKrNA6PtniUBk-YGQ-1; Fri, 01 Sep 2023 04:18:13 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D22811C075A1; Fri, 1 Sep 2023 08:18:12 +0000 (UTC) Received: from localhost (unknown [10.39.194.146]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8401F2166B25; Fri, 1 Sep 2023 08:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693556296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UdClfRezOolMxr2jVFgcV7roDqVEVVl5npOmfhx4kWA=; b=WGhon3abZPCCL85a5aCfUNCZGxfQAVnXrMS/BByyEEwzGB2iBWo2LBIGdD0emK5nmPkfNN V3YYjZ9qMo/sAL04DnBBqHDeL+i4+2RFTyaPVmE8b05ujS00AxtKbWZykI08DPW3We64/M Y5ceFqMb+qRuAjC6Q9OqLG/YCuDAt/M= X-MC-Unique: WckBBvKrNA6PtniUBk-YGQ-1 From: Hanna Czenczek To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Hanna Czenczek Subject: [PULL 02/14] test-throttle: use enum ThrottleDirection Date: Fri, 1 Sep 2023 10:17:57 +0200 Message-ID: <20230901081804.31377-3-hreitz@redhat.com> In-Reply-To: <20230901081804.31377-1-hreitz@redhat.com> References: <20230901081804.31377-1-hreitz@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1693556382926100011 Content-Type: text/plain; charset="utf-8" From: zhenwei pi Use enum ThrottleDirection instead in the throttle test codes. Reviewed-by: Alberto Garcia Reviewed-by: Hanna Czenczek Signed-off-by: zhenwei pi Message-Id: <20230728022006.1098509-3-pizhenwei@bytedance.com> Signed-off-by: Hanna Czenczek --- tests/unit/test-throttle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c index 7adb5e6652..a60b5fe22e 100644 --- a/tests/unit/test-throttle.c +++ b/tests/unit/test-throttle.c @@ -169,8 +169,8 @@ static void test_init(void) =20 /* check initialized fields */ g_assert(tt->clock_type =3D=3D QEMU_CLOCK_VIRTUAL); - g_assert(tt->timers[0]); - g_assert(tt->timers[1]); + g_assert(tt->timers[THROTTLE_READ]); + g_assert(tt->timers[THROTTLE_WRITE]); =20 /* check other fields where cleared */ g_assert(!ts.previous_leak); @@ -191,7 +191,7 @@ static void test_destroy(void) throttle_timers_init(tt, ctx, QEMU_CLOCK_VIRTUAL, read_timer_cb, write_timer_cb, &ts); throttle_timers_destroy(tt); - for (i =3D 0; i < 2; i++) { + for (i =3D 0; i < THROTTLE_MAX; i++) { g_assert(!tt->timers[i]); } } --=20 2.41.0