From patchwork Wed Jul 27 22:16:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 9250453 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D5A546077C for ; Wed, 27 Jul 2016 22:18:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5A86208C2 for ; Wed, 27 Jul 2016 22:18:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA41226530; Wed, 27 Jul 2016 22:18:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 05761208C2 for ; Wed, 27 Jul 2016 22:18:15 +0000 (UTC) Received: from localhost ([::1]:49016 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSX9a-0005aw-43 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 27 Jul 2016 18:18:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSX90-0005YB-7L for qemu-devel@nongnu.org; Wed, 27 Jul 2016 18:17:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSX8v-00042l-P4 for qemu-devel@nongnu.org; Wed, 27 Jul 2016 18:17:37 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:21764 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSX8v-0003t4-Hi; Wed, 27 Jul 2016 18:17:33 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BiAgC8MZlX/5tjdVtdHQGDIYFSjSuWSQEBAQEBAQUBgQ8BkVWCD4F9hh0CgTc4FAEBAQEBAQFdJ4RdAgR5ED8SPBsZiDUBu3kBMIVigkiHWYUPBY8GiiuOfIFtjVOGYolDHjaBP1EcgU9riEABAQE X-IPAS-Result: A2BiAgC8MZlX/5tjdVtdHQGDIYFSjSuWSQEBAQEBAQUBgQ8BkVWCD4F9hh0CgTc4FAEBAQEBAQFdJ4RdAgR5ED8SPBsZiDUBu3kBMIVigkiHWYUPBY8GiiuOfIFtjVOGYolDHjaBP1EcgU9riEABAQE X-IronPort-AV: E=Sophos;i="5.28,431,1464645600"; d="scan'208";a="89389318" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 28 Jul 2016 00:16:56 +0200 Received: from a88-114-146-42.elisa-laajakaista.fi ([88.114.146.42] helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim) id 1bSX8K-0004EH-5D; Thu, 28 Jul 2016 00:16:56 +0200 Received: from berto by perseus.local with local (Exim 4.87) (envelope-from ) id 1bSX86-0006Li-Pg; Thu, 28 Jul 2016 01:16:42 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Thu, 28 Jul 2016 01:16:09 +0300 Message-Id: <989cf48dc8f92ee1305b1e53107264e259af3692.1469657519.git.berto@igalia.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.51.32.191 Subject: [Qemu-devel] [PATCH for-2.7 2/2] throttle: Test burst limits lower than the normal limits X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gu Nini , Alberto Garcia , Stefan Hajnoczi , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This checks that making FOO_max lower than FOO is not allowed. We could also forbid having FOO_max == FOO, but that doesn't have any odd side effects and it would require us to update several other tests, so let's keep it simple. Signed-off-by: Alberto Garcia --- tests/test-throttle.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test-throttle.c b/tests/test-throttle.c index afe094b..363b59a 100644 --- a/tests/test-throttle.c +++ b/tests/test-throttle.c @@ -394,6 +394,14 @@ static void test_max_is_missing_limit(void) cfg.buckets[i].max = 0; cfg.buckets[i].avg = 100; g_assert(throttle_is_valid(&cfg, NULL)); + + cfg.buckets[i].max = 30; + cfg.buckets[i].avg = 100; + g_assert(!throttle_is_valid(&cfg, NULL)); + + cfg.buckets[i].max = 100; + cfg.buckets[i].avg = 100; + g_assert(throttle_is_valid(&cfg, NULL)); } }