linux/drivers/iio/test/iio-test-rescale.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Kunit tests for IIO rescale conversions
 *
 * Copyright (c) 2021 Liam Beguin <[email protected]>
 */

#include <linux/gcd.h>
#include <linux/overflow.h>

#include <linux/iio/afe/rescale.h>
#include <linux/iio/iio.h>

#include <kunit/test.h>

struct rescale_tc_data {};

static const struct rescale_tc_data scale_cases[] =;

static const struct rescale_tc_data offset_cases[] =;

static void case_to_desc(const struct rescale_tc_data *t, char *desc)
{}

KUNIT_ARRAY_PARAM(iio_rescale_scale, scale_cases, case_to_desc);
KUNIT_ARRAY_PARAM(iio_rescale_offset, offset_cases, case_to_desc);

/**
 * iio_str_to_nano() - Parse a fixed-point string to get an
 *                      IIO_VAL_INT_PLUS_NANO value
 * @str: The string to parse
 * @nano: The number as an integer
 *
 * Returns 0 on success, or a negative error code if the string cound not be
 * parsed.
 */
static int iio_str_to_nano(const char *str, s64 *nano)
{}

/**
 * iio_test_relative_error_ppm() - Compute relative error (in parts-per-million)
 *                                 between two fixed-point strings
 * @real_str: The real value as a string
 * @exp_str: The expected value as a string
 *
 * Returns a negative error code if the strings cound not be parsed, or the
 * relative error in parts-per-million.
 */
static int iio_test_relative_error_ppm(const char *real_str, const char *exp_str)
{}

static void iio_rescale_test_scale(struct kunit *test)
{}

static void iio_rescale_test_offset(struct kunit *test)
{}

static struct kunit_case iio_rescale_test_cases[] =;

static struct kunit_suite iio_rescale_test_suite =;
kunit_test_suite();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_IMPORT_NS();