]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - io/crc32cselftest.c
libfrog: move crc32c.h to libfrog/
[thirdparty/xfsprogs-dev.git] / io / crc32cselftest.c
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 "libfrog/crc32c.h"
12 #include "libfrog/crc32cselftest.h"
13
14 static int
15 crc32cselftest_f(
16 int argc,
17 char **argv)
18 {
19 return crc32c_test() != 0;
20 }
21
22 static 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
33 void
34 crc32cselftest_init(void)
35 {
36 add_command(&crc32cselftest_cmd);
37 }