- memory allocation tests removed
authorJan Hutter <jhutter@hsr.ch>
Tue, 29 Nov 2005 07:15:52 +0000 (07:15 -0000)
committerJan Hutter <jhutter@hsr.ch>
Tue, 29 Nov 2005 07:15:52 +0000 (07:15 -0000)
Source/charon/testcases/diffie_hellman_test.c
Source/charon/testcases/event_queue_test.c
Source/charon/testcases/generator_test.c
Source/charon/testcases/ike_sa_id_test.c
Source/charon/testcases/ike_sa_manager_test.c
Source/charon/testcases/ike_sa_test.c
Source/charon/testcases/job_queue_test.c
Source/charon/testcases/receiver_test.c
Source/charon/testcases/scheduler_test.c
Source/charon/testcases/send_queue_test.c

index ee2c30b..95ea525 100644 (file)
@@ -48,10 +48,10 @@ void test_diffie_hellman(tester_t *tester)
        other_diffie_hellman = diffie_hellman_create(MODP_1024_BIT);
        tester->assert_true(tester,(other_diffie_hellman != NULL), "create call check");        
 
-       tester->assert_true(tester,(    my_diffie_hellman->get_my_public_value(my_diffie_hellman,&my_public_value) == SUCCESS), "get_my_public_value call check");
+       my_diffie_hellman->get_my_public_value(my_diffie_hellman,&my_public_value);
        logger->log_chunk(logger,RAW,"My public value",&my_public_value);
 
-       tester->assert_true(tester,(    other_diffie_hellman->get_my_public_value(other_diffie_hellman,&other_public_value) == SUCCESS), "get_my_public_value call check");
+       other_diffie_hellman->get_my_public_value(other_diffie_hellman,&other_public_value);
        logger->log_chunk(logger,RAW,"Other public value",&other_public_value);
 
        my_diffie_hellman->set_other_public_value(my_diffie_hellman,other_public_value);
index b2d4376..4383529 100644 (file)
@@ -68,7 +68,6 @@ struct event_queue_test_s{
 static void event_queue_insert_thread(event_queue_test_t * testinfos)
 {
        timeval_t current_time;
-       tester_t *tester = testinfos->tester;
        timeval_t time;
        job_t * job;
        int i,j;
@@ -83,7 +82,7 @@ static void event_queue_insert_thread(event_queue_test_t * testinfos)
                        time.tv_usec = 0;
                        time.tv_sec = current_time.tv_sec + i;
 
-                       tester->assert_true(tester,(testinfos->event_queue->add_absolute(testinfos->event_queue,job,time) == SUCCESS), "add call check");
+                       testinfos->event_queue->add_absolute(testinfos->event_queue,job,time);
                }
        }
 }
@@ -131,7 +130,7 @@ void test_event_queue(tester_t *tester)
                {
                        job_t *job;
                
-                       tester->assert_true(tester,(event_queue->get(event_queue,&job) == SUCCESS), "get call check");
+                       job = event_queue->get(event_queue);
                        gettimeofday(&current_time,NULL);
                        tester->assert_true(tester,((current_time.tv_sec - start_time.tv_sec) == i), "value of entry check");
                        tester->assert_true(tester,(job->destroy(job) == SUCCESS), "job destroy call check");
@@ -140,6 +139,6 @@ void test_event_queue(tester_t *tester)
        }
 
 
-       tester->assert_true(tester,(event_queue->destroy(event_queue) == SUCCESS), "destroy call check");
+       event_queue->destroy(event_queue);
        return;
 }
index 4dacbf3..a99a00a 100644 (file)
@@ -47,7 +47,6 @@ void test_generator_with_header_payload(tester_t *tester)
        generator_t *generator;
        ike_header_t *header_data;
        chunk_t generated_data;
-       status_t status;
        logger_t *logger;
        
        logger = global_logger_manager->create_logger(global_logger_manager,TESTER,"header payload");
@@ -98,7 +97,6 @@ void test_generator_with_header_payload(tester_t *tester)
        tester->assert_true(tester,(generator != NULL), "generator create check");
        
        generator->generate_payload(generator,(payload_t *)header_data);
-       tester->assert_true(tester,(status == SUCCESS),"generate_payload call check");
        
        generator->write_to_chunk(generator,&generated_data);
 
@@ -133,7 +131,6 @@ void test_generator_with_transform_attribute(tester_t *tester)
 {
        generator_t *generator;
        transform_attribute_t *attribute;
-       status_t status;
        chunk_t generated_data;
        logger_t *logger;
        
@@ -153,7 +150,7 @@ void test_generator_with_transform_attribute(tester_t *tester)
        };
        tester->assert_true(tester,(memcmp(expected_generation,generated_data.ptr,sizeof(expected_generation)) == 0), "compare generated data");
        allocator_free_chunk(&generated_data);
-       tester->assert_true(tester,(attribute->destroy(attribute) == SUCCESS), "attribute destroy call check");
+       attribute->destroy(attribute);
        generator->destroy(generator);
        
        /* test attribute with 2 byte data */   
@@ -178,7 +175,7 @@ void test_generator_with_transform_attribute(tester_t *tester)
        tester->assert_true(tester,(memcmp(expected_generation2,generated_data.ptr,sizeof(expected_generation2)) == 0), "compare generated data");
 
        allocator_free_chunk(&generated_data);
-       tester->assert_true(tester,(attribute->destroy(attribute) == SUCCESS), "attribute destroy call check");
+       attribute->destroy(attribute);
        generator->destroy(generator);
 
 
@@ -192,11 +189,9 @@ void test_generator_with_transform_attribute(tester_t *tester)
        data.ptr = (void *) stringval;
        data.len = 25;
                
-       status = attribute->set_value_chunk(attribute,data);
-       tester->assert_true(tester,(status == SUCCESS),"set_value call check");
+       attribute->set_value_chunk(attribute,data);
        
-       status = attribute->set_attribute_type(attribute,456);
-       tester->assert_true(tester,(status == SUCCESS),"set_attribute_type call check");
+       attribute->set_attribute_type(attribute,456);
 
 
        generator->generate_payload(generator,(payload_t *)attribute);
@@ -216,7 +211,7 @@ void test_generator_with_transform_attribute(tester_t *tester)
        tester->assert_true(tester,(memcmp(expected_generation3,generated_data.ptr,sizeof(expected_generation3)) == 0), "compare generated data");
 
        allocator_free_chunk(&generated_data);
-       tester->assert_true(tester,(attribute->destroy(attribute) == SUCCESS), "attribute destroy call check");
+       attribute->destroy(attribute);
        generator->destroy(generator);
                
 
@@ -234,7 +229,6 @@ void test_generator_with_transform_substructure(tester_t *tester)
        transform_attribute_t *attribute1, *attribute2;
        transform_substructure_t *transform;
        chunk_t data;
-       status_t status;
        chunk_t generated_data;
        logger_t *logger;
        
@@ -249,10 +243,8 @@ void test_generator_with_transform_substructure(tester_t *tester)
        char *stringval = "abcd";
        data.ptr = (void *) stringval;
        data.len = 4;
-       status = attribute1->set_value_chunk(attribute1,data);
-       tester->assert_true(tester,(status == SUCCESS),"set_value call check");
-       status = attribute1->set_attribute_type(attribute1,0);
-       tester->assert_true(tester,(status == SUCCESS),"set_attribute_type call check");
+       attribute1->set_value_chunk(attribute1,data);
+       attribute1->set_attribute_type(attribute1,0);
        logger->log(logger,CONTROL,"attribute1 created");
 
        /* create attribute 2 */
@@ -260,23 +252,17 @@ void test_generator_with_transform_substructure(tester_t *tester)
        stringval = "efgh";
        data.ptr = (void *) stringval;
        data.len = 4;
-       status = attribute2->set_value_chunk(attribute2,data);
-       tester->assert_true(tester,(status == SUCCESS),"set_value call check");
-       status = attribute2->set_attribute_type(attribute2,0);
-       tester->assert_true(tester,(status == SUCCESS),"set_attribute_type call check");
+       attribute2->set_value_chunk(attribute2,data);
+       attribute2->set_attribute_type(attribute2,0);
        logger->log(logger,CONTROL,"attribute2 created");
 
        /* create transform */
        transform = transform_substructure_create();
        tester->assert_true(tester,(transform != NULL), "transform create check");
-       status = transform->add_transform_attribute(transform,attribute1);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_attribute call check");
-       status = transform->add_transform_attribute(transform,attribute2);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_attribute call check");
-       status = transform->set_transform_type(transform,5); /* hex 5 */
-       tester->assert_true(tester,(status == SUCCESS),"set_transform_type call check");
-       status = transform->set_transform_id(transform,65000); /* hex FDE8 */
-       tester->assert_true(tester,(status == SUCCESS),"set_transform_id call check");
+       transform->add_transform_attribute(transform,attribute1);
+       transform->add_transform_attribute(transform,attribute2);
+       transform->set_transform_type(transform,5); /* hex 5 */
+       transform->set_transform_id(transform,65000); /* hex FDE8 */
        
        
        logger->log(logger,CONTROL,"transform created");
@@ -296,7 +282,7 @@ void test_generator_with_transform_substructure(tester_t *tester)
        tester->assert_true(tester,(memcmp(expected_generation3,generated_data.ptr,sizeof(expected_generation3)) == 0), "compare generated data");
 
        allocator_free_chunk(&generated_data);
-       tester->assert_true(tester,(transform->destroy(transform) == SUCCESS), "transform destroy call check");
+       transform->destroy(transform);
        generator->destroy(generator);
        
        
@@ -314,7 +300,6 @@ void test_generator_with_proposal_substructure(tester_t *tester)
        transform_substructure_t *transform1, *transform2;
        proposal_substructure_t *proposal;
        chunk_t data;
-       status_t status;
        chunk_t generated_data;
        logger_t *logger;
        
@@ -329,10 +314,9 @@ void test_generator_with_proposal_substructure(tester_t *tester)
        char *stringval = "abcd";
        data.ptr = (void *) stringval;
        data.len = 4;
-       status = attribute1->set_value_chunk(attribute1,data);
-       tester->assert_true(tester,(status == SUCCESS),"set_value call check");
-       status = attribute1->set_attribute_type(attribute1,0);
-       tester->assert_true(tester,(status == SUCCESS),"set_attribute_type call check");
+       attribute1->set_value_chunk(attribute1,data);
+       attribute1->set_attribute_type(attribute1,0);
+       
        logger->log(logger,CONTROL,"attribute1 created");
 
        /* create attribute 2 */
@@ -340,10 +324,8 @@ void test_generator_with_proposal_substructure(tester_t *tester)
        stringval = "efgh";
        data.ptr = (void *) stringval;
        data.len = 4;
-       status = attribute2->set_value_chunk(attribute2,data);
-       tester->assert_true(tester,(status == SUCCESS),"set_value call check");
-       status = attribute2->set_attribute_type(attribute2,0);
-       tester->assert_true(tester,(status == SUCCESS),"set_attribute_type call check");
+       attribute2->set_value_chunk(attribute2,data);
+       attribute2->set_attribute_type(attribute2,0);
        logger->log(logger,CONTROL,"attribute2 created");
 
        /* create attribute 3 */
@@ -351,34 +333,25 @@ void test_generator_with_proposal_substructure(tester_t *tester)
        stringval = "ijkl";
        data.ptr = (void *) stringval;
        data.len = 4;
-       status = attribute3->set_value_chunk(attribute3,data);
-       tester->assert_true(tester,(status == SUCCESS),"set_value call check");
-       status = attribute3->set_attribute_type(attribute3,0);
-       tester->assert_true(tester,(status == SUCCESS),"set_attribute_type call check");
+       attribute3->set_value_chunk(attribute3,data);
+       attribute3->set_attribute_type(attribute3,0);
        logger->log(logger,CONTROL,"attribute3 created");
 
        /* create transform 1*/
        transform1 = transform_substructure_create();
        tester->assert_true(tester,(transform1 != NULL), "transform create check");
-       status = transform1->add_transform_attribute(transform1,attribute1);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_attribute call check");
-       status = transform1->add_transform_attribute(transform1,attribute2);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_attribute call check");
-       status = transform1->set_transform_type(transform1,5); /* hex 5 */
-       tester->assert_true(tester,(status == SUCCESS),"set_transform_type call check");
-       status = transform1->set_transform_id(transform1,65000); /* hex FDE8 */
-       tester->assert_true(tester,(status == SUCCESS),"set_transform_id call check");
+       transform1->add_transform_attribute(transform1,attribute1);
+       transform1->add_transform_attribute(transform1,attribute2);
+       transform1->set_transform_type(transform1,5); /* hex 5 */
+       transform1->set_transform_id(transform1,65000); /* hex FDE8 */
        
        /* create transform 2*/
        transform2 = transform_substructure_create();
        tester->assert_true(tester,(transform2 != NULL), "transform create check");
-       status = transform2->add_transform_attribute(transform2,attribute3);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_attribute call check");
-       status = transform2->set_transform_type(transform2,3); /* hex 3 */
-       tester->assert_true(tester,(status == SUCCESS),"set_transform_type call check");
-       status = transform2->set_transform_id(transform2,4); /* hex 4 */
-       tester->assert_true(tester,(status == SUCCESS),"set_transform_id call check");
-       
+       transform2->add_transform_attribute(transform2,attribute3);
+       transform2->set_transform_type(transform2,3); /* hex 3 */
+       transform2->set_transform_id(transform2,4); /* hex 4 */
+               
        logger->log(logger,CONTROL,"transforms created");
        
        proposal = proposal_substructure_create();
@@ -388,17 +361,11 @@ void test_generator_with_proposal_substructure(tester_t *tester)
        data.ptr = (void *) stringval;
        data.len = 8;
        
-       status = proposal->add_transform_substructure(proposal,transform1);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_substructure call check");
-       status = proposal->add_transform_substructure(proposal,transform2);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_substructure call check");        
-       status = proposal->set_spi(proposal,data);
-       tester->assert_true(tester,(status == SUCCESS),"set_spi call check");   
-       status = proposal->set_proposal_number(proposal,7);
-       tester->assert_true(tester,(status == SUCCESS),"set_proposal_number call check");       
-       status = proposal->set_protocol_id(proposal,4);
-       tester->assert_true(tester,(status == SUCCESS),"set_protocol_id call check");   
-       
+       proposal->add_transform_substructure(proposal,transform1);
+       proposal->add_transform_substructure(proposal,transform2);
+       proposal->set_spi(proposal,data);
+       proposal->set_proposal_number(proposal,7);
+       proposal->set_protocol_id(proposal,4);  
 
        generator->generate_payload(generator,(payload_t *)proposal);
        generator->write_to_chunk(generator,&generated_data);
@@ -431,7 +398,7 @@ void test_generator_with_proposal_substructure(tester_t *tester)
        tester->assert_true(tester,(memcmp(expected_generation,generated_data.ptr,sizeof(expected_generation)) == 0), "compare generated data");
 
        allocator_free_chunk(&generated_data);
-       tester->assert_true(tester,(proposal->destroy(proposal) == SUCCESS), "proposal destroy call check");
+       proposal->destroy(proposal);
        generator->destroy(generator);
        
        
@@ -451,7 +418,6 @@ void test_generator_with_sa_payload(tester_t *tester)
        ike_header_t *ike_header;
        
        chunk_t data;
-       status_t status;
        chunk_t generated_data;
        logger_t *logger;
        
@@ -466,10 +432,8 @@ void test_generator_with_sa_payload(tester_t *tester)
        char *stringval = "abcd";
        data.ptr = (void *) stringval;
        data.len = 4;
-       status = attribute1->set_value_chunk(attribute1,data);
-       tester->assert_true(tester,(status == SUCCESS),"set_value call check");
-       status = attribute1->set_attribute_type(attribute1,0);
-       tester->assert_true(tester,(status == SUCCESS),"set_attribute_type call check");
+       attribute1->set_value_chunk(attribute1,data);
+       attribute1->set_attribute_type(attribute1,0);
        logger->log(logger,CONTROL,"attribute1 created");
 
        /* create attribute 2 */
@@ -477,10 +441,8 @@ void test_generator_with_sa_payload(tester_t *tester)
        stringval = "efgh";
        data.ptr = (void *) stringval;
        data.len = 4;
-       status = attribute2->set_value_chunk(attribute2,data);
-       tester->assert_true(tester,(status == SUCCESS),"set_value call check");
-       status = attribute2->set_attribute_type(attribute2,0);
-       tester->assert_true(tester,(status == SUCCESS),"set_attribute_type call check");
+       attribute2->set_value_chunk(attribute2,data);
+       attribute2->set_attribute_type(attribute2,0);
        logger->log(logger,CONTROL,"attribute2 created");
 
        /* create attribute 3 */
@@ -488,34 +450,25 @@ void test_generator_with_sa_payload(tester_t *tester)
        stringval = "ijkl";
        data.ptr = (void *) stringval;
        data.len = 4;
-       status = attribute3->set_value_chunk(attribute3,data);
-       tester->assert_true(tester,(status == SUCCESS),"set_value call check");
-       status = attribute3->set_attribute_type(attribute3,0);
-       tester->assert_true(tester,(status == SUCCESS),"set_attribute_type call check");
+       attribute3->set_value_chunk(attribute3,data);
+       attribute3->set_attribute_type(attribute3,0);
        logger->log(logger,CONTROL,"attribute3 created");
 
        /* create transform 1*/
        transform1 = transform_substructure_create();
        tester->assert_true(tester,(transform1 != NULL), "transform create check");
-       status = transform1->add_transform_attribute(transform1,attribute1);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_attribute call check");
-       status = transform1->add_transform_attribute(transform1,attribute2);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_attribute call check");
-       status = transform1->set_transform_type(transform1,5); /* hex 5 */
-       tester->assert_true(tester,(status == SUCCESS),"set_transform_type call check");
-       status = transform1->set_transform_id(transform1,65000); /* hex FDE8 */
-       tester->assert_true(tester,(status == SUCCESS),"set_transform_id call check");
-       
+       transform1->add_transform_attribute(transform1,attribute1);
+       transform1->add_transform_attribute(transform1,attribute2);
+       transform1->set_transform_type(transform1,5); /* hex 5 */
+       transform1->set_transform_id(transform1,65000); /* hex FDE8 */
+               
        /* create transform 2*/
        transform2 = transform_substructure_create();
        tester->assert_true(tester,(transform2 != NULL), "transform create check");
-       status = transform2->add_transform_attribute(transform2,attribute3);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_attribute call check");
-       status = transform2->set_transform_type(transform2,3); /* hex 3 */
-       tester->assert_true(tester,(status == SUCCESS),"set_transform_type call check");
-       status = transform2->set_transform_id(transform2,4); /* hex 4 */
-       tester->assert_true(tester,(status == SUCCESS),"set_transform_id call check");
-       
+       transform2->add_transform_attribute(transform2,attribute3);
+       transform2->set_transform_type(transform2,3); /* hex 3 */
+       transform2->set_transform_id(transform2,4); /* hex 4 */
+               
        logger->log(logger,CONTROL,"transforms created");
        
        /* create proposal 1 */
@@ -526,24 +479,17 @@ void test_generator_with_sa_payload(tester_t *tester)
        data.ptr = (void *) stringval;
        data.len = 8;
        
-       status = proposal1->add_transform_substructure(proposal1,transform1);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_substructure call check");
-       status = proposal1->add_transform_substructure(proposal1,transform2);
-       tester->assert_true(tester,(status == SUCCESS),"add_transform_substructure call check");        
-       status = proposal1->set_spi(proposal1,data);
-       tester->assert_true(tester,(status == SUCCESS),"set_spi call check");   
-       status = proposal1->set_proposal_number(proposal1,7);
-       tester->assert_true(tester,(status == SUCCESS),"set_proposal_number call check");       
-       status = proposal1->set_protocol_id(proposal1,4);
-       tester->assert_true(tester,(status == SUCCESS),"set_protocol_id call check");   
+       proposal1->add_transform_substructure(proposal1,transform1);
+       proposal1->add_transform_substructure(proposal1,transform2);
+       proposal1->set_spi(proposal1,data);
+       proposal1->set_proposal_number(proposal1,7);
+       proposal1->set_protocol_id(proposal1,4);
        
        /* create proposal 2 */
        proposal2 = proposal_substructure_create();
        tester->assert_true(tester,(proposal2 != NULL), "proposal create check");
-       status = proposal2->set_proposal_number(proposal2,7);
-       tester->assert_true(tester,(status == SUCCESS),"set_proposal_number call check");       
-       status = proposal2->set_protocol_id(proposal2,5);
-       tester->assert_true(tester,(status == SUCCESS),"set_protocol_id call check");
+       proposal2->set_proposal_number(proposal2,7);
+       proposal2->set_protocol_id(proposal2,5);
 
        /* create sa_payload */
        sa_payload = sa_payload_create();
@@ -608,8 +554,8 @@ void test_generator_with_sa_payload(tester_t *tester)
        tester->assert_true(tester,(memcmp(expected_generation,generated_data.ptr,sizeof(expected_generation)) == 0), "compare generated data");
 
        allocator_free_chunk(&generated_data);
-       tester->assert_true(tester,(ike_header->destroy(ike_header) == SUCCESS), "ike_header destroy call check");
-       tester->assert_true(tester,(sa_payload->destroy(sa_payload) == SUCCESS), "sa_payload destroy call check");
+       ike_header->destroy(ike_header);
+       sa_payload->destroy(sa_payload);
        generator->destroy(generator);
                
        global_logger_manager->destroy_logger(global_logger_manager,logger);    
@@ -664,7 +610,7 @@ void test_generator_with_ke_payload(tester_t *tester)
 
        allocator_free_chunk(&generated_data);  
        
-       tester->assert_true(tester,(ke_payload->destroy(ke_payload) == SUCCESS), "sa_payload destroy call check");
+       ke_payload->destroy(ke_payload);
        generator->destroy(generator);
                
        global_logger_manager->destroy_logger(global_logger_manager,logger);    
@@ -724,7 +670,7 @@ void test_generator_with_notify_payload(tester_t *tester)
 
        allocator_free_chunk(&generated_data);  
        
-       tester->assert_true(tester,(notify_payload->destroy(notify_payload) == SUCCESS), "notify_payload destroy call check");
+       notify_payload->destroy(notify_payload);
        generator->destroy(generator);
                
        global_logger_manager->destroy_logger(global_logger_manager,logger);    
@@ -778,7 +724,7 @@ void test_generator_with_nonce_payload(tester_t *tester)
        allocator_free_chunk(&generated_data);
        
        
-       tester->assert_true(tester,(nonce_payload->destroy(nonce_payload) == SUCCESS), "notify_payload destroy call check");
+       nonce_payload->destroy(nonce_payload);
        generator->destroy(generator);
                
        global_logger_manager->destroy_logger(global_logger_manager,logger);    
index 960e451..d3d5670 100644 (file)
@@ -32,7 +32,6 @@ void test_ike_sa_id(tester_t *tester)
        ike_sa_id_t *ike_sa_id, *clone, *equal, *other1, *other2, *other3, *other4;
        u_int64_t initiator, initiator2, responder, responder2;
        bool is_initiator;
-       bool are_equal = FALSE;
        
        initiator = 0;
 
@@ -53,33 +52,25 @@ void test_ike_sa_id(tester_t *tester)
        other4 = ike_sa_id_create(initiator, responder, is_initiator);
        
        /* check equality */
-       tester->assert_true(tester,(ike_sa_id->equals(ike_sa_id,equal,&are_equal) == SUCCESS), "equal call check");
-       tester->assert_true(tester,(are_equal == TRUE), "equal check");
-       tester->assert_true(tester,(equal->equals(equal,ike_sa_id,&are_equal) == SUCCESS), "equal call check");
-       tester->assert_true(tester,(are_equal == TRUE), "equal check"); 
+       tester->assert_true(tester,(ike_sa_id->equals(ike_sa_id,equal) == TRUE), "equal check");
+       tester->assert_true(tester,(equal->equals(equal,ike_sa_id) == TRUE), "equal check");
 
        /* check clone functionality and equality*/     
-       tester->assert_true(tester,(ike_sa_id->clone(ike_sa_id,&clone) == SUCCESS), "clone call check");
+       clone = ike_sa_id->clone(ike_sa_id);
        tester->assert_false(tester,(clone == ike_sa_id), "clone pointer check");       
-       tester->assert_true(tester,(ike_sa_id->equals(ike_sa_id,clone,&are_equal) == SUCCESS), "equal call check");
-       tester->assert_true(tester,(are_equal == TRUE), "equal check");
+       tester->assert_true(tester,(ike_sa_id->equals(ike_sa_id,clone) == TRUE), "equal check");
        
        /* check for non equality */
-       tester->assert_true(tester,(ike_sa_id->equals(ike_sa_id,other1,&are_equal) == SUCCESS), "equal call check");
-       tester->assert_false(tester,(are_equal == TRUE), "equal check");
+       tester->assert_false(tester,(ike_sa_id->equals(ike_sa_id,other1) == TRUE), "equal check");
 
-       tester->assert_true(tester,(ike_sa_id->equals(ike_sa_id,other2,&are_equal) == SUCCESS), "equal call check");
-       tester->assert_false(tester,(are_equal == TRUE), "equal check");
+       tester->assert_false(tester,(ike_sa_id->equals(ike_sa_id,other2) == TRUE), "equal check");
 
-       tester->assert_true(tester,(ike_sa_id->equals(ike_sa_id,other3,&are_equal) == SUCCESS), "equal call check");
-       tester->assert_false(tester,(are_equal == TRUE), "equal check");
+       tester->assert_false(tester,(ike_sa_id->equals(ike_sa_id,other3) == TRUE), "equal check");
 
-       tester->assert_true(tester,(ike_sa_id->equals(ike_sa_id,other4,&are_equal) == SUCCESS), "equal call check");
-       tester->assert_false(tester,(are_equal == TRUE), "equal check");
+       tester->assert_false(tester,(ike_sa_id->equals(ike_sa_id,other4) == TRUE), "equal check");
 
-       tester->assert_true(tester,(other4->replace_values(other4,ike_sa_id) == SUCCESS), "replace values call check");
-       tester->assert_true(tester,(ike_sa_id->equals(ike_sa_id,other4,&are_equal) == SUCCESS), "equal call check");
-       tester->assert_true(tester,(are_equal == TRUE), "equal check");
+       other4->replace_values(other4,ike_sa_id);
+       tester->assert_true(tester,(ike_sa_id->equals(ike_sa_id,other4) == TRUE), "equal check");
        
        
        /* check destroy functionality */
index 733665f..08cc20a 100644 (file)
@@ -105,8 +105,7 @@ void test_ike_sa_manager(tester_t *tester)
        sa_id = ike_sa->get_id(ike_sa);
        sa_id->set_responder_spi(sa_id, responder);     
        
-       status = sa_id->clone(sa_id,&ike_sa_id);
-       tester->assert_true(tester, (status == SUCCESS), "clone sa id");
+       ike_sa_id = sa_id->clone(sa_id);
                
        /* check in, so we should have a "completed" sa, specified by ike_sa_id */
        status = td.isam->checkin(td.isam, ike_sa);
index 0d8d9c6..d8646ad 100644 (file)
@@ -50,7 +50,7 @@ void test_ike_sa(tester_t *tester)
        
        tester->assert_true(tester,(ike_sa != NULL), "ike_sa pointer check");
 */
-       tester->assert_true(tester,(ike_sa->destroy(ike_sa) == SUCCESS), "destroy call check");
+       ike_sa->destroy(ike_sa);
        
        ike_sa_id->destroy(ike_sa_id);
 }
index 13576e8..542cf0e 100644 (file)
@@ -78,7 +78,7 @@ static void test_job_queue_receiver(job_queue_test_t * testinfo)
        for (i = 0; i < testinfo->remove_item_count; i++)
        {
                job_t *job;
-               testinfo->tester->assert_true(testinfo->tester,(testinfo->job_queue->get(testinfo->job_queue,&job) == SUCCESS), "get job call check");
+               job = testinfo->job_queue->get(testinfo->job_queue);
                testinfo->tester->assert_true(testinfo->tester,(job->get_type(job) == INITIATE_IKE_SA), "job type check");
                testinfo->tester->assert_true(testinfo->tester,(job->destroy(job) == SUCCESS), "job destroy call check");
        }
@@ -129,5 +129,5 @@ void test_job_queue(tester_t *tester)
        /* the job-queue has to have disered_value count entries! */
        tester->assert_true(tester,(job_queue->get_count(job_queue) == desired_value), "get count value check");
 
-       tester->assert_true(tester,(job_queue->destroy(job_queue) == SUCCESS), "destroy call check");
+       job_queue->destroy(job_queue);
 }
index a1dd35e..fb5c48e 100644 (file)
@@ -72,7 +72,7 @@ void test_receiver(tester_t *tester)
 
        for (i = 0; i < NUMBER_OF_PACKETS_TO_SEND; i++)
        {
-               global_job_queue->get(global_job_queue,&job);
+               job = global_job_queue->get(global_job_queue);
                tester->assert_true(tester, (job->get_type(job) == INCOMING_PACKET), "job type check");
                
                ((incoming_packet_job_t *)(job))->get_packet((incoming_packet_job_t *)(job),&received_packet);
index 425b436..bdf4a1e 100644 (file)
@@ -77,7 +77,7 @@ void test_scheduler(tester_t *tester)
        /* check job order */
        for (current = 0; current < job_count; current++)
        {
-               global_job_queue->get(global_job_queue, &(jobs[current]));
+               jobs[current] = global_job_queue->get(global_job_queue);
                incoming_packet_job_t *current_job;
                current_job = (incoming_packet_job_t*) jobs[current];
                packet_t *packet;
index 7e3d0bc..786dd2b 100644 (file)
@@ -69,7 +69,7 @@ static void test_send_queue_sender(send_queue_test_t * testinfo)
        {
                packet_t *packet = packet_create(AF_INET);
                testinfo->tester->assert_true(testinfo->tester,(packet != NULL), "create packet call check");
-               testinfo->tester->assert_true(testinfo->tester,(testinfo->send_queue->add(testinfo->send_queue,packet) == SUCCESS), "add packet call check");
+               testinfo->send_queue->add(testinfo->send_queue,packet);
        }
 }
 
@@ -84,7 +84,7 @@ static void test_send_queue_receiver(send_queue_test_t * testinfo)
        for (i = 0; i < testinfo->remove_item_count; i++)
        {
                packet_t *packet;
-               testinfo->tester->assert_true(testinfo->tester,(testinfo->send_queue->get(testinfo->send_queue,&packet) == SUCCESS), "get packet call check");
+               packet = testinfo->send_queue->get(testinfo->send_queue);
 
                testinfo->tester->assert_true(testinfo->tester,(        packet != NULL), "packet not NULL call check");