Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp217451rwb; Fri, 30 Sep 2022 21:14:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7fqdbram+AK2tFdVfVNlMTJ0an9HJk4Ms/plwczchdVleIzY3bQ+uLmtBe5PDMYNwsTKoC X-Received: by 2002:a05:6a00:1892:b0:540:acee:29e8 with SMTP id x18-20020a056a00189200b00540acee29e8mr12250456pfh.1.1664597640076; Fri, 30 Sep 2022 21:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664597640; cv=none; d=google.com; s=arc-20160816; b=fHcvi8R4sebbskRoW2o7gxP7OETA9kqMqf0lE5RaySb/4AC6uizVFVgX9HFZDPLMgq Y0n8DV66VsuubZ2e5YuJD3vE452qWPszfkGOhIVaNDkH5lEaDZgUQe49IGJy7De2BBbq dVqUP3aNku/f8tljbyiW8DUEdn2EVrVh/cIXXSQeZ/XobiD4BU/nIcZ16K0TK78oCI8o dqSFacFqQg3VKet4cPfpEGpIocdMNgSyF/IQCZn4SQs8Tf7K1ak1dlj4HWwXFZ4ShQb7 rQgZyUF/H3k8SrOhlA5hXfLV8JlFi1EY8aNkVG4sN1kZjnykQsEnAWAjW8Bl4CM8wAbd GQeA== 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=WaLUflGp+ER8JMdsZF7pCLBibmoeeQM/rsP1Z13Gn/s=; b=Gs0WQBiz15bI3GLIQoWN/i2EfsNxWC1yvAX1U9bsp6K1LCZ7pQNGybjeULZCIM6I4Y g1SbFGAYxzEg0gWklSDABC8ck3HgiXFun1SHd8QFsEA50BSc8WjNEsy1q3YI53KfDrbB Ujno+DZG141ax//TLFnV5g0zv/1rh+XgtbIdjfnZdoICxwhszN8Ap0RR/d7ADuYpBdEr o4wMfvMS74DGhf+u13FQCzzeM48urnI2N9Vn3tmDw8yikTncbbzJoTUKilopK9LaXHE/ uCeWK6H/fLp/xTzLWy8/upTZcS7w7AsCGCe7PtXLtwiTTsVJIYOQ7dAXhbVKGmvegGwA u2CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Nkepc4X+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nw9-20020a17090b254900b001fe1add9c77si9615671pjb.187.2022.09.30.21.13.48; Fri, 30 Sep 2022 21:14:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Nkepc4X+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232050AbiJADu6 (ORCPT + 99 others); Fri, 30 Sep 2022 23:50:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231576AbiJADuz (ORCPT ); Fri, 30 Sep 2022 23:50:55 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 665829F0FF for ; Fri, 30 Sep 2022 20:50:53 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id c30so8232077edn.2 for ; Fri, 30 Sep 2022 20:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=WaLUflGp+ER8JMdsZF7pCLBibmoeeQM/rsP1Z13Gn/s=; b=Nkepc4X+DwRlUjX0pNAaDvA66nrZjfktHdRUo3S5Es09y57c6hoaxg6lszGWscW+YL fZA4KM0SbHyvozPdxVU1mliYgT2wYlWUlWHIu4+Xd9mwkDrVdoMF98CTmzVxWtkhUfqn hvdeCmSJzg1tabw5HqZu777zkGsmdHRk+xnWCklVUWYdrwNulem77ZEa11050Z605rnw Q/XOeSgRcL6qgw50baGvkzLINiinYl6UK0uo9cgZ2ShOwR47BNZQTtV85rywxT9KpJsx Ch8IsZ0aTqBXzDHMTdLNIojWV/lrmMmOTbUzkkFMzSPwRy5ixzVz117xcItu4jlrAuYD jFqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=WaLUflGp+ER8JMdsZF7pCLBibmoeeQM/rsP1Z13Gn/s=; b=iNxSJ2wH9Hwv6tRxNI2IkOy3s3Q4vPa6NXXQ0w9MEbJ4xrgWDvv29+P9gOwJGA5YlL 6Vy8TM+p1a3SOeEbJ7QZFNOX3mKZHFcMm1kGFAzMYVyeGs1pjKUafWQx5Yu6xbKojhmj f+Eh37g/GMWIWGGf7yCPJCxWiXtDF6Yuxr9SFBl/Rgw47dubcFvYJOtmYFL3saX/N8TI oBCY0irjlJoJndyZow0SQ6aQxYcIYLMmqnnEVGzqoIMxrQcGdy13V947fP9f+qHRxwpm NUc5igAyAdZoEZPMW1QS22queL+V4GqIHDu7nLXdPHUXgoF23wBwWMA8vckZhFaKh9TL f1lQ== X-Gm-Message-State: ACrzQf2gtuQOP1twZHG7u3kixOXSeldH69+HJ/dlWDIuOPamzdv1qfVF tkJm1tl4YJ1pk0FJKMDxwcUs1GiZJlmVzuSxLBWacN4eBz8= X-Received: by 2002:a05:6402:11d0:b0:44e:ec42:e0b8 with SMTP id j16-20020a05640211d000b0044eec42e0b8mr10118434edw.131.1664596251814; Fri, 30 Sep 2022 20:50:51 -0700 (PDT) MIME-Version: 1.0 References: <20221001002638.2881842-1-dlatypov@google.com> <20221001002638.2881842-3-dlatypov@google.com> In-Reply-To: From: Daniel Latypov Date: Fri, 30 Sep 2022 20:50:40 -0700 Message-ID: Subject: Re: [PATCH 2/4] kunit: rename base KUNIT_ASSERTION macro to _KUNIT_FAILED To: David Gow Cc: Brendan Higgins , Linux Kernel Mailing List , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan , Miguel Ojeda Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 30, 2022 at 8:26 PM David Gow wrote: > > On Sat, Oct 1, 2022 at 8:26 AM 'Daniel Latypov' via KUnit Development > wrote: > > > > Context: > > Currently this macro's name, KUNIT_ASSERTION conflicts with the name of > > an enum whose values are {KUNIT_EXPECTATION, KUNIT_ASSERTION}. > > > > It's hard to think of a better name for the enum, so rename this macro. > > It's also a bit strange that the macro might do nothing depending on the > > boolean argument `pass`. Why not have callers check themselves? > > > > This patch: > > Moves the pass/fail checking into the callers of KUNIT_ASSERTION, so now > > we only call it when the check has failed. > > Then we rename the macro the _KUNIT_FAILED() to reflect the new > > semantics. > > > > Signed-off-by: Daniel Latypov > > --- > > Looks good to me. I can't say the name _KUNIT_FAILED() feels perfect > to me, but I can't think of anything better, either. We've not used a > leading underscore for internal macros much thus far, as well, though > I've no personal objections to starting. Yeah, I also didn't add a leading underscore on the new KUNIT_INIT_ASSERT() macro elsewhere in this series. So I'm not necessarily proposing that we should start doing so here. It feels like that KUNIT_FAILED is far too similar to the enum 55 enum kunit_status { 56 KUNIT_SUCCESS, 57 KUNIT_FAILURE, 58 KUNIT_SKIPPED, 59 }; I.e. we'd be remove one naming conflict between a macro and enum, but basically introducing a new one in its place :P Tbh, I was originally going to have this patch just be s/KUNIT_ASSERTION()/_KUNIT_ASSERTION() to reduce the conflict. But I figured we could reduce the number of arguments to the macro (drop `pass`) and have a reason to give it a different name. I'm also not entirely convinced about _KUNIT_FAILED(), but I haven't had any significantly better ideas since I sent the RFC in May. Daniel