linux/lib/test_objagg.c

// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/* Copyright (c) 2018 Mellanox Technologies. All rights reserved */

#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/random.h>
#include <linux/objagg.h>

struct tokey {};

#define NUM_KEYS

static int key_id_index(unsigned int key_id)
{}

#define BUF_LEN

struct world {};

struct root {};

struct delta {};

static struct objagg_obj *world_obj_get(struct world *world,
					struct objagg *objagg,
					unsigned int key_id)
{}

static void world_obj_put(struct world *world, struct objagg *objagg,
			  unsigned int key_id)
{}

#define MAX_KEY_ID_DIFF

static bool delta_check(void *priv, const void *parent_obj, const void *obj)
{}

static void *delta_create(void *priv, void *parent_obj, void *obj)
{}

static void delta_destroy(void *priv, void *delta_priv)
{}

static void *root_create(void *priv, void *obj, unsigned int id)
{}

static void root_destroy(void *priv, void *root_priv)
{}

static int test_nodelta_obj_get(struct world *world, struct objagg *objagg,
				unsigned int key_id, bool should_create_root)
{}

static int test_nodelta_obj_put(struct world *world, struct objagg *objagg,
				unsigned int key_id, bool should_destroy_root)
{}

static int check_stats_zero(struct objagg *objagg)
{}

static int check_stats_nodelta(struct objagg *objagg)
{}

static bool delta_check_dummy(void *priv, const void *parent_obj,
			      const void *obj)
{}

static void *delta_create_dummy(void *priv, void *parent_obj, void *obj)
{}

static void delta_destroy_dummy(void *priv, void *delta_priv)
{}

static const struct objagg_ops nodelta_ops =;

static int test_nodelta(void)
{}

static const struct objagg_ops delta_ops =;

enum action {};

enum expect_delta {};

enum expect_root {};

struct expect_stats_info {};

struct expect_stats {};

struct action_item {};

#define EXPECT_STATS(count, ...)

#define ROOT(key_id, user_count, delta_user_count)

#define DELTA(key_id, user_count)

static const struct action_item action_items[] =;

static int check_expect(struct world *world,
			const struct action_item *action_item,
			unsigned int orig_delta_count,
			unsigned int orig_root_count)
{}

static unsigned int obj_to_key_id(struct objagg_obj *objagg_obj)
{}

static int
check_expect_stats_nums(const struct objagg_obj_stats_info *stats_info,
			const struct expect_stats_info *expect_stats_info,
			const char **errmsg)
{}

static int
check_expect_stats_key_id(const struct objagg_obj_stats_info *stats_info,
			  const struct expect_stats_info *expect_stats_info,
			  const char **errmsg)
{}

static int check_expect_stats_neigh(const struct objagg_stats *stats,
				    const struct expect_stats *expect_stats,
				    int pos)
{}

static int __check_expect_stats(const struct objagg_stats *stats,
				const struct expect_stats *expect_stats,
				const char **errmsg)
{}

static int check_expect_stats(struct objagg *objagg,
			      const struct expect_stats *expect_stats,
			      const char **errmsg)
{}

static int test_delta_action_item(struct world *world,
				  struct objagg *objagg,
				  const struct action_item *action_item,
				  bool inverse)
{}

static int test_delta(void)
{}

struct hints_case {};

static const unsigned int hints_case_key_ids[] =;

static const struct hints_case hints_case =;

static void __pr_debug_stats(const struct objagg_stats *stats)
{}

static void pr_debug_stats(struct objagg *objagg)
{}

static void pr_debug_hints_stats(struct objagg_hints *objagg_hints)
{}

static int check_expect_hints_stats(struct objagg_hints *objagg_hints,
				    const struct expect_stats *expect_stats,
				    const char **errmsg)
{}

static int test_hints_case(const struct hints_case *hints_case)
{}
static int test_hints(void)
{}

static int __init test_objagg_init(void)
{}

static void __exit test_objagg_exit(void)
{}

module_init();
module_exit(test_objagg_exit);
MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();