Re: [PATCH v3 3/3] lib/test_crc: Add test cases for crc calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 07/17/2018 07:55 AM, Coly Li wrote:

> diff --git a/lib/test_crc.c b/lib/test_crc.c
> new file mode 100644
> index 000000000000..441bf835fbd3
> --- /dev/null
> +++ b/lib/test_crc.c
> @@ -0,0 +1,138 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * CRC test driver
> + *
> + * Copyright (C) 2018 Coly Li <colyli@xxxxxxx>
> + *

> +
> +static int __init test_crc_init(void)
> +{
> +	int i;
> +	int v, err = 0;
> +
> +	pr_info("Kernel CRC consitency testing:\n");

	                    consistency

> +	for (i = 0; test_data[i].name; i++) {
> +		v = test_data[i].handler(&test_data[i]);
> +		if (v < 0)
> +			err++;
> +	}
> +
> +	if (err == 0)
> +		pr_info("test_crc: all %d tests passed\n", i);
> +	else
> +		pr_err("test_crc: %d cases tested, %d passed, %d failed\n",
> +		       i, i - err, err);
> +
> +	return (err == 0) ? 0 : -EINVAL;
> +}


-- 
~Randy



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux