diff --git a/test_example.md b/test_example.md new file mode 100644 index 0000000..65f0462 --- /dev/null +++ b/test_example.md @@ -0,0 +1,365 @@ +Running test: ./vpl_execution 0 empty +Test passed! + + +Running test: ./vpl_execution 0 head +Test passed! + + +Running test: ./vpl_execution 0 tail +vpl_execution: doubly_linked_list_test.h:186: test_rq_tail: Assertion `tail && tail->pid == 2' failed. +Test killed by signal Aborted + +Running test: ./vpl_execution 0 enqueue +add tasks 1-4 +{ id = 1, state = ready, runtime = 0 } -- { id = 2, state = ready, runtime = 0 } -- { id = 3, state = ready, runtime = 0 } -- { id = 4, state = ready, runtime = 0 } -- END +free(): double free detected in tcache 2 +Test killed by signal Aborted + +Running test: ./vpl_execution 0 prepend +add tasks 1-4 + +=== Caught signal 11 (Segmentation fault) === +Faulty address: 0x10 + +Stack trace with source locations: + 0: 0x414b3d segv_handler at /home/p10758/tests.c:211 + 1: 0x7fcfd0cc0c30 ?? ??:0 + 2: 0x403de8 stud_rq_prepend at /home/p10758/doubly_linked_list.c:209 + 3: 0x40b336 test_rq_prepend at /home/p10758/doubly_linked_list_test.h:201 + 4: 0x41495b run_test_and_checks at /home/p10758/tests.c:146 + 5: 0x415566 main at /home/p10758/tests.c:409 + 6: 0x7fcfd0cab610 ?? ??:0 + 7: 0x7fcfd0cab6c0 ?? ??:0 + 8: 0x403285 _start at ??:? +exit()/exec() detected (test did not return to harness) + +Running test: ./vpl_execution 0 find + +=== Caught signal 11 (Segmentation fault) === +Faulty address: (nil) + +Stack trace with source locations: + 0: 0x414b3d segv_handler at /home/p10758/tests.c:211 + 1: 0x7f868e1c9c30 ?? ??:0 + 2: 0x403adc stud_rq_find at /home/p10758/doubly_linked_list.c:84 + 3: 0x40b059 test_rq_find at /home/p10758/doubly_linked_list_test.h:143 + 4: 0x41495b run_test_and_checks at /home/p10758/tests.c:146 + 5: 0x415566 main at /home/p10758/tests.c:409 + 6: 0x7f868e1b4610 ?? ??:0 + 7: 0x7f868e1b46c0 ?? ??:0 + 8: 0x403285 _start at ??:? +exit()/exec() detected (test did not return to harness) + +Running test: ./vpl_execution 0 length +Test passed! + + +Running test: ./vpl_execution 0 destroy + +=== Caught signal 11 (Segmentation fault) === +Faulty address: 0x10 + +Stack trace with source locations: + 0: 0x414b3d segv_handler at /home/p10758/tests.c:211 + 1: 0x7f6ddbfd5c30 ?? ??:0 + 2: 0x403a62 stud_rq_destroy at /home/p10758/doubly_linked_list.c:61 (discriminator 1) + 3: 0x40aefa test_rq_destroy at /home/p10758/doubly_linked_list_test.h:128 + 4: 0x41495b run_test_and_checks at /home/p10758/tests.c:146 + 5: 0x415566 main at /home/p10758/tests.c:409 + 6: 0x7f6ddbfc0610 ?? ??:0 + 7: 0x7f6ddbfc06c0 ?? ??:0 + 8: 0x403285 _start at ??:? +exit()/exec() detected (test did not return to harness) + +Running test: ./vpl_execution 3 start +err: a task with pid 1 already exists in the runqueue +add task 1 +{ id = 1, state = running, runtime = 0 } -- END +add task 2 +{ id = 1, state = running, runtime = 0 } -- { id = 2, state = ready, runtime = 0 } -- END +add task 3 +{ id = 1, state = running, runtime = 0 } -- { id = 2, state = ready, runtime = 0 } -- { id = 3, state = ready, runtime = 0 } -- END +add task 1 again +err: a task with pid 1 already exists in the runqueue +{ id = 1, state = running, runtime = 0 } -- { id = 2, state = ready, runtime = 0 } -- { id = 3, state = ready, runtime = 0 } -- END +Task (1, running) error at position 0 +vpl_execution: scheduler_round_robin_test.h:73: test_RR_start: Assertion `rq_eq(&sol, &stu)' failed. +Test killed by signal Aborted + +Running test: ./vpl_execution 3 clock_tick +{ id = 1, state = running, runtime = 0 } -- { id = 2, state = terminated, runtime = 0 } -- { id = 3, state = ready, runtime = 0 } -- { id = 4, state = terminated, runtime = 0 } -- { id = 8, state = ready, runtime = 0 } -- { id = 14, state = blocked, runtime = 0 } -- END +running clock tick... +running clock tick... +running clock tick... +running clock tick... +running clock tick... +running clock tick... +running clock tick... +running clock tick... +running clock tick... +running clock tick... +{ id = 3, state = running, runtime = 0 } -- { id = 2, state = terminated, runtime = 0 } -- { id = 4, state = terminated, runtime = 0 } -- { id = 8, state = ready, runtime = 0 } -- { id = 14, state = blocked, runtime = 0 } -- END +Error while iterating over the list +vpl_execution: scheduler_round_robin_test.h:216: test_RR_clock_tick: Assertion `rq_eq(&sol, &stu)' failed. +Test killed by signal Aborted + +Running test: ./vpl_execution 3 elect_blocked +{ id = 1, state = blocked, runtime = 0 } -- { id = 2, state = terminated, runtime = 0 } -- { id = 3, state = ready, runtime = 0 } -- { id = 4, state = terminated, runtime = 0 } -- { id = 8, state = ready, runtime = 0 } -- END +electing new task... + +=== Caught signal 11 (Segmentation fault) === +Faulty address: 0x10 + +Stack trace with source locations: + 0: 0x414b3d segv_handler at /home/p10758/tests.c:211 + 1: 0x7fa0ec7c2c30 ?? ??:0 + 2: 0x403558 stud_RR_elect at /home/p10758/scheduler_round_robin.c:66 + 3: 0x409891 test_RR_elect_blocked at /home/p10758/scheduler_round_robin_test.h:127 + 4: 0x41495b run_test_and_checks at /home/p10758/tests.c:146 + 5: 0x415566 main at /home/p10758/tests.c:409 + 6: 0x7fa0ec7ad610 ?? ??:0 + 7: 0x7fa0ec7ad6c0 ?? ??:0 + 8: 0x403285 _start at ??:? +exit()/exec() detected (test did not return to harness) + +Running test: ./vpl_execution 3 elect_running +{ id = 1, state = running, runtime = 0 } -- { id = 2, state = terminated, runtime = 0 } -- { id = 3, state = ready, runtime = 0 } -- { id = 4, state = terminated, runtime = 0 } -- { id = 8, state = ready, runtime = 0 } -- { id = 14, state = blocked, runtime = 0 } -- END +electing new task... + +=== Caught signal 11 (Segmentation fault) === +Faulty address: 0x10 + +Stack trace with source locations: + 0: 0x414b3d segv_handler at /home/p10758/tests.c:211 + 1: 0x7fb07a1b9c30 ?? ??:0 + 2: 0x403558 stud_RR_elect at /home/p10758/scheduler_round_robin.c:66 + 3: 0x409748 test_RR_elect_running at /home/p10758/scheduler_round_robin_test.h:109 + 4: 0x41495b run_test_and_checks at /home/p10758/tests.c:146 + 5: 0x415566 main at /home/p10758/tests.c:409 + 6: 0x7fb07a1a4610 ?? ??:0 + 7: 0x7fb07a1a46c0 ?? ??:0 + 8: 0x403285 _start at ??:? +exit()/exec() detected (test did not return to harness) + +Running test: ./vpl_execution 3 terminate +{ id = 1, state = running, runtime = 0 } -- { id = 2, state = terminated, runtime = 0 } -- { id = 3, state = ready, runtime = 0 } -- { id = 4, state = terminated, runtime = 0 } -- { id = 8, state = ready, runtime = 0 } -- { id = 14, state = blocked, runtime = 0 } -- END +task terminating... + +=== Caught signal 11 (Segmentation fault) === +Faulty address: 0x10 + +Stack trace with source locations: + 0: 0x414b3d segv_handler at /home/p10758/tests.c:211 + 1: 0x7fdb2653dc30 ?? ??:0 + 2: 0x40362d stud_RR_terminate at /home/p10758/scheduler_round_robin.c:95 + 3: 0x4099f2 test_RR_terminate at /home/p10758/scheduler_round_robin_test.h:148 + 4: 0x41495b run_test_and_checks at /home/p10758/tests.c:146 + 5: 0x415566 main at /home/p10758/tests.c:409 + 6: 0x7fdb26528610 ?? ??:0 + 7: 0x7fdb265286c0 ?? ??:0 + 8: 0x403285 _start at ??:? +exit()/exec() detected (test did not return to harness) + +Running test: ./vpl_execution 3 wait +{ id = 1, state = running, runtime = 0 } -- { id = 2, state = terminated, runtime = 0 } -- { id = 3, state = ready, runtime = 0 } -- { id = 4, state = terminated, runtime = 0 } -- { id = 8, state = ready, runtime = 0 } -- { id = 14, state = blocked, runtime = 0 } -- END +task is waiting... + +=== Caught signal 11 (Segmentation fault) === +Faulty address: 0x10 + +Stack trace with source locations: + 0: 0x414b3d segv_handler at /home/p10758/tests.c:211 + 1: 0x7f18b339bc30 ?? ??:0 + 2: 0x4037a8 stud_RR_wait at /home/p10758/scheduler_round_robin.c:147 + 3: 0x409b53 test_RR_wait at /home/p10758/scheduler_round_robin_test.h:169 + 4: 0x41495b run_test_and_checks at /home/p10758/tests.c:146 + 5: 0x415566 main at /home/p10758/tests.c:409 + 6: 0x7f18b3386610 ?? ??:0 + 7: 0x7f18b33866c0 ?? ??:0 + 8: 0x403285 _start at ??:? +exit()/exec() detected (test did not return to harness) + +Running test: ./vpl_execution 3 wake_up +{ id = 1, state = running, runtime = 0 } -- { id = 2, state = terminated, runtime = 0 } -- { id = 3, state = ready, runtime = 0 } -- { id = 4, state = terminated, runtime = 0 } -- { id = 8, state = ready, runtime = 0 } -- { id = 14, state = blocked, runtime = 0 } -- END +task 14 waking up... + +=== Caught signal 11 (Segmentation fault) === +Faulty address: 0x8 + +Stack trace with source locations: + 0: 0x414b3d segv_handler at /home/p10758/tests.c:211 + 1: 0x7f026f040c30 ?? ??:0 + 2: 0x4038a3 stud_RR_wake_up at /home/p10758/scheduler_round_robin.c:173 + 3: 0x409cbe test_RR_wake_up at /home/p10758/scheduler_round_robin_test.h:190 + 4: 0x41495b run_test_and_checks at /home/p10758/tests.c:146 + 5: 0x415566 main at /home/p10758/tests.c:409 + 6: 0x7f026f02b610 ?? ??:0 + 7: 0x7f026f02b6c0 ?? ??:0 + 8: 0x403285 _start at ??:? +exit()/exec() detected (test did not return to harness) + +Running test: ./vpl_execution 3 scripted_1 +{ id = 1, state = running, runtime = 0 } -- { id = 2, state = terminated, runtime = 0 } -- { id = 3, state = ready, runtime = 0 } -- { id = 4, state = terminated, runtime = 0 } -- { id = 8, state = ready, runtime = 0 } -- { id = 14, state = blocked, runtime = 0 } -- END +running clock tick... +running clock tick... +running clock tick... +running clock tick... +running clock tick... +{ id = 1, state = running, runtime = 0 } -- { id = 2, state = terminated, runtime = 0 } -- { id = 3, state = ready, runtime = 0 } -- { id = 4, state = terminated, runtime = 0 } -- { id = 8, state = ready, runtime = 0 } -- { id = 14, state = blocked, runtime = 0 } -- END +task is waiting... + +=== Caught signal 11 (Segmentation fault) === +Faulty address: 0x10 + +Stack trace with source locations: + 0: 0x414b3d segv_handler at /home/p10758/tests.c:211 + 1: 0x7f6a9d552c30 ?? ??:0 + 2: 0x4037a8 stud_RR_wait at /home/p10758/scheduler_round_robin.c:147 + 3: 0x403988 stud_RR at /home/p10758/scheduler_round_robin.c:214 + 4: 0x40a27b test_RR_scripted_1 at /home/p10758/scheduler_round_robin_test.h:263 + 5: 0x41495b run_test_and_checks at /home/p10758/tests.c:146 + 6: 0x415566 main at /home/p10758/tests.c:409 + 7: 0x7f6a9d53d610 ?? ??:0 + 8: 0x7f6a9d53d6c0 ?? ??:0 + 9: 0x403285 _start at ??:? +exit()/exec() detected (test did not return to harness) + +Running test: ./vpl_execution 4 fcfs_long_job +Expected Schedule: +1 1 1 1 1 1 1 1 1 1 2 2 3 3 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +1 1 1 1 1 1 1 1 1 1 2 2 3 3 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 fcfs_zero_runtime +Expected Schedule: +2 2 2 2 2 3 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +2 2 2 2 2 3 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 fcfs_long_job_random +Expected Schedule: +1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 3 3 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 3 3 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 fcfs_zero_runtime_random +Expected Schedule: +2 2 2 2 3 3 3 3 3 3 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +2 2 2 2 3 3 3 3 3 3 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 fcfs_random +Expected Schedule: +0 0 3 3 3 0 0 4 4 4 4 4 4 2 2 2 2 2 2 1 1 1 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +0 0 3 3 3 0 0 4 4 4 4 4 4 2 2 2 2 2 2 1 1 1 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 sjf_non_preemptive +Expected Schedule: +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 sjf_same_runtime +Expected Schedule: +1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 sjf_long_job_starvation +Expected Schedule: +2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 sjf_all_zero_arrival +Expected Schedule: +2 3 3 4 4 4 4 4 4 4 4 4 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +2 3 3 4 4 4 4 4 4 4 4 4 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 sjf_non_preemptive_random +Expected Schedule: +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 sjf_same_runtime_random +Expected Schedule: +1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 sjf_long_job_starvation_random +Expected Schedule: +2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +2 3 4 5 6 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 sjf_all_zero_arrival_random +Expected Schedule: +1 1 1 1 3 3 3 3 3 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +Your Schedule: +1 1 1 1 3 3 3 3 3 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +Test passed! + + +Running test: ./vpl_execution 4 sjf_random +[DEBUG] test_sched_sjf_random invoked +Test passed! + + +Comment :=>> Some tests failed: +- 0 tail +- 0 enqueue +- 0 prepend +- 0 find +- 0 destroy +- 3 start +- 3 clock_tick +- 3 elect_blocked +- 3 elect_running +- 3 terminate +- 3 wait +- 3 wake_up +- 3 scripted_1 + +