Debian Codegraph @

third-party/xxhash/cli/xsum_sanity_check.h

raw
1 /*
2 * xxhsum - Command line interface for xxhash algorithms
3 * Copyright (C) 2013-2021 Yann Collet
4 *
5 * GPL v2 License
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * You can contact the author at:
22 * - xxHash homepage: https://www.xxhash.com
23 * - xxHash source repository: https://github.com/Cyan4973/xxHash
24 */
25
26 #ifndef XSUM_SANITY_CHECK_H
27 #define XSUM_SANITY_CHECK_H
28
29 #include "xsum_config.h" /* XSUM_API, XSUM_U8 */
30
31 #include <stddef.h> /* size_t */
32
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 /*
39 * Runs a series of self-tests.
40 *
41 * Exits if any of these tests fail, printing a message to stderr.
42 *
43 * If XSUM_NO_TESTS is defined to non-zero,
44 * this will instead print a warning if this is called (e.g. via xxhsum -b).
45 */
46 XSUM_API void XSUM_sanityCheck(void);
47
48 /*
49 * Fills a test buffer with pseudorandom data.
50 *
51 * This is used in the sanity check and the benchmarks.
52 * Its values must not be changed.
53 */
54 XSUM_API void XSUM_fillTestBuffer(XSUM_U8* buffer, size_t len);
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif /* XSUM_SANITY_CHECK_H */