Lines Matching refs:test
153 int __kunit_add_resource(struct kunit *test,
169 static inline int kunit_add_resource(struct kunit *test, in kunit_add_resource() argument
176 return __kunit_add_resource(test, init, free, res, data); in kunit_add_resource()
180 kunit_find_named_resource(struct kunit *test, const char *name);
191 static inline int kunit_add_named_resource(struct kunit *test, in kunit_add_named_resource() argument
203 existing = kunit_find_named_resource(test, name); in kunit_add_named_resource()
212 return __kunit_add_resource(test, init, free, res, data); in kunit_add_named_resource()
237 kunit_alloc_and_get_resource(struct kunit *test, in kunit_alloc_and_get_resource() argument
252 ret = __kunit_add_resource(test, init, free, res, context); in kunit_alloc_and_get_resource()
280 static inline void *kunit_alloc_resource(struct kunit *test, in kunit_alloc_resource() argument
293 if (!__kunit_add_resource(test, init, free, res, context)) in kunit_alloc_resource()
299 typedef bool (*kunit_resource_match_t)(struct kunit *test,
309 static inline bool kunit_resource_name_match(struct kunit *test, in kunit_resource_name_match() argument
323 kunit_find_resource(struct kunit *test, in kunit_find_resource() argument
330 spin_lock_irqsave(&test->lock, flags); in kunit_find_resource()
332 list_for_each_entry_reverse(res, &test->resources, node) { in kunit_find_resource()
333 if (match(test, res, (void *)match_data)) { in kunit_find_resource()
340 spin_unlock_irqrestore(&test->lock, flags); in kunit_find_resource()
351 kunit_find_named_resource(struct kunit *test, in kunit_find_named_resource() argument
354 return kunit_find_resource(test, kunit_resource_name_match, in kunit_find_named_resource()
367 int kunit_destroy_resource(struct kunit *test,
371 static inline int kunit_destroy_named_resource(struct kunit *test, in kunit_destroy_named_resource() argument
374 return kunit_destroy_resource(test, kunit_resource_name_match, in kunit_destroy_named_resource()
388 void kunit_remove_resource(struct kunit *test, struct kunit_resource *res);
434 int kunit_add_action(struct kunit *test, kunit_action_t *action, void *ctx);
459 int kunit_add_action_or_reset(struct kunit *test, kunit_action_t *action,
476 void kunit_remove_action(struct kunit *test,
500 void kunit_release_action(struct kunit *test,