From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 48E95213281D9 for ; Mon, 12 Aug 2019 21:33:57 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20190812182421.141150-13-brendanhiggins@google.com> References: <20190812182421.141150-1-brendanhiggins@google.com> <20190812182421.141150-13-brendanhiggins@google.com> Subject: Re: [PATCH v12 12/18] kunit: test: add tests for KUnit managed resources From: Stephen Boyd Date: Mon, 12 Aug 2019 21:31:39 -0700 Message-Id: <20190813043140.67FF320644@mail.kernel.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Brendan Higgins , frowand.list@gmail.com, gregkh@linuxfoundation.org, jpoimboe@redhat.com, keescook@google.com, kieran.bingham@ideasonboard.com, mcgrof@kernel.org, peterz@infradead.org, robh@kernel.org, shuah@kernel.org, tytso@mit.edu, yamada.masahiro@socionext.com Cc: pmladek@suse.com, linux-doc@vger.kernel.org, amir73il@gmail.com, dri-devel@lists.freedesktop.org, Alexander.Levin@microsoft.com, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, khilman@baylibre.com, knut.omang@oracle.com, wfg@linux.intel.com, joel@jms.id.au, rientjes@google.com, jdike@addtoit.com, dan.carpenter@oracle.com, devicetree@vger.kernel.org, linux-kbuild@vger.kernel.org, Tim.Bird@sony.com, Avinash Kondareddy , linux-um@lists.infradead.org, rostedt@goodmis.org, julia.lawall@lip6.fr, kunit-dev@googlegroups.com, richard@nod.at, rdunlap@infradead.org, linux-kernel@vger.kernel.org, daniel@ffwll.ch, mpe@ellerman.id.au, linux-fsdevel@vger.kernel.org List-ID: Quoting Brendan Higgins (2019-08-12 11:24:15) > + > +static int kunit_resource_test_init(struct kunit *test) > +{ > + struct kunit_test_resource_context *ctx = > + kzalloc(sizeof(*ctx), GFP_KERNEL); > + > + if (!ctx) > + return -ENOMEM; Should this use the test assertion logic to make sure that it's not failing allocations during init? BTW, maybe kunit allocation APIs should fail the test if they fail to allocate in general. Unless we're unit testing failure to allocate problems. > + > + test->priv = ctx; > + > + kunit_init_test(&ctx->test, "test_test_context"); > + > + return 0; _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm