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: 653504 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s08Xl64sDz9t88 for ; Thu, 28 Jul 2016 08:19:03 +1000 (AEST) Received: from localhost ([::1]:49021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSXAL-0007Dk-O8 for incoming@patchwork.ozlabs.org; Wed, 27 Jul 2016 18:19:01 -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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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)); } }