This document describes the unit testing of the SCHEMESTATION scheduler. The purpose of the unit testing is to show that the basic functionality of the scheduler is implemented and that there are sufficient amount of checks for illegal instructions and other malicious use of this unit. Also the behaviour of the scheduler under high load is to be observed.
Scheduling is tested as follows:
Individual functions are tested against:
Test cases (first part: (D)one, (U)ndone, (I)ncomplete, second part: (S)uccess, (U)nsuccess, (I)ncomplete):
# | Test | Result |
---|---|---|
1 | Illegal pointer arguments (NULL) | D/S |
2 | Scheduler initialization | D/S |
3 | Inserting an item to the scheduler | D/S |
4 | Removing an item from the scheduler | D/S |
5 | Cycle count from the scheduler | D/S |
6 | 500 successive inserts | D/S |
7 | 500 successive removes | D/S |
8 | 500 successive (insert, insert, remove, remove) | D/S |
9 | Scheduler dispose | D/S |
10 | Scheduling two items | D/S |
Total Done | 10 | |
Total Successful | 10 |
For details, see the files ./src/libsrc/scheduler/new_tests.c and ./src/libsrc/scheduler/sch_test.c.
The scheduler uses a separate list package, which is tested separately. The list package tester consists of logic testing, that is the list functions are used both like they are supposed to and like they are not supposed to be used. See ./src/libsrc/scheduler/list_tests.c for further details.
Test cases (first part: (D)one, (U)ndone, (I)ncomplete, second part: (S)uccess, (U)nsuccess, (I)ncomplete):
# | Test | Result |
---|---|---|
1 | List initialization | D/S |
2 | Remove non-existing item | D/S |
3 | Add items to the list | D/S |
4 | Remove items to the list | D/S |
5 | Remove the same item twice | D/S |
6 | List iteration | D/S |
7 | Ring iteration mode | D/S |
8 | Stress test | D/S |
Total Done | 8 | |
Total Successful | 8 |