diff --git a/libs/libzrtp/test/cache_test.c b/libs/libzrtp/test/cache_test.c index 8ba699ee3f..5713249b7e 100644 --- a/libs/libzrtp/test/cache_test.c +++ b/libs/libzrtp/test/cache_test.c @@ -11,7 +11,7 @@ #include #include #include - #include +#include #include "zrtp.h" #include "cmockery/cmockery.h" @@ -109,7 +109,7 @@ void cache_init_store_empty_test() { * Add few entries to the empty cache, flush it and then load again. Check if * all the entries were restored successfully. */ -void cache_add2empty_test() { +void cache_add2empty_test() { zrtp_status_t status; int intres; @@ -146,8 +146,8 @@ void cache_save_unchanged_test() { /* * TEST: now let's store the cache making no changes to it. - * After opening it should include all the secrets untouched. - */ + * After opening it should include all the secrets untouched. + */ printf("==> And the cache again, it should contain all the stored values.\n"); diff --git a/libs/libzrtp/test/cipher_test.c b/libs/libzrtp/test/cipher_test.c index 4098d8b16e..8ef7ec15d2 100644 --- a/libs/libzrtp/test/cipher_test.c +++ b/libs/libzrtp/test/cipher_test.c @@ -52,64 +52,7 @@ static void aes256_cfb_test() { assert_non_null(cipher); cipher->self_test(cipher, ZRTP_CIPHER_MODE_CFB); } -/* -static void aes256_cfb_test2() { - rtp_aes_cfb_ctx_t *ctx = (zrtp_aes_cfb_ctx_t*)self->start( self, - aes_cfb_test_key, - NULL, - ZRTP_CIPHER_MODE_CFB); - if (NULL == ctx) { - return zrtp_status_fail; - } - ZRTP_LOG(3, (_ZTU_,"256 bit AES CFB\n")); - ZRTP_LOG(3, (_ZTU_, "1st test...\n")); - - zrtp_memcpy(aes_cfb_test_buf2b, aes_cfb_test_buf2a, sizeof(aes_cfb_test_buf2a)); - zrtp_memcpy(&tmp_iv, aes_cfb_test_iv, sizeof(tmp_iv)); - - ZRTP_LOG(3, (_ZTU_, "\tencryption... ")); - - self->set_iv(self, ctx, &tmp_iv); - err = self->encrypt(self, ctx, aes_cfb_test_buf2b, sizeof(aes_cfb_test_buf2b)); - if (zrtp_status_ok != err) { - ZRTP_LOGC(1, ("ERROR! 256-bit AES CFB encrypt returns error %d\n", err)); - self->stop(self, ctx); - return err; - } - - for (i=0; i<16; i++) { - if (aes_cfb_test_buf2b[i] != 0x00) { - ZRTP_LOGC(1, ("ERROR! 256-bit AES CFB failed on encrypt test\n")); - self->stop(self, ctx); - return zrtp_status_fail; - } - } - ZRTP_LOGC(3, ("OK\n")); - - ZRTP_LOG(3, (_ZTU_, "\tdecryption... ")); - - zrtp_memcpy(&tmp_iv, aes_cfb_test_iv, sizeof(tmp_iv)); - self->set_iv(self, ctx, &tmp_iv); - - err = self->decrypt(self, ctx, aes_cfb_test_buf2b, sizeof(aes_cfb_test_buf2b)); - if (zrtp_status_ok != err) { - ZRTP_LOGC(1, ("ERROR! 256-bit AES CFB decrypt returns error %d\n", err)); - self->stop(self, ctx); - return err; - } - for (i=0; istop(self, ctx); - return zrtp_status_fail; - } - } - self->stop(self, ctx); - ZRTP_LOGC(3, ("OK\n")); - -} -*/ int main(void) { const UnitTest tests[] = { unit_test_setup_teardown(aes128_ctr_test, setup, teardown), diff --git a/libs/libzrtp/test/test_engine.c b/libs/libzrtp/test/test_engine.c index 3b40985f57..8ec6fc2381 100644 --- a/libs/libzrtp/test/test_engine.c +++ b/libs/libzrtp/test/test_engine.c @@ -132,7 +132,6 @@ static int on_send_packet(const zrtp_stream_t* ctx, char* message, unsigned int zrtp_test_id_t *stream_id = zrtp_stream_get_userdata(ctx); zrtp_test_stream_t *stream = zrtp_test_stream_by_id(*stream_id); if (stream) { - printf("trace>>> PUSH from stream ID=%u\n", stream->id); zrtp_test_queue_push(stream->output, elem); return zrtp_status_ok; } else { @@ -168,24 +167,8 @@ static zrtp_test_stream_t *get_stream_to_process_(zrtp_endpoint_t *endpoint) { j = (unsigned)i; j = j % streams_count; - printf("trace>>> CHOOSE stream Endpoint=%u IDX=%u ID=%u\n", endpoint->id, j, all_streams[j]); + //printf("trace>>> CHOOSE stream Endpoint=%u IDX=%u ID=%u\n", endpoint->id, j, all_streams[j]); return zrtp_test_stream_by_id(all_streams[j]); - - -// unsigned is_found = 0; -// zrtp_test_id_t result, left; -// for (i=0; i stream_id) { -// is_found = 1; -// break; -// } else { -// left = result; -// } -// } -// -// printf("TRACE>>> choose stream ID=%u\n", is_found ? result : left); -// return zrtp_test_stream_by_id(is_found ? result : left); }