Lines Matching refs:test
156 int __kunit_add_resource(struct kunit *test,
172 static inline int kunit_add_resource(struct kunit *test, in kunit_add_resource() argument
179 return __kunit_add_resource(test, init, free, res, data); in kunit_add_resource()
183 kunit_find_named_resource(struct kunit *test, const char *name);
194 static inline int kunit_add_named_resource(struct kunit *test, in kunit_add_named_resource() argument
206 existing = kunit_find_named_resource(test, name); in kunit_add_named_resource()
215 return __kunit_add_resource(test, init, free, res, data); in kunit_add_named_resource()
240 kunit_alloc_and_get_resource(struct kunit *test, in kunit_alloc_and_get_resource() argument
255 ret = __kunit_add_resource(test, init, free, res, context); in kunit_alloc_and_get_resource()
283 static inline void *kunit_alloc_resource(struct kunit *test, in kunit_alloc_resource() argument
296 if (!__kunit_add_resource(test, init, free, res, context)) in kunit_alloc_resource()
302 typedef bool (*kunit_resource_match_t)(struct kunit *test,
312 static inline bool kunit_resource_name_match(struct kunit *test, in kunit_resource_name_match() argument
326 kunit_find_resource(struct kunit *test, in kunit_find_resource() argument
333 spin_lock_irqsave(&test->lock, flags); in kunit_find_resource()
335 list_for_each_entry_reverse(res, &test->resources, node) { in kunit_find_resource()
336 if (match(test, res, (void *)match_data)) { in kunit_find_resource()
343 spin_unlock_irqrestore(&test->lock, flags); in kunit_find_resource()
354 kunit_find_named_resource(struct kunit *test, in kunit_find_named_resource() argument
357 return kunit_find_resource(test, kunit_resource_name_match, in kunit_find_named_resource()
370 int kunit_destroy_resource(struct kunit *test,
374 static inline int kunit_destroy_named_resource(struct kunit *test, in kunit_destroy_named_resource() argument
377 return kunit_destroy_resource(test, kunit_resource_name_match, in kunit_destroy_named_resource()
391 void kunit_remove_resource(struct kunit *test, struct kunit_resource *res);
437 int kunit_add_action(struct kunit *test, kunit_action_t *action, void *ctx);
462 int kunit_add_action_or_reset(struct kunit *test, kunit_action_t *action,
479 void kunit_remove_action(struct kunit *test,
503 void kunit_release_action(struct kunit *test,