From patchwork Wed Oct 10 05:19:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 981687 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42VMrC1b3fz9sB7 for ; Wed, 10 Oct 2018 16:20:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42VMrB5XZjzDrTQ for ; Wed, 10 Oct 2018 16:20:42 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=stewart@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com 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 42VMqN69MbzF2R7 for ; Wed, 10 Oct 2018 16:20:00 +1100 (AEDT) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9A5Iq5O146100 for ; Wed, 10 Oct 2018 01:19:58 -0400 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0a-001b2d01.pphosted.com with ESMTP id 2n1a4rt6t7-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 10 Oct 2018 01:19:58 -0400 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Oct 2018 01:19:57 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 10 Oct 2018 01:19:56 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9A5Jtc245613248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 10 Oct 2018 05:19:55 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 53523112064 for ; Wed, 10 Oct 2018 01:19:17 -0400 (EDT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C6384112062 for ; Wed, 10 Oct 2018 01:19:16 -0400 (EDT) Received: from birb.localdomain (unknown [9.81.205.182]) by b01ledav004.gho.pok.ibm.com (Postfix) with SMTP for ; Wed, 10 Oct 2018 01:19:16 -0400 (EDT) Received: by birb.localdomain (Postfix, from userid 1000) id 393874EC64D; Wed, 10 Oct 2018 16:19:51 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Wed, 10 Oct 2018 16:19:49 +1100 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181010051950.13202-1-stewart@linux.ibm.com> References: <20181010051950.13202-1-stewart@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18101005-0064-0000-0000-0000035D0969 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009852; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000268; SDB=6.01100468; UDB=6.00569370; IPR=6.00880516; MB=3.00023689; MTD=3.00000008; XFM=3.00000015; UTC=2018-10-10 05:19:57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18101005-0065-0000-0000-00003AEDEEC9 Message-Id: <20181010051950.13202-5-stewart@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-10-10_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=949 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810100053 Subject: [Skiboot] [PATCH 4/5] core/device: increase test coverage for dt_new_addr and dt_new_2addr X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Stewart Smith --- core/test/run-device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/test/run-device.c b/core/test/run-device.c index 727b14fffe43..076ec2489def 100644 --- a/core/test/run-device.c +++ b/core/test/run-device.c @@ -166,12 +166,14 @@ int main(void) assert(dt_find_by_name(root, "addr@1337") == addr1); assert(dt_find_by_name_addr(root, "addr", 0x1337) == addr1); assert(dt_find_by_path(root, "/addrs/addr@1337") == addr1); + assert(dt_new_addr(addrs, "addr", 0x1337) == NULL); addr2 = dt_new_2addr(addrs, "2addr", 0xdead, 0xbeef); assert(!list_top(&addr2->properties, struct dt_property, list)); check_path(addr2, "/addrs/2addr@dead,beef"); assert(dt_find_by_name(root, "2addr@dead,beef") == addr2); assert(dt_find_by_path(root, "/addrs/2addr@dead,beef") == addr2); + assert(dt_new_2addr(addrs, "2addr", 0xdead, 0xbeef) == NULL); /* Test walking the tree, checking and setting values */ for (n = 0, i = dt_first(root); i; i = dt_next(root, i), n++) {