aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/testcases
diff options
context:
space:
mode:
Diffstat (limited to 'Source/charon/testcases')
-rw-r--r--Source/charon/testcases/aes_cbc_crypter_test.c9
-rw-r--r--Source/charon/testcases/diffie_hellman_test.c8
-rw-r--r--Source/charon/testcases/hasher_test.c4
-rw-r--r--Source/charon/testcases/hmac_signer_test.c8
-rw-r--r--Source/charon/testcases/ike_sa_id_test.c14
-rw-r--r--Source/charon/testcases/ike_sa_manager_test.c6
-rw-r--r--Source/charon/testcases/linked_list_test.c16
-rw-r--r--Source/charon/testcases/parser_test.c2
-rw-r--r--Source/charon/testcases/receiver_test.c2
-rw-r--r--Source/charon/testcases/scheduler_test.c2
-rw-r--r--Source/charon/testcases/send_queue_test.c2
-rw-r--r--Source/charon/testcases/sender_test.c2
-rw-r--r--Source/charon/testcases/thread_pool_test.c2
13 files changed, 32 insertions, 45 deletions
diff --git a/Source/charon/testcases/aes_cbc_crypter_test.c b/Source/charon/testcases/aes_cbc_crypter_test.c
index 7b6e84417..25a25b380 100644
--- a/Source/charon/testcases/aes_cbc_crypter_test.c
+++ b/Source/charon/testcases/aes_cbc_crypter_test.c
@@ -77,8 +77,7 @@ void test_aes_cbc_crypter(tester_t *tester)
allocator_free_chunk(&decrypted1);
- tester->assert_true(tester, (crypter->destroy(crypter) == SUCCESS), "destroy call test");
-
+ crypter->destroy(crypter);
/*
@@ -133,7 +132,7 @@ void test_aes_cbc_crypter(tester_t *tester)
allocator_free_chunk(&decrypted2);
- tester->assert_true(tester, (crypter->destroy(crypter) == SUCCESS), "destroy call test");
+ crypter->destroy(crypter);
/*
* Test 3 of RFC3603
@@ -197,10 +196,8 @@ void test_aes_cbc_crypter(tester_t *tester)
logger->log_chunk(logger,RAW,"decrypted :", &decrypted3);
allocator_free_chunk(&decrypted3);
-
- tester->assert_true(tester, (crypter->destroy(crypter) == SUCCESS), "destroy call test");
-
+ crypter->destroy(crypter);
global_logger_manager->destroy_logger(global_logger_manager,logger);
}
diff --git a/Source/charon/testcases/diffie_hellman_test.c b/Source/charon/testcases/diffie_hellman_test.c
index 83758c908..ee2c30b3d 100644
--- a/Source/charon/testcases/diffie_hellman_test.c
+++ b/Source/charon/testcases/diffie_hellman_test.c
@@ -54,8 +54,8 @@ void test_diffie_hellman(tester_t *tester)
tester->assert_true(tester,( other_diffie_hellman->get_my_public_value(other_diffie_hellman,&other_public_value) == SUCCESS), "get_my_public_value call check");
logger->log_chunk(logger,RAW,"Other public value",&other_public_value);
- tester->assert_true(tester,( my_diffie_hellman->set_other_public_value(my_diffie_hellman,other_public_value) == SUCCESS), "set_other_public_value call check");
- tester->assert_true(tester,( other_diffie_hellman->set_other_public_value(other_diffie_hellman,my_public_value) == SUCCESS), "set_other_public_value call check");
+ my_diffie_hellman->set_other_public_value(my_diffie_hellman,other_public_value);
+ other_diffie_hellman->set_other_public_value(other_diffie_hellman,my_public_value);
allocator_free(my_public_value.ptr);
allocator_free(other_public_value.ptr);
@@ -71,7 +71,7 @@ void test_diffie_hellman(tester_t *tester)
allocator_free(my_secret.ptr);
allocator_free(other_secret.ptr);
- tester->assert_true(tester,(my_diffie_hellman->destroy(my_diffie_hellman) == SUCCESS), "destroy call check");
- tester->assert_true(tester,(other_diffie_hellman->destroy(other_diffie_hellman) == SUCCESS), "destroy call check");
+ my_diffie_hellman->destroy(my_diffie_hellman);
+ other_diffie_hellman->destroy(other_diffie_hellman);
global_logger_manager->destroy_logger(global_logger_manager,logger);
}
diff --git a/Source/charon/testcases/hasher_test.c b/Source/charon/testcases/hasher_test.c
index db2d1839a..d7679ce54 100644
--- a/Source/charon/testcases/hasher_test.c
+++ b/Source/charon/testcases/hasher_test.c
@@ -90,7 +90,7 @@ void test_md5_hasher(tester_t *tester)
tester->assert_true(tester, hash_chunk.len == 16, "hash len");
tester->assert_false(tester, memcmp(hash_chunk.ptr, hash_abcd, hash_chunk.len), "hash for abcd...");
allocator_free(hash_chunk.ptr);
- tester->assert_true(tester, (hasher->destroy(hasher) == SUCCESS), "destroy call test");
+ hasher->destroy(hasher);
}
/*
@@ -168,5 +168,5 @@ void test_sha1_hasher(tester_t *tester)
tester->assert_false(tester, memcmp(hash_buffer, hash_aaa, 20), "hash for aaa...");
- tester->assert_true(tester, (hasher->destroy(hasher) == SUCCESS), "destroy call test");
+ hasher->destroy(hasher);
}
diff --git a/Source/charon/testcases/hmac_signer_test.c b/Source/charon/testcases/hmac_signer_test.c
index f11107d9b..1e437bb5a 100644
--- a/Source/charon/testcases/hmac_signer_test.c
+++ b/Source/charon/testcases/hmac_signer_test.c
@@ -108,8 +108,7 @@ void test_hmac_md5_signer(tester_t *tester)
- tester->assert_true(tester, (signer->destroy(signer) == SUCCESS), "signer destroy call check");
-
+ signer->destroy(signer);
global_logger_manager->destroy_logger(global_logger_manager,logger);
}
@@ -205,10 +204,7 @@ void test_hmac_sha1_signer(tester_t *tester)
tester->assert_true(tester, (valid == FALSE), "Signature not valid check");
}
-
-
- tester->assert_true(tester, (signer->destroy(signer) == SUCCESS), "signer destroy call check");
-
+ signer->destroy(signer);
global_logger_manager->destroy_logger(global_logger_manager,logger);
}
diff --git a/Source/charon/testcases/ike_sa_id_test.c b/Source/charon/testcases/ike_sa_id_test.c
index 7864c98fe..960e45106 100644
--- a/Source/charon/testcases/ike_sa_id_test.c
+++ b/Source/charon/testcases/ike_sa_id_test.c
@@ -83,11 +83,11 @@ void test_ike_sa_id(tester_t *tester)
/* check destroy functionality */
- tester->assert_true(tester,(ike_sa_id->destroy(ike_sa_id) == SUCCESS), "destroy call check");
- tester->assert_true(tester,(equal->destroy(equal) == SUCCESS), "destroy call check");
- tester->assert_true(tester,(clone->destroy(clone) == SUCCESS), "destroy call check");
- tester->assert_true(tester,(other1->destroy(other1) == SUCCESS), "destroy call check");
- tester->assert_true(tester,(other2->destroy(other2) == SUCCESS), "destroy call check");
- tester->assert_true(tester,(other3->destroy(other3) == SUCCESS), "destroy call check");
- tester->assert_true(tester,(other4->destroy(other4) == SUCCESS), "destroy call check");
+ ike_sa_id->destroy(ike_sa_id);
+ equal->destroy(equal);
+ clone->destroy(clone);
+ other1->destroy(other1);
+ other2->destroy(other2);
+ other3->destroy(other3);
+ other4->destroy(other4);
}
diff --git a/Source/charon/testcases/ike_sa_manager_test.c b/Source/charon/testcases/ike_sa_manager_test.c
index f49779159..733665f4f 100644
--- a/Source/charon/testcases/ike_sa_manager_test.c
+++ b/Source/charon/testcases/ike_sa_manager_test.c
@@ -95,8 +95,7 @@ void test_ike_sa_manager(tester_t *tester)
*
*/
- status = td.isam->create_and_checkout(td.isam, &ike_sa);
- tester->assert_true(tester, (status == SUCCESS), "checkout unexisting IKE_SA");
+ td.isam->create_and_checkout(td.isam, &ike_sa);
/* for testing purposes, we manipulate the responder spi.
* this is usually done be the response from the communication partner,
* but we don't have one...
@@ -212,8 +211,7 @@ void test_ike_sa_manager(tester_t *tester)
/* let them go acquiring */
sleep(1);
- status = td.isam->destroy(td.isam);
- tester->assert_true(tester, (status == SUCCESS), "ike_sa_manager destruction");
+ td.isam->destroy(td.isam);
for (i = 0; i < thread_count; i++)
{
diff --git a/Source/charon/testcases/linked_list_test.c b/Source/charon/testcases/linked_list_test.c
index 85a84e2b5..dd666c491 100644
--- a/Source/charon/testcases/linked_list_test.c
+++ b/Source/charon/testcases/linked_list_test.c
@@ -84,7 +84,7 @@ void test_linked_list(tester_t *tester)
tester->assert_true(tester,(strcmp((char *) test_value,"four") == 0), "get_first value check");
tester->assert_true(tester,(linked_list->get_count(linked_list) == 3), "count check");
- tester->assert_true(tester,(linked_list->destroy(linked_list) == SUCCESS), "destroy call check");
+ linked_list->destroy(linked_list);
}
/*
@@ -105,7 +105,7 @@ void test_linked_list_iterator(tester_t *tester)
iterator_t * iterator2;
- tester->assert_true(tester,(linked_list->create_iterator(linked_list,&iterator,TRUE) == SUCCESS), "create_iterator for it 1 call check");
+ linked_list->create_iterator(linked_list,&iterator,TRUE);
tester->assert_true(tester,iterator->has_next(iterator), "it 1 has_next value check");
iterator->current(iterator,&value);
@@ -115,7 +115,7 @@ void test_linked_list_iterator(tester_t *tester)
iterator->current(iterator,&value);
tester->assert_true(tester,(strcmp((char *) value,"four") == 0), "it 1 current value check");
- tester->assert_true(tester,(linked_list->create_iterator(linked_list,&iterator2,FALSE) == SUCCESS), "create_iterator for it 2 call check");
+ linked_list->create_iterator(linked_list,&iterator2,FALSE);
tester->assert_true(tester,iterator2->has_next(iterator2), "it 2 has_next value check");
iterator2->current(iterator2,&value);
@@ -147,10 +147,8 @@ void test_linked_list_iterator(tester_t *tester)
tester->assert_true(tester,iterator2->has_next(iterator2), "it 2 has_next value check");
tester->assert_false(tester,iterator2->has_next(iterator2), "it 2 has_next value check");
- tester->assert_true(tester,(iterator->destroy(iterator) == SUCCESS), "it 1 destroy call check");
-
- tester->assert_true(tester,(iterator2->destroy(iterator2) == SUCCESS), "it 2 destroy call check");
-
+ iterator->destroy(iterator);
+ iterator2->destroy(iterator2);
linked_list->destroy(linked_list);
}
@@ -180,12 +178,12 @@ void test_linked_list_insert_and_remove(tester_t *tester)
iterator->current(iterator,&value);
tester->assert_true(tester,(strcmp((char *) value,"three") == 0), "current value check");
- tester->assert_true(tester,(iterator->insert_before(iterator,"before_three") == SUCCESS), "insert_before call check");
+ iterator->insert_before(iterator,"before_three");
iterator->current(iterator,&value);
tester->assert_true(tester,(strcmp((char *) value,"three") == 0), "current value check");
- tester->assert_true(tester,(iterator->insert_after(iterator,"after_three") == SUCCESS), "insert_after call check");
+ iterator->insert_after(iterator,"after_three");
iterator->current(iterator,&value);
tester->assert_true(tester,(strcmp((char *) value,"three") == 0), "current value check");
diff --git a/Source/charon/testcases/parser_test.c b/Source/charon/testcases/parser_test.c
index aa735d445..b5972037f 100644
--- a/Source/charon/testcases/parser_test.c
+++ b/Source/charon/testcases/parser_test.c
@@ -179,8 +179,6 @@ void test_parser_with_sa_payload(tester_t *tester)
}
proposals->destroy(proposals);
-
-
sa_payload->destroy(sa_payload);
}
diff --git a/Source/charon/testcases/receiver_test.c b/Source/charon/testcases/receiver_test.c
index f90a66075..a1dd35ef1 100644
--- a/Source/charon/testcases/receiver_test.c
+++ b/Source/charon/testcases/receiver_test.c
@@ -83,5 +83,5 @@ void test_receiver(tester_t *tester)
job->destroy(job);
}
- tester->assert_true(tester, (receiver->destroy(receiver) == SUCCESS), "destroy call check");
+ receiver->destroy(receiver);
}
diff --git a/Source/charon/testcases/scheduler_test.c b/Source/charon/testcases/scheduler_test.c
index 390d3be02..425b43692 100644
--- a/Source/charon/testcases/scheduler_test.c
+++ b/Source/charon/testcases/scheduler_test.c
@@ -88,5 +88,5 @@ void test_scheduler(tester_t *tester)
}
/* destruction test */
- tester->assert_true(tester, (scheduler->destroy(scheduler) == SUCCESS), "destroy call check");
+ scheduler->destroy(scheduler);
}
diff --git a/Source/charon/testcases/send_queue_test.c b/Source/charon/testcases/send_queue_test.c
index 24b3ada9c..7e3d0bca2 100644
--- a/Source/charon/testcases/send_queue_test.c
+++ b/Source/charon/testcases/send_queue_test.c
@@ -138,5 +138,5 @@ void test_send_queue(tester_t *tester)
/* the send-queue has to have diserd_value count entries*/
tester->assert_true(tester,(send_queue->get_count(send_queue) == desired_value), "count value check");
- tester->assert_true(tester,(send_queue->destroy(send_queue) == SUCCESS), "destroy call check");
+ send_queue->destroy(send_queue);
}
diff --git a/Source/charon/testcases/sender_test.c b/Source/charon/testcases/sender_test.c
index 3ce30cabd..da018ad50 100644
--- a/Source/charon/testcases/sender_test.c
+++ b/Source/charon/testcases/sender_test.c
@@ -73,5 +73,5 @@ void test_sender(tester_t *tester)
received_packet->destroy(received_packet);
}
- tester->assert_true(tester, (sender->destroy(sender) == SUCCESS), "destroy call check");
+ sender->destroy(sender);
}
diff --git a/Source/charon/testcases/thread_pool_test.c b/Source/charon/testcases/thread_pool_test.c
index ad3200ccd..a72b88040 100644
--- a/Source/charon/testcases/thread_pool_test.c
+++ b/Source/charon/testcases/thread_pool_test.c
@@ -37,5 +37,5 @@ void test_thread_pool(tester_t *tester)
thread_pool_t *pool = thread_pool_create(desired_pool_size);
pool_size = pool->get_pool_size(pool);
tester->assert_true(tester, (desired_pool_size == pool_size), "thread creation");
- tester->assert_true(tester, (pool->destroy(pool) == SUCCESS), "threadpool destruction");
+ pool->destroy(pool);
}