- modified for new linked list
authorMartin Willi <martin@strongswan.org>
Thu, 17 Nov 2005 13:30:32 +0000 (13:30 -0000)
committerMartin Willi <martin@strongswan.org>
Thu, 17 Nov 2005 13:30:32 +0000 (13:30 -0000)
Source/charon/testcases/linked_list_test.c
Source/charon/testcases/scheduler_test.c

index 4ab43af..4418f1e 100644 (file)
@@ -180,12 +180,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,(linked_list->insert_before(linked_list,iterator,"before_three") == SUCCESS), "insert_before call check");
+       tester->assert_true(tester,(iterator->insert_before(iterator,"before_three") == SUCCESS), "insert_before call check");
        iterator->current(iterator,&value);
        tester->assert_true(tester,(strcmp((char *) value,"three") == 0), "current value check");
 
 
-       tester->assert_true(tester,(linked_list->insert_after(linked_list,iterator,"after_three") == SUCCESS), "insert_after call check");
+       tester->assert_true(tester,(iterator->insert_after(iterator,"after_three") == SUCCESS), "insert_after call check");
        iterator->current(iterator,&value);
        tester->assert_true(tester,(strcmp((char *) value,"three") == 0), "current value check");
        
index 43b136f..1f05670 100644 (file)
@@ -48,7 +48,7 @@ void test_scheduler(tester_t *tester)
        for (current = 0; current < job_count; current++)
        {
                /* misusing for testing only */
-               jobs[current] = (job_t *) incoming_packet_job_create((packet_t*)current);
+               jobs[current] = (job_t *) incoming_packet_job_create((packet_t*)current+1);
                global_event_queue->add_relative(global_event_queue, jobs[current], (current+1) * 500);
        }
        
@@ -82,7 +82,7 @@ void test_scheduler(tester_t *tester)
                packet_t *packet;
                current_job->get_packet(current_job,&packet);
                
-               tester->assert_true(tester, (((int)packet) == current), "job order");
+               tester->assert_true(tester, (((int)packet) == current+1), "job order");
                jobs[current]->destroy(jobs[current]);
        }