linux/fs/ext4/inode-test.c

// SPDX-License-Identifier: GPL-2.0
/*
 * KUnit test of ext4 inode that verify the seconds part of [a/c/m]
 * timestamps in ext4 inode structs are decoded correctly.
 */

#include <kunit/test.h>
#include <linux/kernel.h>
#include <linux/time64.h>

#include "ext4.h"

/*
 * For constructing the nonnegative timestamp lower bound value.
 * binary: 00000000 00000000 00000000 00000000
 */
#define LOWER_MSB_0
/*
 * For constructing the nonnegative timestamp upper bound value.
 * binary: 01111111 11111111 11111111 11111111
 *
 */
#define UPPER_MSB_0
/*
 * For constructing the negative timestamp lower bound value.
 * binary: 10000000 00000000 00000000 00000000
 */
#define LOWER_MSB_1
/*
 * For constructing the negative timestamp upper bound value.
 * binary: 11111111 11111111 11111111 11111111
 */
#define UPPER_MSB_1
/*
 * Upper bound for nanoseconds value supported by the encoding.
 * binary: 00111111 11111111 11111111 11111111
 */
#define MAX_NANOSECONDS

#define CASE_NAME_FORMAT

#define LOWER_BOUND_NEG_NO_EXTRA_BITS_CASE
#define UPPER_BOUND_NEG_NO_EXTRA_BITS_CASE
#define LOWER_BOUND_NONNEG_NO_EXTRA_BITS_CASE
#define UPPER_BOUND_NONNEG_NO_EXTRA_BITS_CASE
#define LOWER_BOUND_NEG_LO_1_CASE
#define UPPER_BOUND_NEG_LO_1_CASE
#define LOWER_BOUND_NONNEG_LO_1_CASE
#define UPPER_BOUND_NONNEG_LO_1_CASE
#define LOWER_BOUND_NEG_HI_1_CASE
#define UPPER_BOUND_NEG_HI_1_CASE
#define LOWER_BOUND_NONNEG_HI_1_CASE
#define UPPER_BOUND_NONNEG_HI_1_CASE
#define UPPER_BOUND_NONNEG_HI_1_NS_1_CASE
#define LOWER_BOUND_NONNEG_HI_1_NS_MAX_CASE
#define LOWER_BOUND_NONNEG_EXTRA_BITS_1_CASE
#define UPPER_BOUND_NONNEG_EXTRA_BITS_1_CASE

struct timestamp_expectation {};

static const struct timestamp_expectation test_data[] =;

static void timestamp_expectation_to_desc(const struct timestamp_expectation *t,
					  char *desc)
{}

KUNIT_ARRAY_PARAM(ext4_inode, test_data, timestamp_expectation_to_desc);

static time64_t get_32bit_time(const struct timestamp_expectation * const test)
{}


/*
 *  Test data is derived from the table in the Inode Timestamps section of
 *  Documentation/filesystems/ext4/inodes.rst.
 */
static void inode_test_xtimestamp_decoding(struct kunit *test)
{}

static struct kunit_case ext4_inode_test_cases[] =;

static struct kunit_suite ext4_inode_test_suite =;

kunit_test_suites();

MODULE_DESCRIPTION();
MODULE_LICENSE();