[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGS_qxqbdB-1OFUQWXb7XxODWfOWi5yMUCBFebOLmGOj0rMdyA@mail.gmail.com>
Date: Mon, 3 Apr 2023 16:09:18 -0700
From: Daniel Latypov <dlatypov@...gle.com>
To: Rae Moar <rmoar@...gle.com>
Cc: brendanhiggins@...gle.com, davidgow@...gle.com,
skhan@...uxfoundation.org, kunit-dev@...glegroups.com,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v1] kunit: add tests for using current KUnit test field
On Mon, Apr 3, 2023 at 12:31 PM Rae Moar <rmoar@...gle.com> wrote:
>
> On Thu, Mar 30, 2023 at 6:21 PM 'Daniel Latypov' via KUnit Development
> <kunit-dev@...glegroups.com> wrote:
> >
> > I've got a few minor comments below, but this otherwise looks good.
> > I like the idea of testing knuit_fail_current_test().
> >
> >
> > On Thu, Mar 30, 2023 at 3:05 PM Rae Moar <rmoar@...gle.com> wrote:
> > >
> > > +static void kunit_current_kunit_test_field(struct kunit *test)
> > > +{
> > > + struct kunit *current_test;
> > > +
> > > + /* Check to ensure the result of current->kunit_test
> > > + * is equivalent to current test.
> > > + */
> > > + current_test = current->kunit_test;
> > > + KUNIT_EXPECT_PTR_EQ(test, test, current_test);
> >
> > Perhaps we can combine this and the next test case down to
> > static void kunit_current_test(struct kunit *test) {
> > /* There are two different ways of getting the current test */
> > KUNIT_EXPECT_PTR_EQ(test, test, current->kunit_test);
> > KUNIT_EXPECT_PTR_EQ(test, test, kunit_get_current_test());
> > }
> > ?
>
> Hi Daniel!
>
> Yes, I would be happy to combine these for v2. I might want to alter
> that proposed comment slightly. "Two different ways" seems a bit
> unclear to me. Maybe: Check results of both current->kunit_test and
> kunit_get_current_test() are equivalent to current test. What do you
> think? I might send out a v2 with a proposed comment.
What you went with in v2 works for me.
I'll take a look at the other changes in v2.
Thanks!
Daniel
Powered by blists - more mailing lists