Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp832501pxb; Fri, 16 Apr 2021 21:18:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTmPzCYiXFQTapZU2hNia57ZVDxIaiN+rZu1vk7dVx79Ro7O3A/h0gMWM9GFXyx2uKhM0O X-Received: by 2002:aa7:cb0a:: with SMTP id s10mr13623004edt.36.1618633112092; Fri, 16 Apr 2021 21:18:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618633112; cv=none; d=google.com; s=arc-20160816; b=QA+MwRmtHCUHlVVOZHoeug8nJbibX+meMyjMmCagatE7JUyWVPVw7loSUpiLmHPvuR dNhMrCV15Ilqfw3QbzCw24snYdBmCB5IDeNGVfGAy3jZeK//V/8qkVtqdb0nf6z6lWKQ dpu3Wpv6IerdQ8Bk1Iwb+4vPLPEnyhNQR7v2PhkfyHTH7CJa0CduAjlH259/AbHyIRPx rTSqpxvjrRNNgm8bFuzVUlv7iHA3caiN499jmG2T6Soloka1gDysiS2oE3nkDs8MVD8k 3EGBm/wAO0y+N1HoXoQ8CiPDWpb5rIebAQD0+2o23fXfW42DfTx6hxNJ8f2IhTyW86El ZjuA== 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=fGVMmGP8qLWqxfzlvKNYjiwykEo01hrsV+jCrcf2K9A=; b=nTJwsBu+swZGH/VsPBFr5I+jytK8ckFHKm+qZ26app5rF7JrnzqDbIKMUK8dwXQxj7 x3vpm41HTNh0KXGkFTxNhT+BJq3ue2MtH693gR2TO8sA5tJiNEggnR7Ann3N1ik2W6iq C32YENDrpA3VfQMlOIJW+It1ceYNTlYQYLMKMQQ/0Zy/P93btIYfUdOzxv3PLs0YtYGW kFjfEYRR+sZQITde527iEr4N423lSsxe26RF5ug5ncxWpMcvE2fCfBlEhYX8+JSsNe87 hLH8vqwNEK1R+HesXN+8YBvAq52AbU47SHiqdF3jYnZAD2AVVW6LmgAWY8/fJt3zNy81 yzFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fOsAgPf8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si3953973edb.89.2021.04.16.21.18.08; Fri, 16 Apr 2021 21:18:32 -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=@google.com header.s=20161025 header.b=fOsAgPf8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231529AbhDQERR (ORCPT + 99 others); Sat, 17 Apr 2021 00:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbhDQERQ (ORCPT ); Sat, 17 Apr 2021 00:17:16 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B21FCC061574 for ; Fri, 16 Apr 2021 21:16:50 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id u20so33173707lja.13 for ; Fri, 16 Apr 2021 21:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fGVMmGP8qLWqxfzlvKNYjiwykEo01hrsV+jCrcf2K9A=; b=fOsAgPf8o6Dbhq3uqWlVbEOlFNhmZSJvTgrDnSpAF/JcfY7XTI+pTsL+8B7RwdJajg 8/ZW9B50SAuqcQ5ePSKTa2S+0n+SHk7n2QJV2Uk/G8cXqZx+0FBr8wnt8Gspz5Jn0nXR b/7TP3jV144sT4gCZhqxdl+VwK+wPQ9nlhMWwpSm3qMpueE19aYFrf08f8PgWnzI4eJ6 q5cC/Xu+GFoPi+Zv89RV9aMKtC5uD6r07NMI70W8FCCzl2S6nc9/tTgct4LXethwme1I 0wxdA/42h9lzA7ix5Q6r1YD55fqDQjNXo+9bW+bCK6LWmglgnOwjSLVfLFnQFZX0jYGN xlsQ== 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=fGVMmGP8qLWqxfzlvKNYjiwykEo01hrsV+jCrcf2K9A=; b=q78PycLZtV8JFchyAmx924mFIJtDIgCPL0b6gsA8wskUwAiTyDDhngY/ABrdV5fUGx n9tVcGvJVKvi8tfMlvrxaID1oYRyPd7KXLmuW/sfiP67lWSN85JZsVD6bVtuyApNm8Yn KIX1hNPVo7cfa37B6oliskgz05k+qzwYS07onz4Wbv+YDTyDj+oXCLj/ulCR3wAoJIJS DuTipskjoidZWP55sFd0SsM81B0Snu1I89lzKkPqM8UKSN6HYRvKFbKBlNaUCB8Xb/vE 4KAQu4qd/WGdoCWR7wa8vG2WRHuzhBVkYSVeSLKb63V9c41oVisu3sR6t3NjxRIeWEGS roAQ== X-Gm-Message-State: AOAM530beP03vts8w1slT8F/Q85VUvzyJXEZ7/6sOlZxn5vQ48/hk70q Xg0eA9iVLo+XPd0K54JkYEF52x46e3VsQtjJsqXYJw== X-Received: by 2002:a2e:bb95:: with SMTP id y21mr1452149lje.510.1618633008874; Fri, 16 Apr 2021 21:16:48 -0700 (PDT) MIME-Version: 1.0 References: <20210416180427.1545645-1-dlatypov@google.com> In-Reply-To: <20210416180427.1545645-1-dlatypov@google.com> From: David Gow Date: Sat, 17 Apr 2021 12:16:37 +0800 Message-ID: Subject: Re: [PATCH v6] lib: add basic KUnit test for lib/math To: Daniel Latypov Cc: Andy Shevchenko , Brendan Higgins , Linux Kernel Mailing List , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 17, 2021 at 2:04 AM Daniel Latypov wrote: > > Add basic test coverage for files that don't require any config options: > * part of math.h (what seem to be the most commonly used macros) > * gcd.c > * lcm.c > * int_sqrt.c > * reciprocal_div.c > (Ignored int_pow.c since it's a simple textbook algorithm.) > > These tests aren't particularly interesting, but they > * provide short and simple examples of parameterized tests > * provide a place to add tests for any new files in this dir > * are written so adding new test cases to cover edge cases should be easy > * looking at code coverage, we hit all the branches in the .c files > > Signed-off-by: Daniel Latypov > Reviewed-by: David Gow > --- Thanks: I've tested this version, and am happy with it. A part of me still kind-of would like there to be names for the parameters, but I definitely understand that it doesn't really work well for the lcm and gcd cases where we're doing both (a,b) and (b,a). So let's keep it as-is. Hopefully we can get these in for 5.13! Cheers, -- David