From nobody Thu May 16 05:36:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1604366858; cv=none; d=zohomail.com; s=zohoarc; b=f+TUkUwFDWJ2AADzCPfuzMc/x6EuURtiGIahOX+81h2MdzAbxCLcvBTaeNwPd4qHsRGdrOdW+JEyIWeJAlSxcrsyjjS5LBOBMOLQakgY0PnlP/pVJyW5CRNv2eDUIwZ4rckDYRy7HaBMve3bmGCT7v1mDR+NodY9BAfoQdCUnCU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604366858; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=JxK2qxZcV+rPyxQ1iJcsq+gn9Mog1owPmmvYNPYF1iM=; b=KuuIers1Mh35B4ISVZAknvEaRS9oUs0+vfq+oKL2TTkVif2WQDU1nOvw/jahRswM/h3eD07sHl0nx29m8bP/SXwXHdxa5teVqSAVMbkQJCWLTmqd8BtyAi+Avt6bvrS/2TOADBqGCQqguYayrHsxkE+PlcuPH8tbvHLscx5RGkQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1604366857969354.86436728564354; Mon, 2 Nov 2020 17:27:37 -0800 (PST) Received: from localhost ([::1]:54202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZl6m-0007te-I5 for importer@patchew.org; Mon, 02 Nov 2020 20:27:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3IK-gXwsKCgUmxpnssjrtjslttlqj.htrvjrz-ij0jqstslsz.twl@flex--hskinnemoen.bounces.google.com>) id 1kZkuu-00083b-6k for qemu-devel@nongnu.org; Mon, 02 Nov 2020 20:15:20 -0500 Received: from mail-pf1-x44a.google.com ([2607:f8b0:4864:20::44a]:50328) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3IK-gXwsKCgUmxpnssjrtjslttlqj.htrvjrz-ij0jqstslsz.twl@flex--hskinnemoen.bounces.google.com>) id 1kZkur-0005ml-BZ for qemu-devel@nongnu.org; Mon, 02 Nov 2020 20:15:19 -0500 Received: by mail-pf1-x44a.google.com with SMTP id a27so11145379pfl.17 for ; Mon, 02 Nov 2020 17:15:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=JxK2qxZcV+rPyxQ1iJcsq+gn9Mog1owPmmvYNPYF1iM=; b=DOME5NaItIC85TrLnDTLYORe7ados5XlgIBx1gK0bFKpLvfwoaJRcXWasPu7yXvtc8 yxX/OUu3genXtvynWXcGoZV1DNNQbuf7pphjBckO4mjuYx/LKkvMKOlqCBbE3++AjXlF 4Lx7m3/zzDpZFfMkepKPd+yB2st195k+djnDcaO1fMq20UmcixdGxjQ4cu32w6+YsTFy WoDSol0dm0+VncIAWrzw/zuPfBJiTCPzYxpEdXV+U5LO8FmpgCKdmmtRlzwgik5nID7i atCIFx4VR+n/fORExJX5p9kEuNt00hbGYE/LqQmXZIPF3dHyJ0jabZHJZYeAs1SDjX9S GxDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=JxK2qxZcV+rPyxQ1iJcsq+gn9Mog1owPmmvYNPYF1iM=; b=oTVGRBe9N2LDaTpZNJ8KyEnr8azgM9VueN4sKi53KbFbveCRF2HQP2UItu5XX5CN9E qElXhB9XSrrMaZClbnkJgPxs7eZiJ2A6SOpHZCuk/lTPlKVjQ8FO02mAmqVzOFMnprAs RnUBMwMEFp7GcpltDKQcx/CvMzpTDEXtlKY3uSErHdJWhWQeAdSfTEu2E9PJt8tfIoKd xZj35cyG/Z3b7STvO6PwdtU7mR6wmW8ECkB2PLfx7gX58TK4J0XIiEpj45cYkhmS9XRW iDttP2ehYIptqYv5SYSOdCoGTb76bv2OBjMVgn0jEWauVw9II/n7zOQKEOC+Y7L/9Xjv IRFA== X-Gm-Message-State: AOAM533Duwb+xEAA64P5jhgdU0+F30TsiBjujguMKKRukhwwdW2nmLQh 8nHH8fhNCtE9PXwiHnwXUTk628tyMGkKTsHuGQ== X-Google-Smtp-Source: ABdhPJymiOKCRhYspQBRVoTrZmAS/nFM+jaGQLJ0S4ppk1fBe9cfRT/8O1qzS9m9p3fElXyws8YonsXZuFrzDirn3w== X-Received: from skybert.c.googlers.com ([fda3:e722:ac3:10:24:72f4:c0a8:3107]) (user=hskinnemoen job=sendgmr) by 2002:aa7:8a8e:0:b029:160:1a45:a6e6 with SMTP id a14-20020aa78a8e0000b02901601a45a6e6mr24557129pfc.54.1604366112810; Mon, 02 Nov 2020 17:15:12 -0800 (PST) Date: Mon, 2 Nov 2020 17:14:55 -0800 In-Reply-To: <20201103011457.2959989-1-hskinnemoen@google.com> Message-Id: <20201103011457.2959989-2-hskinnemoen@google.com> Mime-Version: 1.0 References: <20201103011457.2959989-1-hskinnemoen@google.com> X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH 1/3] tests/qtest/npcm7xx_rng-test: count runs properly To: peter.maydell@linaro.org Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Havard Skinnemoen 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=2607:f8b0:4864:20::44a; envelope-from=3IK-gXwsKCgUmxpnssjrtjslttlqj.htrvjrz-ij0jqstslsz.twl@flex--hskinnemoen.bounces.google.com; helo=mail-pf1-x44a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Reply-to: Havard Skinnemoen From: Havard Skinnemoen via X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The number of runs is equal to the number of 0-1 and 1-0 transitions, plus one. Currently, it's counting the number of times these transitions do _not_ happen, plus one. Source: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-22r1a= .pdf section 2.3.4 point (3). Signed-off-by: Havard Skinnemoen --- tests/qtest/npcm7xx_rng-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/npcm7xx_rng-test.c b/tests/qtest/npcm7xx_rng-test.c index da6e639bf6..57787c5ffc 100644 --- a/tests/qtest/npcm7xx_rng-test.c +++ b/tests/qtest/npcm7xx_rng-test.c @@ -126,7 +126,7 @@ static double calc_runs_p(const unsigned long *buf, uns= igned int nr_bits) pi =3D (double)nr_ones / nr_bits; =20 for (k =3D 0; k < nr_bits - 1; k++) { - vn_obs +=3D !(test_bit(k, buf) ^ test_bit(k + 1, buf)); + vn_obs +=3D (test_bit(k, buf) ^ test_bit(k + 1, buf)); } vn_obs +=3D 1; =20 --=20 2.29.1.341.ge80a0c044ae-goog From nobody Thu May 16 05:36:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1604367612; cv=none; d=zohomail.com; s=zohoarc; b=AXDkbzWvv54ljtayVsgqaQu591ZQn2nhv6mYbg7Tauf1pYHCzhSXc5FL0/0dv576D4IUxr49ZjkL0OFIA/4SxdSigL6SJMCowjUyVrkZGSZMC7H7IXnrEqA2thsdxPBmEBFalfwnct/FX/V1t4ZEIfxvuKX3n4K9tXmV1YubL8o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604367612; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=SJM2AYQixjJryNNj/i7eG9v9yAAu5bw1l8yViAnTvj4=; b=aPPEJ0ke65g5tfHvEANcs9Mp4QThKfy57p/Ma4vOyLjRfA7ySv8l5YcGvJ8GSnfetVdZ5/tVZbL7an5T8Lzz6wkg9gJj0mbEXOQUbgKel0YjlBObK/2IwWdjcedqFCCve6lBr4XwxyBkDyk00JZmweG43/6tIo3qIkCSmn+Fh/M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1604367612393850.5644328120711; Mon, 2 Nov 2020 17:40:12 -0800 (PST) Received: from localhost ([::1]:39670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZlIv-0005mR-OB for importer@patchew.org; Mon, 02 Nov 2020 20:40:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3Iq-gXwsKCgcozrpuultvlunvvnsl.jvtxlt1-kl2lsuvunu1.vyn@flex--hskinnemoen.bounces.google.com>) id 1kZkut-00082g-Do for qemu-devel@nongnu.org; Mon, 02 Nov 2020 20:15:19 -0500 Received: from mail-pl1-x649.google.com ([2607:f8b0:4864:20::649]:45198) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3Iq-gXwsKCgcozrpuultvlunvvnsl.jvtxlt1-kl2lsuvunu1.vyn@flex--hskinnemoen.bounces.google.com>) id 1kZkur-0005nZ-BZ for qemu-devel@nongnu.org; Mon, 02 Nov 2020 20:15:19 -0500 Received: by mail-pl1-x649.google.com with SMTP id m7so6640414pls.12 for ; Mon, 02 Nov 2020 17:15:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=SJM2AYQixjJryNNj/i7eG9v9yAAu5bw1l8yViAnTvj4=; b=q9q40D6bxBCEqS6/6skOnTYnQSFABghCHv/Qk8DturrbS5Azv0zmaWXFnTPERZJS10 a2dZTr0XBQtaBWh8OAcWhr473g02yuPqEtRpGIzOij0z/YPjvWBH5UPyXw56Rem8AHsA 7oeo2AfD85D072avgcpwUXyQdPMnZGjYg5EZiff+6kDckajUx4LCooDdePVQOyE/LO7a ecU1MhJNpOnhHxoO/Uq20XNZn+mENbmigo+QkJida+QMZR8J6HdojyyYc37v/RZDpXp1 SASsNaRv/inLl2/trH+b2PIawvvXZ9oV+cue1QJyBCELSAbvL+5PhN+V3AC/Zj5OfZV+ dsSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=SJM2AYQixjJryNNj/i7eG9v9yAAu5bw1l8yViAnTvj4=; b=prM91HbnBxNoFPkJLO/k67fzRAto4h3KlHsJJI1s6+On0XGuagjwK+lgkEQTtk5T+1 f0dgKkafpwviEDfDDEzzG5DcyPG599X4s8nQgRu9KinIQLngcdO7gkDsCijSF+0PJ0oR d8xDpM1wCg2L/F00fWts1QHc6yom7dVukSuiBULdZaftvGX9YVSzwF0zZ0C6PN6jzZpn 04WJYCzwpByruUpK3SDFe9tJtlB5yF7igEMCjarBPOhOQ1pgLdrTIdwjhO7l4iKjm18K PlZGPy5agHeq2QemRqdguxdI5QwEiICL5yuUz6s8RZb4QkV0OanqQ/hgqecred3byqts iHyQ== X-Gm-Message-State: AOAM531OhTJAGsfqVKU3oMHmCcwKjPOmcqN+DKKZ6J4b7xgkZko1AAQ5 z9rWP0N1cFukiXGZxJcXLQJYF8bhW6y57w+6+A== X-Google-Smtp-Source: ABdhPJzAdMIE2QxnQA19A1kQS4VEBbdymMGt035KuSl8+LgGFGBFbMfO60hljTV4XlOTPqN4qy7lt7rHT+w6rK5oDQ== X-Received: from skybert.c.googlers.com ([fda3:e722:ac3:10:24:72f4:c0a8:3107]) (user=hskinnemoen job=sendgmr) by 2002:aa7:83d7:0:b029:164:28d:f350 with SMTP id j23-20020aa783d70000b0290164028df350mr23235253pfn.71.1604366114522; Mon, 02 Nov 2020 17:15:14 -0800 (PST) Date: Mon, 2 Nov 2020 17:14:56 -0800 In-Reply-To: <20201103011457.2959989-1-hskinnemoen@google.com> Message-Id: <20201103011457.2959989-3-hskinnemoen@google.com> Mime-Version: 1.0 References: <20201103011457.2959989-1-hskinnemoen@google.com> X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH 2/3] tests/qtest/npcm7xx: Don't call g_test_set_nonfatal_assertions To: peter.maydell@linaro.org Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Havard Skinnemoen 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=2607:f8b0:4864:20::649; envelope-from=3Iq-gXwsKCgcozrpuultvlunvvnsl.jvtxlt1-kl2lsuvunu1.vyn@flex--hskinnemoen.bounces.google.com; helo=mail-pl1-x649.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Reply-to: Havard Skinnemoen From: Havard Skinnemoen via X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Even though g_test_set_nonfatal_assertions() makes test failure reporting a lot better, no other tests currently do this so we'll turn it off as well. Signed-off-by: Havard Skinnemoen --- tests/qtest/npcm7xx_gpio-test.c | 1 - tests/qtest/npcm7xx_rng-test.c | 1 - tests/qtest/npcm7xx_timer-test.c | 1 - tests/qtest/npcm7xx_watchdog_timer-test.c | 1 - 4 files changed, 4 deletions(-) diff --git a/tests/qtest/npcm7xx_gpio-test.c b/tests/qtest/npcm7xx_gpio-tes= t.c index 1004cef812..3af49173a7 100644 --- a/tests/qtest/npcm7xx_gpio-test.c +++ b/tests/qtest/npcm7xx_gpio-test.c @@ -357,7 +357,6 @@ int main(int argc, char **argv) int i; =20 g_test_init(&argc, &argv, NULL); - g_test_set_nonfatal_assertions(); =20 qtest_add_func("/npcm7xx_gpio/dout_to_din", test_dout_to_din); qtest_add_func("/npcm7xx_gpio/pullup_pulldown", test_pullup_pulldown); diff --git a/tests/qtest/npcm7xx_rng-test.c b/tests/qtest/npcm7xx_rng-test.c index 57787c5ffc..d7e42cf062 100644 --- a/tests/qtest/npcm7xx_rng-test.c +++ b/tests/qtest/npcm7xx_rng-test.c @@ -261,7 +261,6 @@ int main(int argc, char **argv) int ret; =20 g_test_init(&argc, &argv, NULL); - g_test_set_nonfatal_assertions(); =20 qtest_add_func("npcm7xx_rng/enable_disable", test_enable_disable); qtest_add_func("npcm7xx_rng/rosel", test_rosel); diff --git a/tests/qtest/npcm7xx_timer-test.c b/tests/qtest/npcm7xx_timer-t= est.c index f08b0cd62a..77e6e0d472 100644 --- a/tests/qtest/npcm7xx_timer-test.c +++ b/tests/qtest/npcm7xx_timer-test.c @@ -530,7 +530,6 @@ int main(int argc, char **argv) int i, j; =20 g_test_init(&argc, &argv, NULL); - g_test_set_nonfatal_assertions(); =20 for (i =3D 0; i < ARRAY_SIZE(timer_block); i++) { for (j =3D 0; j < ARRAY_SIZE(timer); j++) { diff --git a/tests/qtest/npcm7xx_watchdog_timer-test.c b/tests/qtest/npcm7x= x_watchdog_timer-test.c index 54d5d6d8f2..426303ecfa 100644 --- a/tests/qtest/npcm7xx_watchdog_timer-test.c +++ b/tests/qtest/npcm7xx_watchdog_timer-test.c @@ -303,7 +303,6 @@ static void watchdog_add_test(const char *name, const W= atchdog* wd, int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); - g_test_set_nonfatal_assertions(); =20 for (int i =3D 0; i < ARRAY_SIZE(watchdog_list); ++i) { const Watchdog *wd =3D &watchdog_list[i]; --=20 2.29.1.341.ge80a0c044ae-goog From nobody Thu May 16 05:36:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1604367734; cv=none; d=zohomail.com; s=zohoarc; b=D4UCKY70wF8iKzEQLmacQlKYemEJgt4zOj/+2CfTU3wpxsDeICxb9cdhd9LNhbpYQPmolbKH0wqOvYTE7JnDihLedLnsuthLdxq/mDmta+A1uY9jzo5zCoui+oZ/ChHroz71MPYTcxPxlWUvmTbnl17boi0/vSVQ6yk6ZwU13zs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604367734; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=wh8or+ljt8at2k22dVmhE1DVFpTtQWKhA+UBKQ4cAts=; b=iFmwWDnBoFGpSljwXy9agThBEdzYekYwSchiZNpEjp7uDgxvapxfv7L3nN/ZvVzRsGl80qVU9Pguan435uhm475FBhs9u4eCV883UE2JaEZjgW9nkrbu5I2X2kSo6zgjjsSx+TzrMZFXkj08cQ8Sjh8lakYIaoxEaItPQnhWiPg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1604367734639280.26289899953895; Mon, 2 Nov 2020 17:42:14 -0800 (PST) Received: from localhost ([::1]:41798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZlKv-0006r1-DZ for importer@patchew.org; Mon, 02 Nov 2020 20:42:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3JK-gXwsKCgkq1trwwnvxnwpxxpun.lxvznv3-mn4nuwxwpw3.x0p@flex--hskinnemoen.bounces.google.com>) id 1kZkuy-00089j-1P for qemu-devel@nongnu.org; Mon, 02 Nov 2020 20:15:24 -0500 Received: from mail-pf1-x449.google.com ([2607:f8b0:4864:20::449]:45923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3JK-gXwsKCgkq1trwwnvxnwpxxpun.lxvznv3-mn4nuwxwpw3.x0p@flex--hskinnemoen.bounces.google.com>) id 1kZkus-0005oI-MY for qemu-devel@nongnu.org; Mon, 02 Nov 2020 20:15:23 -0500 Received: by mail-pf1-x449.google.com with SMTP id z125so11171785pfc.12 for ; Mon, 02 Nov 2020 17:15:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=wh8or+ljt8at2k22dVmhE1DVFpTtQWKhA+UBKQ4cAts=; b=nQVmqZ8XyFRGjHxkqAqM2KV9yUisj+53aAzuzVrF8WUSTM4tbMQWdHYNV7CgccJf4C y56exMQjJV7td45J3c0m25xxCNACAyNuirn3+b0lBh25r1qnQaTdrDwazWl0jLDEAkw5 UlH0Nwvtu3uYMexVx5Y15FxdMG0NOoaRwCDoCKKzY5VyxNGxVP3ZM5WozGajzL3VwEr6 XVLkZkhrCcpAb9H+ByZNE0D2hRYrkTp+UcU+f++EwrdgEvHiSQ5isJyZrcuRJ82V9uAQ L9FvdIFokbu6nbKHG6PPPgKX5KFRyDpiv8i9oVsI5RxyZG5KsSQeEFI9VOArEESd3imy odJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=wh8or+ljt8at2k22dVmhE1DVFpTtQWKhA+UBKQ4cAts=; b=qSOROadmrA2xxBOvryewU7iN/5MMdD908f9TWwN8lxy5C+dcpAg0H8ycJdV5eK1ZDs Wpufpplsrp3WWKcWC5iLQlnltEKjJz0LDt/yO+8Z4lEmHX/Vq4QcCOxslSPoc6oipHTF NCAvM6QXH9rQG5W6B7hunvRMCAVvyyHGzsDIig5vmTiXg7fT1NgueiFQXRGw4nlVKF/u Kp1B/eq0JkXY6jLNjsWZcFPgE3/DXJmYLBo+Z4H6ii+Zz6QbI5oXoBnOH5QHCS6vj/BC CMVWy3Ng360rB6w/ysNg0dCbPuYHXhidnxkGeDp+aodqfHP7uySmAbN0Oac/OJ+W2VQ4 qu8Q== X-Gm-Message-State: AOAM531S7l7cotq5rK7YbMvIkog7YiB0aZbik1bLdegBxShmO/j5sMkc ZKfakPyy+jx/jn/TsUdR5UL7k35/nsquftYf4Q== X-Google-Smtp-Source: ABdhPJwfFxHjf2wFERbw8WceoQn6LU6bpiReTVxyGaXL/3VVUwmRwqaX7X5r5IkEsxJuP7a+W3edfFD4pnvsKZHPzA== X-Received: from skybert.c.googlers.com ([fda3:e722:ac3:10:24:72f4:c0a8:3107]) (user=hskinnemoen job=sendgmr) by 2002:a62:7cd4:0:b029:152:b3e8:c59f with SMTP id x203-20020a627cd40000b0290152b3e8c59fmr23027135pfc.2.1604366116071; Mon, 02 Nov 2020 17:15:16 -0800 (PST) Date: Mon, 2 Nov 2020 17:14:57 -0800 In-Reply-To: <20201103011457.2959989-1-hskinnemoen@google.com> Message-Id: <20201103011457.2959989-4-hskinnemoen@google.com> Mime-Version: 1.0 References: <20201103011457.2959989-1-hskinnemoen@google.com> X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH 3/3] tests/qtest/npcm7xx_rng-test: dump random data on failure To: peter.maydell@linaro.org Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Havard Skinnemoen 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=2607:f8b0:4864:20::449; envelope-from=3JK-gXwsKCgkq1trwwnvxnwpxxpun.lxvznv3-mn4nuwxwpw3.x0p@flex--hskinnemoen.bounces.google.com; helo=mail-pf1-x449.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" Reply-to: Havard Skinnemoen From: Havard Skinnemoen via X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Dump the collected random data after a randomness test failure. Note that you won't actually see this unless you add g_test_set_nonfatal_assertions() back in. Signed-off-by: Havard Skinnemoen --- tests/qtest/npcm7xx_rng-test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/qtest/npcm7xx_rng-test.c b/tests/qtest/npcm7xx_rng-test.c index d7e42cf062..09111d640c 100644 --- a/tests/qtest/npcm7xx_rng-test.c +++ b/tests/qtest/npcm7xx_rng-test.c @@ -20,6 +20,7 @@ =20 #include "libqtest-single.h" #include "qemu/bitops.h" +#include "qemu-common.h" =20 #define RNG_BASE_ADDR 0xf000b000 =20 @@ -36,6 +37,13 @@ /* Number of bits to collect for randomness tests. */ #define TEST_INPUT_BITS (128) =20 +static void dump_buf_if_failed(const uint8_t *buf, size_t size) +{ + if (g_test_failed()) { + qemu_hexdump(stderr, "", buf, size); + } +} + static void rng_writeb(unsigned int offset, uint8_t value) { writeb(RNG_BASE_ADDR + offset, value); @@ -188,6 +196,7 @@ static void test_continuous_monobit(void) } =20 g_assert_cmpfloat(calc_monobit_p(buf, sizeof(buf)), >, 0.01); + dump_buf_if_failed(buf, sizeof(buf)); } =20 /* @@ -209,6 +218,7 @@ static void test_continuous_runs(void) } =20 g_assert_cmpfloat(calc_runs_p(buf.l, sizeof(buf) * BITS_PER_BYTE), >, = 0.01); + dump_buf_if_failed(buf.c, sizeof(buf)); } =20 /* @@ -230,6 +240,7 @@ static void test_first_byte_monobit(void) } =20 g_assert_cmpfloat(calc_monobit_p(buf, sizeof(buf)), >, 0.01); + dump_buf_if_failed(buf, sizeof(buf)); } =20 /* @@ -254,6 +265,7 @@ static void test_first_byte_runs(void) } =20 g_assert_cmpfloat(calc_runs_p(buf.l, sizeof(buf) * BITS_PER_BYTE), >, = 0.01); + dump_buf_if_failed(buf.c, sizeof(buf)); } =20 int main(int argc, char **argv) --=20 2.29.1.341.ge80a0c044ae-goog