linux/lib/kunit/string-stream-test.c

// SPDX-License-Identifier: GPL-2.0
/*
 * KUnit test for struct string_stream.
 *
 * Copyright (C) 2019, Google LLC.
 * Author: Brendan Higgins <[email protected]>
 */

#include <kunit/static_stub.h>
#include <kunit/test.h>
#include <linux/ktime.h>
#include <linux/slab.h>
#include <linux/timekeeping.h>

#include "string-stream.h"

struct string_stream_test_priv {};

/* Avoids a cast warning if kfree() is passed direct to kunit_add_action(). */
KUNIT_DEFINE_ACTION_WRAPPER(kfree_wrapper, kfree, const void *);

/* Avoids a cast warning if string_stream_destroy() is passed direct to kunit_add_action(). */
KUNIT_DEFINE_ACTION_WRAPPER(cleanup_raw_stream, string_stream_destroy, struct string_stream *);

static char *get_concatenated_string(struct kunit *test, struct string_stream *stream)
{}

/* Managed string_stream object is initialized correctly. */
static void string_stream_managed_init_test(struct kunit *test)
{}

/* Unmanaged string_stream object is initialized correctly. */
static void string_stream_unmanaged_init_test(struct kunit *test)
{}

static void string_stream_destroy_stub(struct string_stream *stream)
{}

/* kunit_free_string_stream() calls string_stream_desrtoy() */
static void string_stream_managed_free_test(struct kunit *test)
{}

/* string_stream object is freed when test is cleaned up. */
static void string_stream_resource_free_test(struct kunit *test)
{}

/*
 * Add a series of lines to a string_stream. Check that all lines
 * appear in the correct order and no characters are dropped.
 */
static void string_stream_line_add_test(struct kunit *test)
{}

/* Add a series of lines of variable length to a string_stream. */
static void string_stream_variable_length_line_test(struct kunit *test)
{}

/* Appending the content of one string stream to another. */
static void string_stream_append_test(struct kunit *test)
{}

/* Appending the content of one string stream to one with auto-newlining. */
static void string_stream_append_auto_newline_test(struct kunit *test)
{}

/* Adding an empty string should not create a fragment. */
static void string_stream_append_empty_string_test(struct kunit *test)
{}

/* Adding strings without automatic newline appending */
static void string_stream_no_auto_newline_test(struct kunit *test)
{}

/* Adding strings with automatic newline appending */
static void string_stream_auto_newline_test(struct kunit *test)
{}

/*
 * This doesn't actually "test" anything. It reports time taken
 * and memory used for logging a large number of lines.
 */
static void string_stream_performance_test(struct kunit *test)
{}

static int string_stream_test_init(struct kunit *test)
{}

static struct kunit_case string_stream_test_cases[] =;

static struct kunit_suite string_stream_test_suite =;
kunit_test_suites();