test_main.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* test_main.c
  2. *
  3. * Copyright (C) 2006-2015 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL. (formerly known as CyaSSL)
  6. *
  7. * wolfSSL 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. * wolfSSL 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
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  20. */
  21. #ifdef HAVE_CONFIG_H
  22. #include <config.h>
  23. #endif
  24. #include <wolfssl/wolfcrypt/settings.h>
  25. #include <wolfcrypt/test/test.h>
  26. #include <stdio.h>
  27. typedef struct func_args {
  28. int argc;
  29. char** argv;
  30. int return_code;
  31. } func_args;
  32. static func_args args = { 0 } ;
  33. void main(void)
  34. {
  35. int test_num = 0;
  36. do
  37. {
  38. printf("\nCrypt Test %d:\n", test_num);
  39. wolfcrypt_test(&args);
  40. printf("Crypt Test %d: Return code %d\n", test_num, args.return_code);
  41. test_num++;
  42. } while(args.return_code == 0);
  43. }
  44. /* SAMPLE OUTPUT:
  45. Crypt Test 1:
  46. MD5 test passed!
  47. MD4 test passed!
  48. SHA test passed!
  49. SHA-256 test passed!
  50. HMAC-MD5 test passed!
  51. HMAC-SHA test passed!
  52. HMAC-SHA256 test passed!
  53. ARC4 test passed!
  54. HC-128 test passed!
  55. Rabbit test passed!
  56. DES test passed!
  57. DES3 test passed!
  58. AES test passed!
  59. RANDOM test passed!
  60. RSA test passed!
  61. DH test passed!
  62. DSA test passed!
  63. PWDBASED test passed!
  64. Crypt Test 1: Return code 0
  65. */