Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4820562pxj; Tue, 25 May 2021 17:54:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGyyX+oSTnKD3UhjQQ7I42UEUK/lp9UJOwMAlV3sO3vDP91SwuQlXIE0AYVAuuZ0pGcNWl X-Received: by 2002:a05:6e02:882:: with SMTP id z2mr24280893ils.91.1621990481362; Tue, 25 May 2021 17:54:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621990481; cv=none; d=google.com; s=arc-20160816; b=EiaLKM+b06E8bwyVfXAWfdYGfErRXNMxITO7IKENSsWOH73Crw2hcgbEuhT8r3MmUb f7RoxqMhGAfAJyNNvcRHzr+Dj9s0MdMDMA/jfkUL0mEtX82fp9N8OJ7MHrYudUWZhV2M J3uJ8+3ES8Cwcy4njgIiCiECbIlZhNkjjlGYV+PScpCcxnxIWh3KZDYk6qawX/1J4rXA wlNsXmVQtQODN5HYNpSza2+zmgdVvcu7ru2rqkYA8dLUNN/W0gzfwym60FDw/w11gdCz XnwdR2bBJxO53gqsYVzWB93Ey8E2bit2Rp8UKlMvdTMkg9Walpyn5VtFBTYmdUWXTuGq nYCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=GQempG3zPiZex9R3bfuXqpxoSATyeQ/cMhmIoIe744M=; b=FRoqLo5qtmk2zukW70G/y3B4yQD+SyhDPZ1LzO1u6PQHiWvdUcuuKZq1GhaM1zExsj sFvHaLkBWIgD0UcfDuP9NQWxy7tZDbAPmKAPVDpd0c+qawlbJJjAm+2yl0v4Ac2E7OEl V6B5QjObCKOjDQ0Jn5aYFV37ALLLXtpF9Qcw4ZvLZFIJ0gkdzZ736VMsTiwgAPt5wC9B 6+kkjm8L1ndwgaCAW049aQ4RY+KmHrlmGToZ6WKVVnPmmw5npWbFCbr6bfLBFCtWWu5p TQyfUT9zVskDLHmX8r91E8U0H8zdNsepw5Kk5BRxPF5dLN64cK+WNUFbQnnAzpx106ww W6Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EWFbONyx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si13107276ile.141.2021.05.25.17.54.26; Tue, 25 May 2021 17:54:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EWFbONyx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232173AbhEYVLH (ORCPT + 99 others); Tue, 25 May 2021 17:11:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232141AbhEYVLG (ORCPT ); Tue, 25 May 2021 17:11:06 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C2C8C06175F for ; Tue, 25 May 2021 14:09:35 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id w12so30140806edx.1 for ; Tue, 25 May 2021 14:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GQempG3zPiZex9R3bfuXqpxoSATyeQ/cMhmIoIe744M=; b=EWFbONyxubWRiMtMDL8SRi/Gh6mggh42+mF4QvgnPSB8pxQV0ttRkmqRJsDhoebS8w fRDbcTl1uDQ46t69W+kQ40sffxU5OAvvuh2NdS8zwYMF1qoPrEvD+HtM1LOb4bQi0MRJ u0NPvNggdKJur61MhrH1ZEcjMkSO39HRIjBGS5zVvIDwBbENze/gJJD22x4OQXS5aBwB f6ClUjKEko1PWMCpZqrBMy1gQ7AS81K4YWhtMXRwsO9QoBpgyBS+AaWzH88IVlkpPWd5 lYgcTCYLU5es5zPfYbrBOxSsekj+88IIT4X4aY0qsVEmOBynUsLMAAxRsXYYJb9L4FdU RKcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GQempG3zPiZex9R3bfuXqpxoSATyeQ/cMhmIoIe744M=; b=oVodDSPQmaDMyfocD3VAqziG9NX/6BzxNgDUhDlL5l5HT3zzDnOFsY+VB4RIsfIasx Qh3yPbPCMU7bR0spJP9nKWZGwTrjv1IVdQIwEWe13ZyMO2FdTtKXnY1Hvyq6nLOwCP/Z HpV2hHAw5F23wEzLayV5Nmz9GWQ2S5pkVKM5H8xgoJOdgxmOevCafOTI2gU3D8eM2FN2 sFpnMM+CYfovm93xmxocF+0SbgL9P3X6WQFaxJMOsBTSsbqADesI4u7e6PbqribMHcYC s6ukRvzY91161KYL91u1FxEj30mxINg8YWgirNU1qCFjRlTvtoqDsj3j67d4oLjPF35D Kt9A== X-Gm-Message-State: AOAM533G6DcsNiULGVwyk5RfpYPtbg9hM6pdTMgvs7YHzpzqprSnGt14 nsZWCA/yTEvK/yLwFI0AG6NXcNQuhsCz4JDkQ4c= X-Received: by 2002:aa7:cc10:: with SMTP id q16mr34758122edt.53.1621976973943; Tue, 25 May 2021 14:09:33 -0700 (PDT) MIME-Version: 1.0 References: <20210525144250.214670-1-tpiepho@gmail.com> <20210525144250.214670-2-tpiepho@gmail.com> In-Reply-To: From: Trent Piepho Date: Tue, 25 May 2021 14:09:23 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] lib/math/rational: Add Kunit test cases To: Daniel Latypov Cc: Linux Kernel Mailing List , andy@kernel.org, Andrew Morton , Oskar Schirmer Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 25, 2021 at 10:34 AM Daniel Latypov wrote: > On Tue, May 25, 2021 at 7:43 AM Trent Piepho wrote: > > Adds a number of test cases that cover a range of possible code paths. > > > > Signed-off-by: Trent Piepho > > Reviewed-by: Daniel Latypov > > Looks really good to me, just two nits. > > Tangent: > I didn't check to see that this covers all the interesting cases, but > it seems like it does. > If you want, you can try generating a code coverage report to double check. > Instructions for doing so can be found in > https://lore.kernel.org/linux-kselftest/20210414222256.1280532-1-dlatypov@google.com/ > I would have done that and included the #s in this email, but my > workplace decided to subtly break my workstation in some way and I > haven't gotten around to root causing... I installed a gcc 6.4 toolchain and changed the uml_abort() call to exit(), coverage was generated, but still truncated and incorrectly near 0%. So what I did was crash after running all the test cases I cared about by dividing by zero and then coverage data was produced correctly. It's 100% by lines. But I think both possibilities when the largest semiconvergent is exactly half the previous convergent aren't tested. > > lib/math/rational-test.c | 56 ++++++++++++++++++++++++++++++++++++++++ > > Ah, sorry, I forgot to mention this in the previous email. > If you look at kunit/style.rst docs, you'll see the documentation now > states a preference for the name of this file to be one of > {rational_test.c, rational_kunit.c} Before I chose a name, I checked every file with kunit tests cases, and *-test was the most common naming pattern, including the sample case. I would be nice if changing the docs to say something is a standard also updated the code to make that reality.