test_OpenSSL.c 972 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. Copyright (c) Contributors to the Open 3D Engine Project.
  3. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. SPDX-License-Identifier: Apache-2.0 OR MIT
  5. */
  6. #include <stdio.h>
  7. #include <string.h>
  8. // this is just a super basic include and compile and link test
  9. // it doesn't exercise the library much, but if this compiles and links
  10. // its likely that further testing needs to be done in a real full project
  11. // rather than artificially
  12. // test whether a header is found
  13. #include <openssl/ssl.h>
  14. int main()
  15. {
  16. if (OPENSSL_init_ssl(0, NULL) == 0)
  17. {
  18. printf("FAILURE! OPENSSL failed call to OPENSSL_init_ssl!\n");
  19. return 1;
  20. }
  21. if (strcmp(OPENSSL_VERSION_TEXT, "OpenSSL 1.1.1m 14 Dec 2021") != 0)
  22. {
  23. printf("FAILURE! OpenSSL OPENSSL_VERSION_TEXT returned invalid text (%s)!\n", OPENSSL_VERSION_TEXT);
  24. return 1;
  25. }
  26. printf("Success: All is ok!\n");
  27. return 0;
  28. }