linux/lib/kunit/resource.c

// SPDX-License-Identifier: GPL-2.0
/*
 * KUnit resource API for test managed resources (allocations, etc.).
 *
 * Copyright (C) 2022, Google LLC.
 * Author: Daniel Latypov <[email protected]>
 */

#include <kunit/resource.h>
#include <kunit/test.h>
#include <linux/kref.h>

/*
 * Used for static resources and when a kunit_resource * has been created by
 * kunit_alloc_resource().  When an init function is supplied, @data is passed
 * into the init function; otherwise, we simply set the resource data field to
 * the data value passed in. Doesn't initialize res->should_kfree.
 */
int __kunit_add_resource(struct kunit *test,
			 kunit_resource_init_t init,
			 kunit_resource_free_t free,
			 struct kunit_resource *res,
			 void *data)
{}
EXPORT_SYMBOL_GPL();

void kunit_remove_resource(struct kunit *test, struct kunit_resource *res)
{}
EXPORT_SYMBOL_GPL();

int kunit_destroy_resource(struct kunit *test, kunit_resource_match_t match,
			   void *match_data)
{}
EXPORT_SYMBOL_GPL();

struct kunit_action_ctx {};

static void __kunit_action_free(struct kunit_resource *res)
{}


int kunit_add_action(struct kunit *test, void (*action)(void *), void *ctx)
{}
EXPORT_SYMBOL_GPL();

int kunit_add_action_or_reset(struct kunit *test, void (*action)(void *),
			      void *ctx)
{}
EXPORT_SYMBOL_GPL();

static bool __kunit_action_match(struct kunit *test,
				struct kunit_resource *res, void *match_data)
{}

void kunit_remove_action(struct kunit *test,
			kunit_action_t *action,
			void *ctx)
{}
EXPORT_SYMBOL_GPL();

void kunit_release_action(struct kunit *test,
			 kunit_action_t *action,
			 void *ctx)
{}
EXPORT_SYMBOL_GPL();