c-libp2p/test/testit.c

38 lines
1.4 KiB
C
Raw Normal View History

2016-11-03 14:18:32 +00:00
2016-11-03 16:15:18 +00:00
#include <stdio.h>
2016-11-07 20:11:58 +00:00
#include "crypto/test_rsa.h"
#include "crypto/test_base58.h"
#include "test_mbedtls.h"
2016-11-07 20:11:58 +00:00
2016-11-03 14:18:32 +00:00
int testit(const char* name, int (*func)(void)) {
printf("Testing %s...\n", name);
int retVal = func();
if (retVal)
printf("%s success!\n", name);
else
printf("** Uh oh! %s failed.**\n", name);
return retVal;
}
int main(int argc, char** argv) {
testit("test_mbedtls_varint_128_binary", test_mbedtls_varint_128_binary);
testit("test_mbedtls_varint_128_string", test_mbedtls_varint_128_string);
2016-11-10 21:34:19 +00:00
testit("test_crypto_rsa_private_key_der", test_crypto_rsa_private_key_der);
2016-11-07 20:11:58 +00:00
//testit("test_crypto_x509_private_to_der", test_crypto_x509_private_to_der);
2016-11-10 17:04:48 +00:00
testit("test_crypto_x509_der_to_private2", test_crypto_x509_der_to_private2);
testit("test_crypto_x509_der_to_private", test_crypto_x509_der_to_private);
2016-11-09 16:22:25 +00:00
//testit("test_multihash_encode", test_multihash_encode);
//testit("test_multihash_decode", test_multihash_decode);
//testit("test_multihash_base58_encode_decode", test_multihash_base58_encode_decode);
//testit("test_multihash_base58_decode", test_multihash_base58_decode);
//testit("test_multihash_size", test_multihash_size);
2016-11-07 20:11:58 +00:00
testit("test_base58_encode_decode", test_base58_encode_decode);
testit("test_base58_size", test_base58_size);
testit("test_base58_max_size", test_base58_max_size);
2016-11-09 16:22:25 +00:00
testit("test_base58_peer_address", test_base58_peer_address);
2016-11-10 17:04:48 +00:00
//testit("test_mbedtls_pk_write_key_der", test_mbedtls_pk_write_key_der);
2016-11-03 14:18:32 +00:00
return 1;
}