From patchwork Thu Apr 20 01:56:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Bur X-Patchwork-Id: 752595 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w7hqF165kz9s3s for ; Thu, 20 Apr 2017 11:58:33 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3w7hqF0K90zDqJv for ; Thu, 20 Apr 2017 11:58:33 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3w7hpz4Z7vzDqFW for ; Thu, 20 Apr 2017 11:58:19 +1000 (AEST) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3K1rs95118108 for ; Wed, 19 Apr 2017 21:58:17 -0400 Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) by mx0b-001b2d01.pphosted.com with ESMTP id 29x75p984d-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 19 Apr 2017 21:58:16 -0400 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 20 Apr 2017 11:58:03 +1000 Received: from d23relay08.au.ibm.com (202.81.31.227) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 20 Apr 2017 11:58:02 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3K1vsYu32964608 for ; Thu, 20 Apr 2017 11:58:02 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v3K1vPjx022746 for ; Thu, 20 Apr 2017 11:57:25 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v3K1vPAg022407; Thu, 20 Apr 2017 11:57:25 +1000 Received: from camb691.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id BCFA0A0248; Thu, 20 Apr 2017 11:57:05 +1000 (AEST) From: Cyril Bur To: skiboot@lists.ozlabs.org Date: Thu, 20 Apr 2017 11:56:39 +1000 X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170420015639.4274-1-cyril.bur@au1.ibm.com> References: <20170420015639.4274-1-cyril.bur@au1.ibm.com> X-TM-AS-MML: disable x-cbid: 17042001-0008-0000-0000-00000120ABD2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042001-0009-0000-0000-0000094DE037 Message-Id: <20170420015639.4274-3-cyril.bur@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-19_16:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704200012 Subject: [Skiboot] [PATCH 2/2] libflash: More tests for blocklevel_smart_erase() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair@popple.id.au, mikey@neuling.org MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Because the only thing better than x tests is x+1 tests. Signed-off-by: Cyril Bur --- libflash/test/test-blocklevel.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libflash/test/test-blocklevel.c b/libflash/test/test-blocklevel.c index 4dbbb091..c394c824 100644 --- a/libflash/test/test-blocklevel.c +++ b/libflash/test/test-blocklevel.c @@ -432,5 +432,20 @@ int main(void) return 1; } + reset_buf(buf); + /* Test 9: Erase a biger section, not aligned */ + if (blocklevel_smart_erase(bl, 0x20, 0xa00)) { + ERR("Failed to blocklevel_smart_erase(0x20, 0xa00)\n"); + return 1; + } + miss = check_buf(buf, 0x20, 0xa20); + if (miss) { + ERR("Buffer mismatch after blocklevel_smart_erase(0x20, 0xa00) at 0x%x\n", + miss == -1 ? 0 : miss); + dump_buf(buf, 0x1c, 0x25, miss == -1 ? 0 : miss); + dump_buf(buf, 0xa1c, 0xa25, miss == -1 ? 0 : miss); + return 1; + } + return 0; }