mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-20 02:25:14 -07:00
8b9b6a54be
Returning the name of an internal function to bindings is useless. They need way more context to recover from these errors, and their own backtrace will be way more useful for diagnostics.
35 lines
710 B
C
35 lines
710 B
C
|
|
#define TEST_NAME "sodium_core"
|
|
#include "cmptest.h"
|
|
|
|
static void
|
|
misuse_handler(void)
|
|
{
|
|
printf("misuse_handler()\n");
|
|
exit(0);
|
|
}
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
sodium_set_misuse_handler(NULL);
|
|
sodium_set_misuse_handler(misuse_handler);
|
|
sodium_set_misuse_handler(NULL);
|
|
|
|
assert(sodium_init() == 1);
|
|
|
|
(void) sodium_runtime_has_neon();
|
|
(void) sodium_runtime_has_sse2();
|
|
(void) sodium_runtime_has_sse3();
|
|
(void) sodium_runtime_has_ssse3();
|
|
(void) sodium_runtime_has_sse41();
|
|
(void) sodium_runtime_has_pclmul();
|
|
(void) sodium_runtime_has_aesni();
|
|
|
|
sodium_set_misuse_handler(misuse_handler);
|
|
sodium_misuse();
|
|
printf("Misuse handler returned\n");
|
|
|
|
return 0;
|
|
}
|