Re: [PATCH v12 12/18] kunit: test: add tests for KUnit managed resources

2019-08-13 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-13 00:57:33) > On Mon, Aug 12, 2019 at 9:31 PM Stephen Boyd wrote: > > > > 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. > > Yeah, I thought about that. I

Re: [PATCH v12 12/18] kunit: test: add tests for KUnit managed resources

2019-08-13 Thread Brendan Higgins
On Mon, Aug 12, 2019 at 9:31 PM Stephen Boyd wrote: > > 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); > >

Re: [PATCH v12 12/18] kunit: test: add tests for KUnit managed resources

2019-08-12 Thread Stephen Boyd
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

[PATCH v12 12/18] kunit: test: add tests for KUnit managed resources

2019-08-12 Thread Brendan Higgins
From: Avinash Kondareddy Add unit tests for KUnit managed resources. KUnit managed resources (struct kunit_resource) are resources that are automatically cleaned up at the end of a KUnit test, similar to the concept of devm_* managed resources. Signed-off-by: Avinash Kondareddy Signed-off-by: