xsum_sanity_check.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * xxhsum - Command line interface for xxhash algorithms
  3. * Copyright (C) 2013-2020 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. #ifndef XSUM_SANITY_CHECK_H
  26. #define XSUM_SANITY_CHECK_H
  27. #include "xsum_config.h" /* XSUM_API, XSUM_U8 */
  28. #include <stddef.h> /* size_t */
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /*
  33. * Runs a series of self-tests.
  34. *
  35. * Exits if any of these tests fail, printing a message to stderr.
  36. *
  37. * If XSUM_NO_TESTS is defined to non-zero, this will instead print a warning
  38. * if this is called (e.g. via xxhsum -b).
  39. */
  40. XSUM_API void XSUM_sanityCheck(void);
  41. /*
  42. * Fills a test buffer with pseudorandom data.
  43. *
  44. * This is used in the sanity check and the benchmarks - its values must not be
  45. * changed.
  46. */
  47. XSUM_API void XSUM_fillTestBuffer(XSUM_U8* buffer, size_t len);
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51. #endif /* XSUM_SANITY_CHECK_H */