- return value cleanup
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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++)
|
||||
{
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -179,8 +179,6 @@ void test_parser_with_sa_payload(tester_t *tester)
|
||||
}
|
||||
proposals->destroy(proposals);
|
||||
|
||||
|
||||
|
||||
sa_payload->destroy(sa_payload);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user