]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - io/crc32cselftest.c
xfsprogs: Release v4.19.0-rc1
[thirdparty/xfsprogs-dev.git] / io / crc32cselftest.c
CommitLineData
99a5535c
DW
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2018 Oracle, Inc.
4 * All Rights Reserved.
5 */
6
7#include "platform_defs.h"
8#include "command.h"
9#include "init.h"
10#include "io.h"
11#include "crc32c.h"
12#include "crc32cselftest.h"
13
14static int
15crc32cselftest_f(
16 int argc,
17 char **argv)
18{
19 return crc32c_test() != 0;
20}
21
22static const cmdinfo_t crc32cselftest_cmd = {
23 .name = "crc32cselftest",
24 .cfunc = crc32cselftest_f,
25 .argmin = 0,
26 .argmax = 0,
27 .canpush = 0,
28 .flags = CMD_FLAG_ONESHOT | CMD_FLAG_FOREIGN_OK |
29 CMD_NOFILE_OK | CMD_NOMAP_OK,
30 .oneline = N_("self test of crc32c implementation"),
31};
32
33void
34crc32cselftest_init(void)
35{
36 add_command(&crc32cselftest_cmd);
37}