c-libp2p/test/testit.c

44 lines
1.6 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"
2016-12-01 18:05:14 +00:00
#include "crypto/test_base32.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) {
2016-12-01 18:05:14 +00:00
/*
testit("test_public_der_to_private_der", test_public_der_to_private_der);
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);
testit("test_crypto_rsa_public_key_to_peer_id", test_crypto_rsa_public_key_to_peer_id);
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-12-01 18:05:14 +00:00
*/
testit("test_crypto_encoding_base32_encode", test_crypto_encoding_base32_encode);
2016-11-03 14:18:32 +00:00
return 1;
}