]> Kevux Git Server - fll/commitdiff
Progress: Continue re-designing of the memory logic.
authorKevin Day <thekevinday@gmail.com>
Fri, 11 Aug 2023 03:11:01 +0000 (22:11 -0500)
committerKevin Day <thekevinday@gmail.com>
Fri, 11 Aug 2023 03:11:01 +0000 (22:11 -0500)
This makes a second pass around f_thread memory and addresses other bugs found.

312 files changed:
build/stand_alone/fake.config.h
build/stand_alone/firewall.config.h
level_0/f_thread/c/thread/attribute.c
level_0/f_thread/c/thread/attribute.h
level_0/f_thread/c/thread/barrier.c
level_0/f_thread/c/thread/barrier.h
level_0/f_thread/c/thread/barrier_attribute.c
level_0/f_thread/c/thread/barrier_attribute.h
level_0/f_thread/c/thread/condition.c
level_0/f_thread/c/thread/condition.h
level_0/f_thread/c/thread/condition_attribute.c
level_0/f_thread/c/thread/condition_attribute.h
level_0/f_thread/c/thread/id.c
level_0/f_thread/c/thread/id.h
level_0/f_thread/c/thread/key.c
level_0/f_thread/c/thread/key.h
level_0/f_thread/c/thread/lock.c
level_0/f_thread/c/thread/lock.h
level_0/f_thread/c/thread/lock_attribute.c
level_0/f_thread/c/thread/lock_attribute.h
level_0/f_thread/c/thread/mutex.c
level_0/f_thread/c/thread/mutex.h
level_0/f_thread/c/thread/mutex_attribute.c
level_0/f_thread/c/thread/mutex_attribute.h
level_0/f_thread/c/thread/once.c
level_0/f_thread/c/thread/once.h
level_0/f_thread/c/thread/private-once.c [deleted file]
level_0/f_thread/c/thread/private-once.h [deleted file]
level_0/f_thread/c/thread/semaphore.c
level_0/f_thread/c/thread/semaphore.h
level_0/f_thread/c/thread/set.c
level_0/f_thread/c/thread/set.h
level_0/f_thread/c/thread/spin.c
level_0/f_thread/c/thread/spin.h
level_0/f_thread/data/build/settings-mocks
level_0/f_thread/data/build/settings-tests
level_0/f_thread/tests/unit/c/mock-thread.c
level_0/f_thread/tests/unit/c/mock-thread.h
level_0/f_thread/tests/unit/c/test-thread-attributes_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-attributes_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-attributes_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-attributes_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-attributes_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-barriers_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-barriers_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-barriers_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-barriers_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-barriers_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-conditions_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-conditions_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-conditions_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-conditions_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-conditions_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-ids_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-ids_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-ids_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-ids_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-ids_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-ids_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-ids_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-ids_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-ids_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-ids_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-ids_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-ids_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-keys_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-keys_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-keys_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-keys_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-locks_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-locks_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-locks_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-locks_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-locks_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-mutexs_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-mutexs_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-mutexs_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-onces_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-onces_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-onces_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-onces_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-onces_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-semaphores_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-semaphores_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-semaphores_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-sets_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-sets_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-sets_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-sets_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-sets_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-spins_adjust.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_adjust.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_adjust_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-spins_adjust_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-spins_decimate_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_decimate_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_decrease_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_decrease_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_increase.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_increase.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_increase_by.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_increase_by.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_resize.c [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_resize.h [deleted file]
level_0/f_thread/tests/unit/c/test-thread-spins_resize_callback.c [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread-spins_resize_callback.h [new file with mode: 0644]
level_0/f_thread/tests/unit/c/test-thread.c
level_0/f_thread/tests/unit/c/test-thread.h
level_0/f_type_array/c/type_array/cell.c
level_0/f_type_array/c/type_array/cell.h
level_0/f_type_array/c/type_array/file.c
level_0/f_type_array/c/type_array/file.h
level_0/f_type_array/c/type_array/fll_id.c
level_0/f_type_array/c/type_array/fll_id.h
level_0/f_type_array/c/type_array/int128.c
level_0/f_type_array/c/type_array/int128.h
level_0/f_type_array/c/type_array/int16.c
level_0/f_type_array/c/type_array/int16.h
level_0/f_type_array/c/type_array/int32.c
level_0/f_type_array/c/type_array/int32.h
level_0/f_type_array/c/type_array/int64.c
level_0/f_type_array/c/type_array/int64.h
level_0/f_type_array/c/type_array/int8.c
level_0/f_type_array/c/type_array/int8.h
level_0/f_type_array/c/type_array/number_unsigned.c
level_0/f_type_array/c/type_array/number_unsigned.h
level_0/f_type_array/c/type_array/poll.c
level_0/f_type_array/c/type_array/poll.h
level_0/f_type_array/c/type_array/state.c
level_0/f_type_array/c/type_array/state.h
level_0/f_type_array/c/type_array/status.c
level_0/f_type_array/c/type_array/status.h
level_0/f_type_array/c/type_array/uint128.c
level_0/f_type_array/c/type_array/uint128.h
level_0/f_type_array/c/type_array/uint16.c
level_0/f_type_array/c/type_array/uint16.h
level_0/f_type_array/c/type_array/uint32.c
level_0/f_type_array/c/type_array/uint32.h
level_0/f_type_array/c/type_array/uint64.c
level_0/f_type_array/c/type_array/uint64.h
level_0/f_type_array/c/type_array/uint8.c
level_0/f_type_array/c/type_array/uint8.h
level_0/f_type_array/tests/unit/c/mock-type_array.c
level_0/f_type_array/tests/unit/c/mock-type_array.h

index 1d824a9a5f1c3829a5362f7ebb316cc04b5f3797..80dfa1b48c7449f40b329da8652bdeb2bd862477 100644 (file)
 #define _di_f_thread_attribute_detach_set_
 #define _di_f_thread_attribute_guard_get_
 #define _di_f_thread_attribute_guard_set_
-#define _di_f_thread_attributes_adjust_
 #define _di_f_thread_attribute_scheduler_inherit_get_
 #define _di_f_thread_attribute_scheduler_inherit_set_
 #define _di_f_thread_attribute_scheduler_parameter_get_
 #define _di_f_thread_attribute_scheduler_policy_set_
 #define _di_f_thread_attribute_scope_get_
 #define _di_f_thread_attribute_scope_set_
-#define _di_f_thread_attributes_decimate_by_
-#define _di_f_thread_attributes_decrease_by_
-#define _di_f_thread_attributes_increase_
-#define _di_f_thread_attributes_increase_by_
-#define _di_f_thread_attributes_resize_
+#define _di_f_thread_attributes_adjust_callback_
+#define _di_f_thread_attributes_resize_callback_
 #define _di_f_thread_attributes_t_
 #define _di_f_thread_attribute_stack_get_
 #define _di_f_thread_attribute_stack_set_
 //#define _di_f_thread_attribute_t_
 #define _di_f_thread_barrier_attribute_create_
 #define _di_f_thread_barrier_attribute_delete_
-#define _di_f_thread_barrier_attributes_adjust_
-#define _di_f_thread_barrier_attributes_decimate_by_
-#define _di_f_thread_barrier_attributes_decrease_by_
 #define _di_f_thread_barrier_attribute_shared_get_
 #define _di_f_thread_barrier_attribute_shared_set_
-#define _di_f_thread_barrier_attributes_increase_
-#define _di_f_thread_barrier_attributes_increase_by_
-#define _di_f_thread_barrier_attributes_resize_
+#define _di_f_thread_barrier_attributes_adjust_callback_
+#define _di_f_thread_barrier_attributes_resize_callback_
 #define _di_f_thread_barrier_attributes_t_
 #define _di_f_thread_barrier_attribute_t_
 #define _di_f_thread_barrier_create_
 #define _di_f_thread_barrier_delete_
-#define _di_f_thread_barriers_adjust_
-#define _di_f_thread_barriers_decimate_by_
-#define _di_f_thread_barriers_decrease_by_
-#define _di_f_thread_barriers_increase_
-#define _di_f_thread_barriers_increase_by_
-#define _di_f_thread_barriers_resize_
+#define _di_f_thread_barriers_adjust_callback_
+#define _di_f_thread_barriers_resize_callback_
 #define _di_f_thread_barriers_t_
 #define _di_f_thread_barrier_t_
 #define _di_f_thread_barrier_wait_
 #define _di_f_thread_condition_attribute_clock_set_
 #define _di_f_thread_condition_attribute_create_
 #define _di_f_thread_condition_attribute_delete_
-#define _di_f_thread_condition_attributes_adjust_
-#define _di_f_thread_condition_attributes_decimate_by_
-#define _di_f_thread_condition_attributes_decrease_by_
 #define _di_f_thread_condition_attribute_shared_get_
 #define _di_f_thread_condition_attribute_shared_set_
-#define _di_f_thread_condition_attributes_increase_
-#define _di_f_thread_condition_attributes_increase_by_
-#define _di_f_thread_condition_attributes_resize_
+#define _di_f_thread_condition_attributes_adjust_callback_
+#define _di_f_thread_condition_attributes_resize_callback_
 #define _di_f_thread_condition_attributes_t_
 #define _di_f_thread_condition_attribute_t_
 #define _di_f_thread_condition_create_
 #define _di_f_thread_condition_delete_
-#define _di_f_thread_conditions_adjust_
-#define _di_f_thread_conditions_decimate_by_
-#define _di_f_thread_conditions_decrease_by_
 #define _di_f_thread_condition_signal_
 #define _di_f_thread_condition_signal_all_
-#define _di_f_thread_conditions_increase_
-#define _di_f_thread_conditions_increase_by_
-#define _di_f_thread_conditions_resize_
+#define _di_f_thread_conditions_adjust_callback_
+#define _di_f_thread_conditions_resize_callback_
 #define _di_f_thread_conditions_t_
 #define _di_f_thread_condition_t_
 #define _di_f_thread_condition_wait_
 //#define _di_f_thread_create_
 #define _di_f_thread_detach_
 #define _di_f_thread_exit_
-#define _di_f_thread_ids_adjust_
-#define _di_f_thread_ids_decimate_by_
-#define _di_f_thread_ids_decrease_by_
-#define _di_f_thread_ids_increase_
-#define _di_f_thread_ids_increase_by_
-#define _di_f_thread_ids_resize_
 #define _di_f_thread_ids_t_
 //#define _di_f_thread_id_t_
 //#define _di_f_thread_join_
 #define _di_f_thread_key_create_
 #define _di_f_thread_key_delete_
 #define _di_f_thread_key_get_
-#define _di_f_thread_keys_adjust_
-#define _di_f_thread_keys_decimate_by_
-#define _di_f_thread_keys_decrease_by_
 #define _di_f_thread_key_set_
-#define _di_f_thread_keys_increase_
-#define _di_f_thread_keys_increase_by_
-#define _di_f_thread_keys_resize_
+#define _di_f_thread_keys_adjust_callback_
+#define _di_f_thread_keys_resize_callback_
 #define _di_f_thread_keys_t_
 #define _di_f_thread_key_t_
+#define _di_f_thread_lock_attribute_adjust_callback_
 #define _di_f_thread_lock_attribute_create_
 #define _di_f_thread_lock_attribute_delete_
-#define _di_f_thread_lock_attributes_adjust_
-#define _di_f_thread_lock_attributes_decimate_by_
-#define _di_f_thread_lock_attributes_decrease_by_
+#define _di_f_thread_lock_attribute_resize_callback_
 #define _di_f_thread_lock_attribute_shared_get_
 #define _di_f_thread_lock_attribute_shared_set_
-#define _di_f_thread_lock_attributes_increase_
-#define _di_f_thread_lock_attributes_increase_by_
-#define _di_f_thread_lock_attributes_resize_
+#define _di_f_thread_lock_attributes_adjust_callback_
+#define _di_f_thread_lock_attributes_resize_callback_
 #define _di_f_thread_lock_attributes_t_
 #define _di_f_thread_lock_attribute_t_
 #define _di_f_thread_lock_create_
 #define _di_f_thread_lock_read_
 #define _di_f_thread_lock_read_timed_
 #define _di_f_thread_lock_read_try_
-#define _di_f_thread_locks_adjust_
-#define _di_f_thread_locks_decimate_by_
-#define _di_f_thread_locks_decrease_by_
-#define _di_f_thread_locks_increase_
-#define _di_f_thread_locks_increase_by_
-#define _di_f_thread_locks_resize_
+#define _di_f_thread_locks_adjust_callback_
+#define _di_f_thread_locks_resize_callback_
 #define _di_f_thread_locks_t_
 #define _di_f_thread_lock_t_
 #define _di_f_thread_lock_write_
 #define _di_f_thread_lock_write_timed_
 #define _di_f_thread_lock_write_try_
+#define _di_f_thread_mutex_attribute_adjust_callback_
 #define _di_f_thread_mutex_attribute_create_
 #define _di_f_thread_mutex_attribute_delete_
 #define _di_f_thread_mutex_attribute_priority_ceiling_get_
 #define _di_f_thread_mutex_attribute_priority_ceiling_set_
 #define _di_f_thread_mutex_attribute_protocol_get_
 #define _di_f_thread_mutex_attribute_protocol_set_
-#define _di_f_thread_mutex_attributes_adjust_
-#define _di_f_thread_mutex_attributes_decimate_by_
-#define _di_f_thread_mutex_attributes_decrease_by_
+#define _di_f_thread_mutex_attribute_resize_callback_
 #define _di_f_thread_mutex_attribute_shared_get_
 #define _di_f_thread_mutex_attribute_shared_set_
-#define _di_f_thread_mutex_attributes_increase_
-#define _di_f_thread_mutex_attributes_increase_by_
-#define _di_f_thread_mutex_attributes_resize_
+#define _di_f_thread_mutex_attributes_adjust_callback_
+#define _di_f_thread_mutex_attributes_resize_callback_
 #define _di_f_thread_mutex_attributes_t_
 #define _di_f_thread_mutex_attribute_t_
 #define _di_f_thread_mutex_attribute_type_get_
 #define _di_f_thread_mutex_lock_try_
 #define _di_f_thread_mutex_priority_ceiling_get_
 #define _di_f_thread_mutex_priority_ceiling_set_
-#define _di_f_thread_mutexs_adjust_
-#define _di_f_thread_mutexs_decimate_by_
-#define _di_f_thread_mutexs_decrease_by_
-#define _di_f_thread_mutexs_increase_
-#define _di_f_thread_mutexs_increase_by_
-#define _di_f_thread_mutexs_resize_
+#define _di_f_thread_mutexs_adjust_callback_
+#define _di_f_thread_mutexs_resize_callback_
 #define _di_f_thread_mutexs_t_
 #define _di_f_thread_mutex_t_
 #define _di_f_thread_mutex_unlock_
 #define _di_f_thread_once_
-#define _di_f_thread_onces_adjust_
-#define _di_f_thread_onces_decimate_by_
-#define _di_f_thread_onces_decrease_by_
-#define _di_f_thread_onces_increase_
-#define _di_f_thread_onces_increase_by_
-#define _di_f_thread_onces_resize_
 #define _di_f_thread_onces_t_
 #define _di_f_thread_once_t_
 #define _di_f_thread_scheduler_parameter_get_
 #define _di_f_thread_semaphore_lock_
 #define _di_f_thread_semaphore_lock_timed_
 #define _di_f_thread_semaphore_lock_try_
-#define _di_f_thread_semaphores_adjust_
-#define _di_f_thread_semaphores_decimate_by_
-#define _di_f_thread_semaphores_decrease_by_
-#define _di_f_thread_semaphores_increase_
-#define _di_f_thread_semaphores_increase_by_
-#define _di_f_thread_semaphores_resize_
+#define _di_f_thread_semaphores_adjust_callback_
+#define _di_f_thread_semaphores_resize_callback_
 #define _di_f_thread_semaphores_t_
 #define _di_f_thread_semaphore_t_
 #define _di_f_thread_semaphore_unlock_
 #define _di_f_thread_semaphore_value_get_
-#define _di_f_thread_sets_adjust_
-#define _di_f_thread_sets_decimate_by_
-#define _di_f_thread_sets_decrease_by_
-#define _di_f_thread_sets_increase_
-#define _di_f_thread_sets_increase_by_
-#define _di_f_thread_sets_resize_
+#define _di_f_thread_sets_adjust_callback_
+#define _di_f_thread_sets_resize_callback_
 #define _di_f_thread_sets_t_
 #define _di_f_thread_set_t_
 //#define _di_f_thread_signal_mask_
 #define _di_f_thread_spin_delete_
 #define _di_f_thread_spin_lock_
 #define _di_f_thread_spin_lock_try_
-#define _di_f_thread_spins_adjust_
-#define _di_f_thread_spins_decimate_by_
-#define _di_f_thread_spins_decrease_by_
-#define _di_f_thread_spins_increase_
-#define _di_f_thread_spins_increase_by_
-#define _di_f_thread_spins_resize_
+#define _di_f_thread_spins_adjust_callback_
+#define _di_f_thread_spins_resize_callback_
 #define _di_f_thread_spins_t_
 #define _di_f_thread_spin_t_
 #define _di_f_thread_spin_unlock_
index 428e4b9cd225706714418f5c9e586426aff2e6aa..bd25c5c0e5baf0cb92c1e1205912f1149cd64080 100644 (file)
 #define _di_f_thread_attribute_detach_set_
 #define _di_f_thread_attribute_guard_get_
 #define _di_f_thread_attribute_guard_set_
-#define _di_f_thread_attributes_adjust_
 #define _di_f_thread_attribute_scheduler_inherit_get_
 #define _di_f_thread_attribute_scheduler_inherit_set_
 #define _di_f_thread_attribute_scheduler_parameter_get_
 #define _di_f_thread_attribute_scheduler_policy_set_
 #define _di_f_thread_attribute_scope_get_
 #define _di_f_thread_attribute_scope_set_
-#define _di_f_thread_attributes_decimate_by_
-#define _di_f_thread_attributes_decrease_by_
-#define _di_f_thread_attributes_increase_
-#define _di_f_thread_attributes_increase_by_
-#define _di_f_thread_attributes_resize_
 //#define _di_f_thread_attributes_t_
 #define _di_f_thread_attribute_stack_get_
 #define _di_f_thread_attribute_stack_set_
 //#define _di_f_thread_attribute_t_
 #define _di_f_thread_barrier_attribute_create_
 #define _di_f_thread_barrier_attribute_delete_
-#define _di_f_thread_barrier_attributes_adjust_
-#define _di_f_thread_barrier_attributes_decimate_by_
-#define _di_f_thread_barrier_attributes_decrease_by_
 #define _di_f_thread_barrier_attribute_shared_get_
 #define _di_f_thread_barrier_attribute_shared_set_
-#define _di_f_thread_barrier_attributes_increase_
-#define _di_f_thread_barrier_attributes_increase_by_
-#define _di_f_thread_barrier_attributes_resize_
 //#define _di_f_thread_barrier_attributes_t_
 //#define _di_f_thread_barrier_attribute_t_
 #define _di_f_thread_barrier_create_
 #define _di_f_thread_barrier_delete_
-#define _di_f_thread_barriers_adjust_
-#define _di_f_thread_barriers_decimate_by_
-#define _di_f_thread_barriers_decrease_by_
-#define _di_f_thread_barriers_increase_
-#define _di_f_thread_barriers_increase_by_
-#define _di_f_thread_barriers_resize_
 //#define _di_f_thread_barriers_t_
 //#define _di_f_thread_barrier_t_
 #define _di_f_thread_barrier_wait_
 #define _di_f_thread_condition_attribute_clock_set_
 #define _di_f_thread_condition_attribute_create_
 #define _di_f_thread_condition_attribute_delete_
-#define _di_f_thread_condition_attributes_adjust_
-#define _di_f_thread_condition_attributes_decimate_by_
-#define _di_f_thread_condition_attributes_decrease_by_
 #define _di_f_thread_condition_attribute_shared_get_
 #define _di_f_thread_condition_attribute_shared_set_
-#define _di_f_thread_condition_attributes_increase_
-#define _di_f_thread_condition_attributes_increase_by_
-#define _di_f_thread_condition_attributes_resize_
 //#define _di_f_thread_condition_attributes_t_
 //#define _di_f_thread_condition_attribute_t_
 #define _di_f_thread_condition_create_
 #define _di_f_thread_condition_delete_
-#define _di_f_thread_conditions_adjust_
-#define _di_f_thread_conditions_decimate_by_
-#define _di_f_thread_conditions_decrease_by_
 #define _di_f_thread_condition_signal_
 #define _di_f_thread_condition_signal_all_
-#define _di_f_thread_conditions_increase_
-#define _di_f_thread_conditions_increase_by_
-#define _di_f_thread_conditions_resize_
 //#define _di_f_thread_conditions_t_
 //#define _di_f_thread_condition_t_
 #define _di_f_thread_condition_wait_
 #define _di_f_thread_create_
 #define _di_f_thread_detach_
 #define _di_f_thread_exit_
-#define _di_f_thread_ids_adjust_
-#define _di_f_thread_ids_decimate_by_
-#define _di_f_thread_ids_decrease_by_
-#define _di_f_thread_ids_increase_
-#define _di_f_thread_ids_increase_by_
-#define _di_f_thread_ids_resize_
 //#define _di_f_thread_ids_t_
 //#define _di_f_thread_id_t_
 #define _di_f_thread_join_
 #define _di_f_thread_key_create_
 #define _di_f_thread_key_delete_
 #define _di_f_thread_key_get_
-#define _di_f_thread_keys_adjust_
-#define _di_f_thread_keys_decimate_by_
-#define _di_f_thread_keys_decrease_by_
 #define _di_f_thread_key_set_
-#define _di_f_thread_keys_increase_
-#define _di_f_thread_keys_increase_by_
-#define _di_f_thread_keys_resize_
 //#define _di_f_thread_keys_t_
 //#define _di_f_thread_key_t_
 #define _di_f_thread_lock_attribute_create_
 #define _di_f_thread_lock_attribute_delete_
-#define _di_f_thread_lock_attributes_adjust_
-#define _di_f_thread_lock_attributes_decimate_by_
-#define _di_f_thread_lock_attributes_decrease_by_
 #define _di_f_thread_lock_attribute_shared_get_
 #define _di_f_thread_lock_attribute_shared_set_
-#define _di_f_thread_lock_attributes_increase_
-#define _di_f_thread_lock_attributes_increase_by_
-#define _di_f_thread_lock_attributes_resize_
 //#define _di_f_thread_lock_attributes_t_
 //#define _di_f_thread_lock_attribute_t_
 #define _di_f_thread_lock_create_
 #define _di_f_thread_lock_read_
 #define _di_f_thread_lock_read_timed_
 #define _di_f_thread_lock_read_try_
-#define _di_f_thread_locks_adjust_
-#define _di_f_thread_locks_decimate_by_
-#define _di_f_thread_locks_decrease_by_
-#define _di_f_thread_locks_increase_
-#define _di_f_thread_locks_increase_by_
-#define _di_f_thread_locks_resize_
 //#define _di_f_thread_locks_t_
 //#define _di_f_thread_lock_t_
 #define _di_f_thread_lock_write_
 #define _di_f_thread_mutex_attribute_priority_ceiling_set_
 #define _di_f_thread_mutex_attribute_protocol_get_
 #define _di_f_thread_mutex_attribute_protocol_set_
-#define _di_f_thread_mutex_attributes_adjust_
-#define _di_f_thread_mutex_attributes_decimate_by_
-#define _di_f_thread_mutex_attributes_decrease_by_
 #define _di_f_thread_mutex_attribute_shared_get_
 #define _di_f_thread_mutex_attribute_shared_set_
-#define _di_f_thread_mutex_attributes_increase_
-#define _di_f_thread_mutex_attributes_increase_by_
-#define _di_f_thread_mutex_attributes_resize_
 //#define _di_f_thread_mutex_attributes_t_
 //#define _di_f_thread_mutex_attribute_t_
 #define _di_f_thread_mutex_attribute_type_get_
 #define _di_f_thread_mutex_lock_try_
 #define _di_f_thread_mutex_priority_ceiling_get_
 #define _di_f_thread_mutex_priority_ceiling_set_
-#define _di_f_thread_mutexs_adjust_
-#define _di_f_thread_mutexs_decimate_by_
-#define _di_f_thread_mutexs_decrease_by_
-#define _di_f_thread_mutexs_increase_
-#define _di_f_thread_mutexs_increase_by_
-#define _di_f_thread_mutexs_resize_
 //#define _di_f_thread_mutexs_t_
 //#define _di_f_thread_mutex_t_
 #define _di_f_thread_mutex_unlock_
 #define _di_f_thread_once_
-#define _di_f_thread_onces_adjust_
-#define _di_f_thread_onces_decimate_by_
-#define _di_f_thread_onces_decrease_by_
-#define _di_f_thread_onces_increase_
-#define _di_f_thread_onces_increase_by_
-#define _di_f_thread_onces_resize_
 //#define _di_f_thread_onces_t_
 //#define _di_f_thread_once_t_
 #define _di_f_thread_scheduler_parameter_get_
 #define _di_f_thread_semaphore_lock_
 #define _di_f_thread_semaphore_lock_timed_
 #define _di_f_thread_semaphore_lock_try_
-#define _di_f_thread_semaphores_adjust_
-#define _di_f_thread_semaphores_decimate_by_
-#define _di_f_thread_semaphores_decrease_by_
-#define _di_f_thread_semaphores_increase_
-#define _di_f_thread_semaphores_increase_by_
-#define _di_f_thread_semaphores_resize_
 //#define _di_f_thread_semaphores_t_
 //#define _di_f_thread_semaphore_t_
 #define _di_f_thread_semaphore_unlock_
 #define _di_f_thread_semaphore_value_get_
-#define _di_f_thread_sets_adjust_
-#define _di_f_thread_sets_decimate_by_
-#define _di_f_thread_sets_decrease_by_
-#define _di_f_thread_sets_increase_
-#define _di_f_thread_sets_increase_by_
-#define _di_f_thread_sets_resize_
 //#define _di_f_thread_sets_t_
 //#define _di_f_thread_set_t_
 //#define _di_f_thread_signal_mask_
 #define _di_f_thread_spin_delete_
 #define _di_f_thread_spin_lock_
 #define _di_f_thread_spin_lock_try_
-#define _di_f_thread_spins_adjust_
-#define _di_f_thread_spins_decimate_by_
-#define _di_f_thread_spins_decrease_by_
-#define _di_f_thread_spins_increase_
-#define _di_f_thread_spins_increase_by_
-#define _di_f_thread_spins_resize_
 //#define _di_f_thread_spins_t_
 //#define _di_f_thread_spin_t_
 #define _di_f_thread_spin_unlock_
index 4a41d3d80fcde7d649409dcdf966451dfb4876a3..e368a3cd137d24a83ced3a4bf2e8ba414f7251f1 100644 (file)
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_attributes_adjust_
-  f_status_t f_thread_attributes_adjust(const f_number_unsigned_t length, f_thread_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_attributes_adjust_callback_
+  f_status_t f_thread_attributes_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_attr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
-    } // for
+    {
+      f_thread_attributes_t * const array = (f_thread_attributes_t *) void_array;
 
-    return f_memory_array_adjust(length, sizeof(f_thread_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_attributes_adjust_
-
-#ifndef _di_f_thread_attributes_decimate_by_
-  f_status_t f_thread_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_attr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_adjust(length, sizeof(f_thread_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_attributes_decimate_by_
-
-#ifndef _di_f_thread_attributes_decrease_by_
-  f_status_t f_thread_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_attr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_adjust(length, sizeof(f_thread_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_attributes_decrease_by_
-
-#ifndef _di_f_thread_attributes_increase_
-  f_status_t f_thread_attributes_increase(const f_number_unsigned_t step, f_thread_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-        if (pthread_attr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+        if (pthread_attr_destroy(&array->array[i])) return F_status_set_error(F_failure);
       } // for
-
-      return f_memory_array_adjust(length, sizeof(f_thread_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
     }
 
-    return F_data_not;
+    return F_none;
   }
-#endif // _di_f_thread_attributes_increase_
-
-#ifndef _di_f_thread_attributes_increase_by_
-  f_status_t f_thread_attributes_increase_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+#endif // _di_f_thread_attributes_adjust_callback_
 
-      const f_number_unsigned_t length = structure->used + amount;
+#ifndef _di_f_thread_attributes_resize_callback_
+  f_status_t f_thread_attributes_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+    {
+      f_thread_attributes_t * const array = (f_thread_attributes_t *) void_array;
 
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-          if (pthread_attr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
-        } // for
-
-        return f_memory_array_adjust(length, sizeof(f_thread_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+        if (pthread_attr_destroy(&array->array[i])) return F_status_set_error(F_failure);
+      } // for
     }
 
-    return F_data_not;
-  }
-#endif // _di_f_thread_attributes_increase_by_
-
-#ifndef _di_f_thread_attributes_resize_
-  f_status_t f_thread_attributes_resize(const f_number_unsigned_t length, f_thread_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_attr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_resize(length, sizeof(f_thread_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_attributes_resize_
+#endif // _di_f_thread_attributes_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 8453a18cb762213a10d3c979b7df52fbe8b7087c..1bdad1790251ac00a56d04089444217905eaf176 100644 (file)
@@ -28,8 +28,6 @@ extern "C" {
 
   // This does not clear the thread.attributes.__size array (may need to memset() against a sizeof(pthread_attr_t)).
   #define macro_f_thread_attribute_t_clear(attribute) attribute.__align = 0;
-
-  #define macro_f_thread_attribute_t_delete_simple(attribute) f_thread_attribute_delete(&attribute);
 #endif // _di_f_thread_attribute_t_
 
 /**
@@ -52,148 +50,61 @@ extern "C" {
 
   #define macro_f_thread_attributes_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_attributes_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_attributes_t_resize(status, attributes, length) status = f_thread_attributes_resize(length, &attributes);
-  #define macro_f_thread_attributes_t_adjust(status, attributes, length) status = f_thread_attributes_adjust(length, &attributes);
-
-  #define macro_f_thread_attributes_t_delete_simple(attributes)  f_thread_attributes_resize(0, &attributes);
-  #define macro_f_thread_attributes_t_destroy_simple(attributes) f_thread_attributes_adjust(0, &attributes);
-
-  #define macro_f_thread_attributes_t_increase(status, step, attributes)      status = f_thread_attributes_increase(step, attributes);
-  #define macro_f_thread_attributes_t_increase_by(status, attributes, amount) status = f_thread_attributes_increase_by(amount, attributes);
-  #define macro_f_thread_attributes_t_decrease_by(status, attributes, amount) status = f_thread_attributes_decrease_by(amount, attributes);
-  #define macro_f_thread_attributes_t_decimate_by(status, attributes, amount) status = f_thread_attributes_decimate_by(amount, attributes);
 #endif // _di_f_thread_attributes_t_
 
 /**
- * Resize the thread attributes array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread attributes array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_attributes_adjust_
-  extern f_status_t f_thread_attributes_adjust(const f_number_unsigned_t length, f_thread_attributes_t * const structure);
-#endif // _di_f_thread_attributes_adjust_
-
-/**
- * Resize the thread attributes array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread attributes array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_attributes_decimate_by_
-  extern f_status_t f_thread_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure);
-#endif // _di_f_thread_attributes_decimate_by_
-
-/**
- * Resize the thread attributes array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_attributess_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread attributes array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_attributes_decrease_by_
-  extern f_status_t f_thread_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure);
-#endif // _di_f_thread_attributes_decrease_by_
-
-/**
- * Increase the size of the thread attributes array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread attributes array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_attributes_increase_
-  extern f_status_t f_thread_attributes_increase(const f_number_unsigned_t step, f_thread_attributes_t * const structure);
-#endif // _di_f_thread_attributes_increase_
+#ifndef _di_f_thread_attributes_adjust_callback_
+  extern f_status_t f_thread_attributes_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_attributes_adjust_callback_
 
 /**
- * Resize the thread attributes array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_attributess_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread attributes array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_attributes_increase_by_
-  extern f_status_t f_thread_attributes_increase_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure);
-#endif // _di_f_thread_attributes_increase_by_
-
-/**
- * Resize the thread attributes array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread attributes array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_attributes_resize_
-  extern f_status_t f_thread_attributes_resize(const f_number_unsigned_t length, f_thread_attributes_t * const structure);
-#endif // _di_f_thread_attributes_resize_
+#ifndef _di_f_thread_attributes_resize_callback_
+  extern f_status_t f_thread_attributes_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_attributes_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 767995059ef5ff9ac2509bfaa3c3e3cc84b8adee..6c8d4620de1528e80d820d6b0f9513531e02a0ec 100644 (file)
@@ -5,18 +5,16 @@
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_barriers_adjust_
-  f_status_t f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_barriers_adjust_callback_
+  f_status_t f_thread_barriers_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_barriers_t * const array = (f_thread_barriers_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-       error = pthread_barrier_destroy(&structure->array[i]);
+        error = pthread_barrier_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -27,56 +25,20 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_adjust(length, sizeof(f_thread_barrier_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_barriers_adjust_
+#endif // _di_f_thread_barriers_adjust_callback_
 
-#ifndef _di_f_thread_barriers_decimate_by_
-  f_status_t f_thread_barriers_decimate_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-       error = pthread_barrier_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_adjust(length, sizeof(f_thread_barrier_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_barriers_decimate_by_
-
-#ifndef _di_f_thread_barriers_decrease_by_
-  f_status_t f_thread_barriers_decrease_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
+#ifndef _di_f_thread_barriers_resize_callback_
+  f_status_t f_thread_barriers_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_barriers_t * const array = (f_thread_barriers_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-       error = pthread_barrier_destroy(&structure->array[i]);
+        error = pthread_barrier_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -87,111 +49,9 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_resize(length, sizeof(f_thread_barrier_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_barriers_decrease_by_
-
-#ifndef _di_f_thread_barriers_increase_
-  f_status_t f_thread_barriers_increase(const f_number_unsigned_t step, f_thread_barriers_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      {
-        int error = 0;
-
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-           error = pthread_barrier_destroy(&structure->array[i]);
-
-            if (error) {
-              if (error == EBUSY) return F_status_set_error(F_busy);
-              if (error == EINVAL) return F_status_set_error(F_parameter);
-
-              return F_status_set_error(F_failure);
-            }
-        } // for
-      }
-
-      return f_memory_array_resize(length, sizeof(f_thread_barrier_t), (void **) &structure->array, &structure->used, &structure->size);
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_barriers_increase_
-
-#ifndef _di_f_thread_barriers_increase_by_
-  f_status_t f_thread_barriers_increase_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-      const f_number_unsigned_t length = structure->used + amount;
-
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        {
-          int error = 0;
-
-          for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-             error = pthread_barrier_destroy(&structure->array[i]);
-
-              if (error) {
-                if (error == EBUSY) return F_status_set_error(F_busy);
-                if (error == EINVAL) return F_status_set_error(F_parameter);
-
-                return F_status_set_error(F_failure);
-              }
-          } // for
-        }
-
-        return f_memory_array_resize(length, sizeof(f_thread_barrier_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_barriers_increase_by_
-
-#ifndef _di_f_thread_barriers_resize_
-  f_status_t f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-         error = pthread_barrier_destroy(&structure->array[i]);
-
-          if (error) {
-            if (error == EBUSY) return F_status_set_error(F_busy);
-            if (error == EINVAL) return F_status_set_error(F_parameter);
-
-            return F_status_set_error(F_failure);
-          }
-      } // for
-    }
-
-    return f_memory_array_resize(length, sizeof(f_thread_barrier_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_barriers_resize_
+#endif // _di_f_thread_barriers_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 2bb8a56e6eeb824b620f0f8d63f6522210c6fce3..5db9f56ecb2fc0c6d73cb3c83c56284a7f79d632 100644 (file)
@@ -27,8 +27,6 @@ extern "C" {
   #define macro_f_thread_barrier_t_initialize_1(barrier) barrier
 
   #define macro_f_thread_barrier_t_clear(barrier) barrier = 0;
-
-  #define macro_f_thread_barrier_t_delete_simple(barrier) f_thread_barrier_delete(&barrier);
 #endif // _di_f_thread_barrier_t_
 
 /**
@@ -51,148 +49,61 @@ extern "C" {
 
   #define macro_f_thread_barriers_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_barriers_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_barriers_t_resize(status, barriers, length) status = f_thread_barriers_resize(length, &barriers);
-  #define macro_f_thread_barriers_t_adjust(status, barriers, length) status = f_thread_barriers_adjust(length, &barriers);
-
-  #define macro_f_thread_barriers_t_delete_simple(barriers)  f_thread_barriers_resize(0, &barriers);
-  #define macro_f_thread_barriers_t_destroy_simple(barriers) f_thread_barriers_adjust(0, &barriers);
-
-  #define macro_f_thread_barriers_t_increase(status, step, barriers)      status = f_thread_barriers_increase(step, barriers);
-  #define macro_f_thread_barriers_t_increase_by(status, barriers, amount) status = f_thread_barriers_increase_by(amount, barriers);
-  #define macro_f_thread_barriers_t_decrease_by(status, barriers, amount) status = f_thread_barriers_decrease_by(amount, barriers);
-  #define macro_f_thread_barriers_t_decimate_by(status, barriers, amount) status = f_thread_barriers_decimate_by(amount, barriers);
 #endif // _di_f_thread_barriers_t_
 
 /**
- * Resize the thread barriers array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread barriers array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_barriers_adjust_
-  extern f_status_t f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const structure);
-#endif // _di_f_thread_barriers_adjust_
-
-/**
- * Resize the thread barriers array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread barriers array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_barriers_decimate_by_
-  extern f_status_t f_thread_barriers_decimate_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure);
-#endif // _di_f_thread_barriers_decimate_by_
-
-/**
- * Resize the thread barriers array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_barrierss_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread barriers array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_barriers_decrease_by_
-  extern f_status_t f_thread_barriers_decrease_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure);
-#endif // _di_f_thread_barriers_decrease_by_
-
-/**
- * Increase the size of the thread barriers array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread barriers array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_barriers_increase_
-  extern f_status_t f_thread_barriers_increase(const f_number_unsigned_t step, f_thread_barriers_t * const structure);
-#endif // _di_f_thread_barriers_increase_
+#ifndef _di_f_thread_barriers_adjust_callback_
+  extern f_status_t f_thread_barriers_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_barriers_adjust_callback_
 
 /**
- * Resize the thread barriers array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_barrierss_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread barriers array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_barriers_increase_by_
-  extern f_status_t f_thread_barriers_increase_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure);
-#endif // _di_f_thread_barriers_increase_by_
-
-/**
- * Resize the thread barriers array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread barriers array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_barriers_resize_
-  extern f_status_t f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const structure);
-#endif // _di_f_thread_barriers_resize_
+#ifndef _di_f_thread_barriers_resize_callback_
+  extern f_status_t f_thread_barriers_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_barriers_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index bed0c3248ca1b52e5cebf614e364baed1710cb91..d6312552a898e669d8b0227ef291159b4906e8df 100644 (file)
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_barrier_attributes_adjust_
-  f_status_t f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_barrier_attributes_adjust_callback_
+  f_status_t f_thread_barrier_attributes_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_barrierattr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
-    } // for
+    {
+      f_thread_barrier_attributes_t * const array = (f_thread_barrier_attributes_t *) void_array;
 
-    return f_memory_array_adjust(length, sizeof(f_thread_barrier_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_barrier_attributes_adjust_
-
-#ifndef _di_f_thread_barrier_attributes_decimate_by_
-  f_status_t f_thread_barrier_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_barrierattr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_adjust(length, sizeof(f_thread_barrier_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_barrier_attributes_decimate_by_
-
-#ifndef _di_f_thread_barrier_attributes_decrease_by_
-  f_status_t f_thread_barrier_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_barrierattr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_resize(length, sizeof(f_thread_barrier_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_barrier_attributes_decrease_by_
-
-#ifndef _di_f_thread_barrier_attributes_increase_
-  f_status_t f_thread_barrier_attributes_increase(const f_number_unsigned_t step, f_thread_barrier_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-        if (pthread_barrierattr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+        if (pthread_barrierattr_destroy(&array->array[i])) return F_status_set_error(F_failure);
       } // for
-
-      return f_memory_array_resize(length, sizeof(f_thread_barrier_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
     }
 
-    return F_data_not;
+    return F_none;
   }
-#endif // _di_f_thread_barrier_attributes_increase_
-
-#ifndef _di_f_thread_barrier_attributes_increase_by_
-  f_status_t f_thread_barrier_attributes_increase_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+#endif // _di_f_thread_barrier_attributes_adjust_callback_
 
-      const f_number_unsigned_t length = structure->used + amount;
+#ifndef _di_f_thread_barrier_attributes_resize_callback_
+  f_status_t f_thread_barrier_attributes_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+    {
+      f_thread_barrier_attributes_t * const array = (f_thread_barrier_attributes_t *) void_array;
 
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-          if (pthread_barrierattr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
-        } // for
-
-        return f_memory_array_resize(length, sizeof(f_thread_barrier_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+        if (pthread_barrierattr_destroy(&array->array[i])) return F_status_set_error(F_failure);
+      } // for
     }
 
-    return F_data_not;
-  }
-#endif // _di_f_thread_barrier_attributes_increase_by_
-
-#ifndef _di_f_thread_barrier_attributes_resize_
-  f_status_t f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_barrierattr_destroy(&structure->array[i])) return F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_resize(length, sizeof(f_thread_barrier_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_barrier_attributes_resize_
+#endif // _di_f_thread_barrier_attributes_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 0d7b577786a7f5fe4228b18aa2d01b77939158f9..ae74d7ed0e0e6bba10b97a4457d2d709dea876fc 100644 (file)
@@ -28,8 +28,6 @@ extern "C" {
 
   // This does not clear the thread.attributes.__size array (may need to memset() against a sizeof(pthread_attr_t)).
   #define macro_f_thread_barrier_attribute_t_clear(attribute) attribute.__align = 0;
-
-  #define macro_f_thread_barrier_attribute_t_delete_simple(attribute) f_thread_barrier_attribute_delete(&attribute);
 #endif // _di_f_thread_barrier_attribute_t_
 
 /**
@@ -52,148 +50,61 @@ extern "C" {
 
   #define macro_f_thread_barrier_attributes_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_barrier_attributes_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_barrier_attributes_t_resize(status, barrier_attributes, length) status = f_thread_barrier_attributes_resize(length, &barrier_attributes);
-  #define macro_f_thread_barrier_attributes_t_adjust(status, barrier_attributes, length) status = f_thread_barrier_attributes_adjust(length, &barrier_attributes);
-
-  #define macro_f_thread_barrier_attributes_t_delete_simple(barrier_attributes)  f_thread_barrier_attributes_resize(0, &barrier_attributes);
-  #define macro_f_thread_barrier_attributes_t_destroy_simple(barrier_attributes) f_thread_barrier_attributes_adjust(0, &barrier_attributes);
-
-  #define macro_f_thread_barrier_attributes_t_increase(status, step, barrier_attributes)      status = f_thread_barrier_attributes_increase(step, barrier_attributes);
-  #define macro_f_thread_barrier_attributes_t_increase_by(status, barrier_attributes, amount) status = f_thread_barrier_attributes_increase_by(amount, barrier_attributes);
-  #define macro_f_thread_barrier_attributes_t_decrease_by(status, barrier_attributes, amount) status = f_thread_barrier_attributes_decrease_by(amount, barrier_attributes);
-  #define macro_f_thread_barrier_attributes_t_decimate_by(status, barrier_attributes, amount) status = f_thread_barrier_attributes_decimate_by(amount, barrier_attributes);
 #endif // _di_f_thread_barrier_attributes_t_
 
 /**
- * Resize the thread barrier_attributes array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread barrier_attributes array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_barrier_attributes_adjust_
-  extern f_status_t f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const structure);
-#endif // _di_f_thread_barrier_attributes_adjust_
-
-/**
- * Resize the thread barrier_attributes array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread barrier_attributes array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_barrier_attributes_decimate_by_
-  extern f_status_t f_thread_barrier_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure);
-#endif // _di_f_thread_barrier_attributes_decimate_by_
-
-/**
- * Resize the thread barrier_attributes array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_barrier_attributess_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread barrier_attributes array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_barrier_attributes_decrease_by_
-  extern f_status_t f_thread_barrier_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure);
-#endif // _di_f_thread_barrier_attributes_decrease_by_
-
-/**
- * Increase the size of the thread barrier_attributes array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread barrier_attributes array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_barrier_attributes_increase_
-  extern f_status_t f_thread_barrier_attributes_increase(const f_number_unsigned_t step, f_thread_barrier_attributes_t * const structure);
-#endif // _di_f_thread_barrier_attributes_increase_
+#ifndef _di_f_thread_barrier_attributes_adjust_callback_
+  extern f_status_t f_thread_barrier_attributes_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_barrier_attributes_adjust_callback_
 
 /**
- * Resize the thread barrier_attributes array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_barrier_attributess_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread barrier_attributes array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_barrier_attributes_increase_by_
-  extern f_status_t f_thread_barrier_attributes_increase_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure);
-#endif // _di_f_thread_barrier_attributes_increase_by_
-
-/**
- * Resize the thread barrier_attributes array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread barrier_attributes array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_barrier_attributes_resize_
-  extern f_status_t f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const structure);
-#endif // _di_f_thread_barrier_attributes_resize_
+#ifndef _di_f_thread_barrier_attributes_resize_callback_
+  extern f_status_t f_thread_barrier_attributes_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_barrier_attributes_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 7fe5170cf942f525952aff0164aa7db66f7fe7e5..fe9da2bf92a5aa97ff9009dde94026b13d443466 100644 (file)
@@ -5,18 +5,16 @@
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_conditions_adjust_
-  f_status_t f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_conditions_adjust_callback_
+  f_status_t f_thread_conditions_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_conditions_t * const array = (f_thread_conditions_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_cond_destroy(&structure->array[i]);
+        error = pthread_cond_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -27,158 +25,20 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_adjust(length, sizeof(f_thread_condition_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_conditions_adjust_
+#endif // _di_f_thread_conditions_adjust_callback_
 
-#ifndef _di_f_thread_conditions_decimate_by_
-  f_status_t f_thread_conditions_decimate_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_cond_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_adjust(length, sizeof(f_thread_condition_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_conditions_decimate_by_
-
-#ifndef _di_f_thread_conditions_decrease_by_
-  f_status_t f_thread_conditions_decrease_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_cond_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_resize(length, sizeof(f_thread_condition_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_conditions_decrease_by_
-
-#ifndef _di_f_thread_conditions_increase_
-  f_status_t f_thread_conditions_increase(const f_number_unsigned_t step, f_thread_conditions_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      {
-        int error = 0;
-
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-          error = pthread_cond_destroy(&structure->array[i]);
-
-          if (error) {
-            if (error == EBUSY) return F_status_set_error(F_busy);
-            if (error == EINVAL) return F_status_set_error(F_parameter);
-
-            return F_status_set_error(F_failure);
-          }
-        } // for
-      }
-
-        return f_memory_array_resize(length, sizeof(f_thread_condition_t), (void **) &structure->array, &structure->used, &structure->size);
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_conditions_increase_
-
-#ifndef _di_f_thread_conditions_increase_by_
-  f_status_t f_thread_conditions_increase_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-      const f_number_unsigned_t length = structure->used + amount;
-
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        {
-          int error = 0;
-
-          for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-            error = pthread_cond_destroy(&structure->array[i]);
-
-            if (error) {
-              if (error == EBUSY) return F_status_set_error(F_busy);
-              if (error == EINVAL) return F_status_set_error(F_parameter);
-
-              return F_status_set_error(F_failure);
-            }
-          } // for
-        }
-
-        return f_memory_array_resize(length, sizeof(f_thread_condition_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_conditions_increase_by_
-
-#ifndef _di_f_thread_conditions_resize_
-  f_status_t f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_conditions_resize_callback_
+  f_status_t f_thread_conditions_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_conditions_t * const array = (f_thread_conditions_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_cond_destroy(&structure->array[i]);
+        error = pthread_cond_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -189,9 +49,9 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_resize(length, sizeof(f_thread_condition_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_conditions_resize_
+#endif // _di_f_thread_conditions_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index fc87fae9475976201af53cd865dcf685c46ebc28..e90dc457fa4b84d08aa49d3342dff155e97105c4 100644 (file)
@@ -28,8 +28,6 @@ extern "C" {
   #define f_thread_condition_t_initialize PTHREAD_COND_INITIALIZER
 
   #define macro_f_thread_condition_t_initialize_1(condition) { condition }
-
-  #define macro_f_thread_condition_t_delete_simple(condition) f_thread_condition_delete(&condition);
 #endif // _di_f_thread_condition_t_
 
 /**
@@ -52,148 +50,61 @@ extern "C" {
 
   #define macro_f_thread_conditions_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_conditions_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_conditions_t_resize(status, conditions, length) status = f_thread_conditions_resize(length, &conditions);
-  #define macro_f_thread_conditions_t_adjust(status, conditions, length) status = f_thread_conditions_adjust(length, &conditions);
-
-  #define macro_f_thread_conditions_t_delete_simple(conditions)  f_thread_conditions_resize(0, &conditions);
-  #define macro_f_thread_conditions_t_destroy_simple(conditions) f_thread_conditions_adjust(0, &conditions);
-
-  #define macro_f_thread_conditions_t_increase(status, step, conditions)      status = f_thread_conditions_increase(step, conditions);
-  #define macro_f_thread_conditions_t_increase_by(status, conditions, amount) status = f_thread_conditions_increase_by(amount, conditions);
-  #define macro_f_thread_conditions_t_decrease_by(status, conditions, amount) status = f_thread_conditions_decrease_by(amount, conditions);
-  #define macro_f_thread_conditions_t_decimate_by(status, conditions, amount) status = f_thread_conditions_decimate_by(amount, conditions);
 #endif // _di_f_thread_conditions_t_
 
 /**
- * Resize the thread conditions array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread conditions array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_conditions_adjust_
-  extern f_status_t f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const structure);
-#endif // _di_f_thread_conditions_adjust_
-
-/**
- * Resize the thread conditions array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread conditions array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_conditions_decimate_by_
-  extern f_status_t f_thread_conditions_decimate_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure);
-#endif // _di_f_thread_conditions_decimate_by_
-
-/**
- * Resize the thread conditions array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_conditionss_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread conditions array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_conditions_decrease_by_
-  extern f_status_t f_thread_conditions_decrease_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure);
-#endif // _di_f_thread_conditions_decrease_by_
-
-/**
- * Increase the size of the thread conditions array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread conditions array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_conditions_increase_
-  extern f_status_t f_thread_conditions_increase(const f_number_unsigned_t step, f_thread_conditions_t * const structure);
-#endif // _di_f_thread_conditions_increase_
+#ifndef _di_f_thread_conditions_adjust_callback_
+  extern f_status_t f_thread_conditions_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_conditions_adjust_callback_
 
 /**
- * Resize the thread conditions array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_conditionss_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread conditions array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_conditions_increase_by_
-  extern f_status_t f_thread_conditions_increase_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure);
-#endif // _di_f_thread_conditions_increase_by_
-
-/**
- * Resize the thread conditions array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread conditions array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_conditions_resize_
-  extern f_status_t f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const structure);
-#endif // _di_f_thread_conditions_resize_
+#ifndef _di_f_thread_conditions_resize_callback_
+  extern f_status_t f_thread_conditions_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_conditions_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index ebca2de63b6c831328984e3bd5fa0cb4e0f4ff8a..266b2ebd1aa6228351f35518e96c741ba87240d8 100644 (file)
@@ -5,18 +5,16 @@
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_condition_attributes_adjust_
-  f_status_t f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_condition_attributes_adjust_callback_
+  f_status_t f_thread_condition_attributes_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_condition_attributes_t * const array = (f_thread_condition_attributes_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_condattr_destroy(&structure->array[i]);
+        error = pthread_condattr_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -27,158 +25,20 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_adjust(length, sizeof(f_thread_condition_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_condition_attributes_adjust_
+#endif // _di_f_thread_condition_attributes_adjust_callback_
 
-#ifndef _di_f_thread_condition_attributes_decimate_by_
-  f_status_t f_thread_condition_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_condattr_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_adjust(length, sizeof(f_thread_condition_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_condition_attributes_decimate_by_
-
-#ifndef _di_f_thread_condition_attributes_decrease_by_
-  f_status_t f_thread_condition_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_condattr_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_resize(length, sizeof(f_thread_condition_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_condition_attributes_decrease_by_
-
-#ifndef _di_f_thread_condition_attributes_increase_
-  f_status_t f_thread_condition_attributes_increase(const f_number_unsigned_t step, f_thread_condition_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      {
-        int error = 0;
-
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-          error = pthread_condattr_destroy(&structure->array[i]);
-
-          if (error) {
-            if (error == EBUSY) return F_status_set_error(F_busy);
-            if (error == EINVAL) return F_status_set_error(F_parameter);
-
-            return F_status_set_error(F_failure);
-          }
-        } // for
-      }
-
-      return f_memory_array_resize(length, sizeof(f_thread_condition_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_condition_attributes_increase_
-
-#ifndef _di_f_thread_condition_attributes_increase_by_
-  f_status_t f_thread_condition_attributes_increase_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-      const f_number_unsigned_t length = structure->used + amount;
-
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        {
-          int error = 0;
-
-          for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-            error = pthread_condattr_destroy(&structure->array[i]);
-
-            if (error) {
-              if (error == EBUSY) return F_status_set_error(F_busy);
-              if (error == EINVAL) return F_status_set_error(F_parameter);
-
-              return F_status_set_error(F_failure);
-            }
-          } // for
-        }
-
-        return f_memory_array_resize(length, sizeof(f_thread_condition_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_condition_attributes_increase_by_
-
-#ifndef _di_f_thread_condition_attributes_resize_
-  f_status_t f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_condition_attributes_resize_callback_
+  f_status_t f_thread_condition_attributes_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_condition_attributes_t * const array = (f_thread_condition_attributes_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_condattr_destroy(&structure->array[i]);
+        error = pthread_condattr_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -189,9 +49,9 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_resize(length, sizeof(f_thread_condition_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_condition_attributes_resize_
+#endif // _di_f_thread_condition_attributes_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index cf2659d92ba55b3c787be21dd5cc40c82fb31e84..9b3afcfbbab85cd85dda8dabdb5d8c259cec0d38 100644 (file)
@@ -28,8 +28,6 @@ extern "C" {
 
   // This does not clear the thread.attributes.__size array (may need to memset() against a sizeof(pthread_attr_t)).
   #define macro_f_thread_condition_attribute_t_clear(attribute) attribute.__align = 0;
-
-  #define macro_f_thread_condition_attribute_t_delete_simple(attribute) f_thread_condition_attribute_delete(&attribute);
 #endif // _di_f_thread_condition_attribute_t_
 
 /**
@@ -52,148 +50,61 @@ extern "C" {
 
   #define macro_f_thread_condition_attributes_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_condition_attributes_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_condition_attributes_t_resize(status, attributes, length) status = f_thread_condition_attributes_resize(length, &attributes);
-  #define macro_f_thread_condition_attributes_t_adjust(status, attributes, length) status = f_thread_condition_attributes_adjust(length, &attributes);
-
-  #define macro_f_thread_condition_attributes_t_delete_simple(attributes)  f_thread_condition_attributes_resize(0, &condition_attributes);
-  #define macro_f_thread_condition_attributes_t_destroy_simple(attributes) f_thread_condition_attributes_adjust(0, &condition_attributes);
-
-  #define macro_f_thread_condition_attributes_t_increase(status, step, attributes)      status = f_thread_condition_attributes_increase(step, attributes);
-  #define macro_f_thread_condition_attributes_t_increase_by(status, attributes, amount) status = f_thread_condition_attributes_increase_by(amount, attributes);
-  #define macro_f_thread_condition_attributes_t_decrease_by(status, attributes, amount) status = f_thread_condition_attributes_decrease_by(amount, attributes);
-  #define macro_f_thread_condition_attributes_t_decimate_by(status, attributes, amount) status = f_thread_condition_attributes_decimate_by(amount, attributes);
 #endif // _di_f_thread_condition_attributes_t_
 
 /**
- * Resize the thread condition_attributes array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread condition_attributes array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_condition_attributes_adjust_
-  extern f_status_t f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure);
-#endif // _di_f_thread_condition_attributes_adjust_
-
-/**
- * Resize the thread condition_attributes array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread condition_attributes array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_condition_attributes_decimate_by_
-  extern f_status_t f_thread_condition_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure);
-#endif // _di_f_thread_condition_attributes_decimate_by_
-
-/**
- * Resize the thread condition_attributes array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_condition_attributess_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread condition_attributes array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_condition_attributes_decrease_by_
-  extern f_status_t f_thread_condition_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure);
-#endif // _di_f_thread_condition_attributes_decrease_by_
-
-/**
- * Increase the size of the thread condition_attributes array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread condition_attributes array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_condition_attributes_increase_
-  extern f_status_t f_thread_condition_attributes_increase(const f_number_unsigned_t step, f_thread_condition_attributes_t * const structure);
-#endif // _di_f_thread_condition_attributes_increase_
+#ifndef _di_f_thread_condition_attributes_adjust_callback_
+  extern f_status_t f_thread_condition_attributes_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_condition_attributes_adjust_callback_
 
 /**
- * Resize the thread condition_attributes array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_condition_attributess_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread condition_attributes array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_condition_attributes_increase_by_
-  extern f_status_t f_thread_condition_attributes_increase_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure);
-#endif // _di_f_thread_condition_attributes_increase_by_
-
-/**
- * Resize the thread condition_attributes array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread condition_attributes array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_condition_attributes_resize_
-  extern f_status_t f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure);
-#endif // _di_f_thread_condition_attributes_resize_
+#ifndef _di_f_thread_condition_attributes_resize_callback_
+  extern f_status_t f_thread_condition_attributes_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_condition_attributes_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 90682353af276a27b2e2768a38b5bf255a66ac26..ed47439894440f372e19a607341aed46a72ee76e 100644 (file)
@@ -5,66 +5,6 @@
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_ids_adjust_
-  f_status_t f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_adjust(length, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_ids_adjust_
-
-#ifndef _di_f_thread_ids_decimate_by_
-  f_status_t f_thread_ids_decimate_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_decrease_by(amount, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_ids_decimate_by_
-
-#ifndef _di_f_thread_ids_decrease_by_
-  f_status_t f_thread_ids_decrease_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_decrease_by(amount, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_ids_decrease_by_
-
-#ifndef _di_f_thread_ids_increase_
-  f_status_t f_thread_ids_increase(const f_number_unsigned_t step, f_thread_ids_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_increase(step, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_ids_increase_
-
-#ifndef _di_f_thread_ids_increase_by_
-  f_status_t f_thread_ids_increase_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_increase_by(amount, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_ids_increase_by_
-
-#ifndef _di_f_thread_ids_resize_
-  f_status_t f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_resize(length, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_ids_resize_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index ad92ae0a1a5491f6534ccaf315bfd299d821f764..f98a070f369522b73325ed59d2880ccef222390f 100644 (file)
@@ -47,149 +47,8 @@ extern "C" {
 
   #define macro_f_thread_ids_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_ids_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_ids_t_resize(status, attributes, length) status = f_thread_ids_resize(length, &attributes);
-  #define macro_f_thread_ids_t_adjust(status, attributes, length) status = f_thread_ids_adjust(length, &attributes);
-
-  #define macro_f_thread_ids_t_delete_simple(attributes)  f_thread_ids_resize(0, &ids);
-  #define macro_f_thread_ids_t_destroy_simple(attributes) f_thread_ids_adjust(0, &ids);
-
-  #define macro_f_thread_ids_t_increase(status, step, attributes)      status = f_thread_ids_increase(step, attributes);
-  #define macro_f_thread_ids_t_increase_by(status, attributes, amount) status = f_thread_ids_increase_by(amount, attributes);
-  #define macro_f_thread_ids_t_decrease_by(status, attributes, amount) status = f_thread_ids_decrease_by(amount, attributes);
-  #define macro_f_thread_ids_t_decimate_by(status, attributes, amount) status = f_thread_ids_decimate_by(amount, attributes);
 #endif // _di_f_thread_ids_t_
 
-/**
- * Resize the thread ids array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread ids array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_ids_adjust_
-  extern f_status_t f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const structure);
-#endif // _di_f_thread_ids_adjust_
-
-/**
- * Resize the thread ids array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread ids array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_ids_decimate_by_
-  extern f_status_t f_thread_ids_decimate_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure);
-#endif // _di_f_thread_ids_decimate_by_
-
-/**
- * Resize the thread ids array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread ids array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_ids_decrease_by_
-  extern f_status_t f_thread_ids_decrease_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure);
-#endif // _di_f_thread_ids_decrease_by_
-
-/**
- * Increase the size of the thread ids array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread ids array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_ids_increase_
-  extern f_status_t f_thread_ids_increase(const f_number_unsigned_t step, f_thread_ids_t * const structure);
-#endif // _di_f_thread_ids_increase_
-
-/**
- * Resize the thread ids array to a larger size.
- *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread ids array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_ids_increase_by_
-  extern f_status_t f_thread_ids_increase_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure);
-#endif // _di_f_thread_ids_increase_by_
-
-/**
- * Resize the thread ids array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread ids array to adjust.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_ids_resize_
-  extern f_status_t f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const structure);
-#endif // _di_f_thread_ids_resize_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 156501a732798ea47845a4283f3a237b26f865a4..087277aab065c8b54dfd5431f4e2f2e259710c95 100644 (file)
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_keys_adjust_
-  f_status_t f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_keys_adjust_callback_
+  f_status_t f_thread_keys_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+    {
+      f_thread_keys_t * const array = (f_thread_keys_t *) void_array;
 
-      if (pthread_key_delete(structure->array[i])) return F_status_set_error(F_failure);
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-      structure->array[i] = 0;
-    } // for
+        if (pthread_key_delete(array->array[i])) return F_status_set_error(F_failure);
 
-    return f_memory_array_adjust(length, sizeof(f_thread_key_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_keys_adjust_
-
-#ifndef _di_f_thread_keys_decimate_by_
-  f_status_t f_thread_keys_decimate_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-      if (pthread_key_delete(structure->array[i])) return F_status_set_error(F_failure);
-
-      structure->array[i] = 0;
-    } // for
-
-    return f_memory_array_adjust(length, sizeof(f_thread_key_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_keys_decimate_by_
-
-#ifndef _di_f_thread_keys_decrease_by_
-  f_status_t f_thread_keys_decrease_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-      if (pthread_key_delete(structure->array[i])) return F_status_set_error(F_failure);
-
-      structure->array[i] = 0;
-    } // for
-
-    return f_memory_array_resize(length, sizeof(f_thread_key_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_keys_decrease_by_
-
-#ifndef _di_f_thread_keys_increase_
-  f_status_t f_thread_keys_increase(const f_number_unsigned_t step, f_thread_keys_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        if (pthread_key_delete(structure->array[i])) return F_status_set_error(F_failure);
-
-        structure->array[i] = 0;
+        array->array[i] = 0;
       } // for
-
-      return f_memory_array_resize(length, sizeof(f_thread_key_t), (void **) &structure->array, &structure->used, &structure->size);
     }
 
-    return F_data_not;
+    return F_none;
   }
-#endif // _di_f_thread_keys_increase_
-
-#ifndef _di_f_thread_keys_increase_by_
-  f_status_t f_thread_keys_increase_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+#endif // _di_f_thread_keys_adjust_callback_
 
-      const f_number_unsigned_t length = structure->used + amount;
+#ifndef _di_f_thread_keys_resize_callback_
+  f_status_t f_thread_keys_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+    {
+      f_thread_keys_t * const array = (f_thread_keys_t *) void_array;
 
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-          if (pthread_key_delete(structure->array[i])) return F_status_set_error(F_failure);
+        if (pthread_key_delete(array->array[i])) return F_status_set_error(F_failure);
 
-          structure->array[i] = 0;
-        } // for
-
-        return f_memory_array_resize(length, sizeof(f_thread_key_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
+        array->array[i] = 0;
+      } // for
     }
 
-    return F_data_not;
-  }
-#endif // _di_f_thread_keys_increase_by_
-
-#ifndef _di_f_thread_keys_resize_
-  f_status_t f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-      if (pthread_key_delete(structure->array[i])) return F_status_set_error(F_failure);
-
-      structure->array[i] = 0;
-    } // for
-
-    return f_memory_array_resize(length, sizeof(f_thread_key_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_keys_resize_
+#endif // _di_f_thread_keys_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 48211ceb7a1593b3bc7e34400f5e4bf54341a763..2f5d41b342f6a33aee9ed0e47c5f706759d4e919 100644 (file)
@@ -27,8 +27,6 @@ extern "C" {
   #define macro_f_thread_key_t_initialize_1(key) key
 
   #define macro_f_thread_key_t_clear(key) key = 0;
-
-  #define macro_f_thread_key_t_delete_simple(key) f_thread_key_delete(&key);
 #endif // _di_f_thread_key_t_
 
 /**
@@ -51,148 +49,61 @@ extern "C" {
 
   #define macro_f_thread_keys_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_keys_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_keys_t_resize(status, keys, length) status = f_thread_keys_resize(length, &keys);
-  #define macro_f_thread_keys_t_adjust(status, keys, length) status = f_thread_keys_adjust(length, &keys);
-
-  #define macro_f_thread_keys_t_delete_simple(keys)  f_thread_keys_resize(0, &keys);
-  #define macro_f_thread_keys_t_destroy_simple(keys) f_thread_keys_adjust(0, &keys);
-
-  #define macro_f_thread_keys_t_increase(status, step, keys)      status = f_thread_keys_increase(step, keys);
-  #define macro_f_thread_keys_t_increase_by(status, keys, amount) status = f_thread_keys_increase_by(amount, keys);
-  #define macro_f_thread_keys_t_decrease_by(status, keys, amount) status = f_thread_keys_decrease_by(amount, keys);
-  #define macro_f_thread_keys_t_decimate_by(status, keys, amount) status = f_thread_keys_decimate_by(amount, keys);
 #endif // _di_f_thread_keys_t_
 
 /**
- * Resize the thread keys array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread keys array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_keys_adjust_
-  extern f_status_t f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const structure);
-#endif // _di_f_thread_keys_adjust_
-
-/**
- * Resize the thread keys array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread keys array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_keys_decimate_by_
-  extern f_status_t f_thread_keys_decimate_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure);
-#endif // _di_f_thread_keys_decimate_by_
-
-/**
- * Resize the thread keys array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_keyss_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread keys array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_keys_decrease_by_
-  extern f_status_t f_thread_keys_decrease_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure);
-#endif // _di_f_thread_keys_decrease_by_
-
-/**
- * Increase the size of the thread keys array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread keys array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_keys_increase_
-  extern f_status_t f_thread_keys_increase(const f_number_unsigned_t step, f_thread_keys_t * const structure);
-#endif // _di_f_thread_keys_increase_
+#ifndef _di_f_thread_keys_adjust_callback_
+  extern f_status_t f_thread_keys_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_keys_adjust_callback_
 
 /**
- * Resize the thread keys array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_keyss_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread keys array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_keys_increase_by_
-  extern f_status_t f_thread_keys_increase_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure);
-#endif // _di_f_thread_keys_increase_by_
-
-/**
- * Resize the thread keys array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread keys array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_keys_resize_
-  extern f_status_t f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const structure);
-#endif // _di_f_thread_keys_resize_
+#ifndef _di_f_thread_keys_resize_callback_
+  extern f_status_t f_thread_keys_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_keys_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index f0ba7bf8e4be193e9604b923fbe2598e3be09f49..84d6fc5ae810889e6386a2222242fb4d743d1f9b 100644 (file)
@@ -5,18 +5,16 @@
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_locks_adjust_
-  f_status_t f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_locks_adjust_callback_
+  f_status_t f_thread_locks_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_locks_t * const array = (f_thread_locks_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_rwlock_destroy(&structure->array[i]);
+        error = pthread_rwlock_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -27,158 +25,20 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_adjust(length, sizeof(f_thread_lock_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_locks_adjust_
+#endif // _di_f_thread_locks_adjust_callback_
 
-#ifndef _di_f_thread_locks_decimate_by_
-  f_status_t f_thread_locks_decimate_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_rwlock_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_adjust(length, sizeof(f_thread_lock_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_locks_decimate_by_
-
-#ifndef _di_f_thread_locks_decrease_by_
-  f_status_t f_thread_locks_decrease_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_rwlock_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_resize(length, sizeof(f_thread_lock_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_locks_decrease_by_
-
-#ifndef _di_f_thread_locks_increase_
-  f_status_t f_thread_locks_increase(const f_number_unsigned_t step, f_thread_locks_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      {
-        int error = 0;
-
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-          error = pthread_rwlock_destroy(&structure->array[i]);
-
-          if (error) {
-            if (error == EBUSY) return F_status_set_error(F_busy);
-            if (error == EINVAL) return F_status_set_error(F_parameter);
-
-            return F_status_set_error(F_failure);
-          }
-        } // for
-      }
-
-      return f_memory_array_resize(length, sizeof(f_thread_lock_t), (void **) &structure->array, &structure->used, &structure->size);
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_locks_increase_
-
-#ifndef _di_f_thread_locks_increase_by_
-  f_status_t f_thread_locks_increase_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-      const f_number_unsigned_t length = structure->used + amount;
-
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        {
-          int error = 0;
-
-          for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-            error = pthread_rwlock_destroy(&structure->array[i]);
-
-            if (error) {
-              if (error == EBUSY) return F_status_set_error(F_busy);
-              if (error == EINVAL) return F_status_set_error(F_parameter);
-
-              return F_status_set_error(F_failure);
-            }
-          } // for
-        }
-
-        return f_memory_array_resize(length, sizeof(f_thread_lock_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_locks_increase_by_
-
-#ifndef _di_f_thread_locks_resize_
-  f_status_t f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_locks_resize_callback_
+  f_status_t f_thread_locks_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_locks_t * const array = (f_thread_locks_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_rwlock_destroy(&structure->array[i]);
+        error = pthread_rwlock_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -189,9 +49,9 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_resize(length, sizeof(f_thread_lock_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_locks_resize_
+#endif // _di_f_thread_locks_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 2cae5181dfa28f4fe50c62ef9a60212814af5ff5..15019042976a4549134443e9835df171055522da 100644 (file)
@@ -28,8 +28,6 @@ extern "C" {
   #define f_thread_lock_t_initialize PTHREAD_RWLOCK_INITIALIZER
 
   #define macro_f_thread_lock_t_initialize_1(lock) lock
-
-  #define macro_f_thread_lock_t_delete_simple(lock) f_thread_lock_delete(&lock);
 #endif // _di_f_thread_lock_t_
 
 /**
@@ -52,148 +50,61 @@ extern "C" {
 
   #define macro_f_thread_locks_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_locks_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_locks_t_adjust(status, locks, length) status = f_memory_array_adjust(length, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
-  #define macro_f_thread_locks_t_resize(status, locks, length) status = f_memory_array_resize(length, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
-
-  #define macro_f_thread_locks_t_delete_simple(locks)  f_memory_array_resize(0, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
-  #define macro_f_thread_locks_t_destroy_simple(locks) f_memory_array_adjust(0, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
-
-  #define macro_f_thread_locks_t_increase(status, step, locks)      status = f_memory_array_increase(step, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
-  #define macro_f_thread_locks_t_increase_by(status, locks, amount) status = f_memory_array_increase_by(amount, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
-  #define macro_f_thread_locks_t_decrease_by(status, locks, amount) status = f_memory_array_decrease_by(amount, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
-  #define macro_f_thread_locks_t_decimate_by(status, locks, amount) status = f_memory_array_decimate_by(amount, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
 #endif // _di_f_thread_locks_t_
 
 /**
- * Resize the thread locks array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread locks array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_locks_adjust_
-  extern f_status_t f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const structure);
-#endif // _di_f_thread_locks_adjust_
-
-/**
- * Resize the thread locks array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread locks array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_locks_decimate_by_
-  extern f_status_t f_thread_locks_decimate_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure);
-#endif // _di_f_thread_locks_decimate_by_
-
-/**
- * Resize the thread locks array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_lockss_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread locks array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_locks_decrease_by_
-  extern f_status_t f_thread_locks_decrease_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure);
-#endif // _di_f_thread_locks_decrease_by_
-
-/**
- * Increase the size of the thread locks array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread locks array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_locks_increase_
-  extern f_status_t f_thread_locks_increase(const f_number_unsigned_t step, f_thread_locks_t * const structure);
-#endif // _di_f_thread_locks_increase_
+#ifndef _di_f_thread_locks_adjust_callback_
+  extern f_status_t f_thread_locks_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_locks_adjust_callback_
 
 /**
- * Resize the thread locks array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_lockss_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread locks array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_locks_increase_by_
-  extern f_status_t f_thread_locks_increase_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure);
-#endif // _di_f_thread_locks_increase_by_
-
-/**
- * Resize the thread locks array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread locks array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_locks_resize_
-  extern f_status_t f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const structure);
-#endif // _di_f_thread_locks_resize_
+#ifndef _di_f_thread_locks_resize_callback_
+  extern f_status_t f_thread_locks_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_locks_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 9e9c7c3106ff66f7d5a53a5c8eec5024f3e66f4b..ddd1e7fc515f9814d03bd1e90aebb91f0e18a5d0 100644 (file)
@@ -5,18 +5,16 @@
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_lock_attributes_adjust_
-  f_status_t f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_lock_attributes_adjust_callback_
+  f_status_t f_thread_lock_attributes_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_lock_attributes_t * const array = (f_thread_lock_attributes_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_rwlockattr_destroy(&structure->array[i]);
+        error = pthread_rwlockattr_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -27,158 +25,20 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_adjust(length, sizeof(f_thread_lock_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_lock_attributes_adjust_
+#endif // _di_f_thread_lock_attributes_adjust_callback_
 
-#ifndef _di_f_thread_lock_attributes_decimate_by_
-  f_status_t f_thread_lock_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_rwlockattr_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_adjust(length, sizeof(f_thread_lock_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_lock_attributes_decimate_by_
-
-#ifndef _di_f_thread_lock_attributes_decrease_by_
-  f_status_t f_thread_lock_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_rwlockattr_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_resize(length, sizeof(f_thread_lock_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_lock_attributes_decrease_by_
-
-#ifndef _di_f_thread_lock_attributes_increase_
-  f_status_t f_thread_lock_attributes_increase(const f_number_unsigned_t step, f_thread_lock_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      {
-        int error = 0;
-
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-          error = pthread_rwlockattr_destroy(&structure->array[i]);
-
-          if (error) {
-            if (error == EBUSY) return F_status_set_error(F_busy);
-            if (error == EINVAL) return F_status_set_error(F_parameter);
-
-            return F_status_set_error(F_failure);
-          }
-        } // for
-      }
-
-      return f_memory_array_resize(length, sizeof(f_thread_lock_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_lock_attributes_increase_
-
-#ifndef _di_f_thread_lock_attributes_increase_by_
-  f_status_t f_thread_lock_attributes_increase_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-      const f_number_unsigned_t length = structure->used + amount;
-
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        {
-          int error = 0;
-
-          for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-            error = pthread_rwlockattr_destroy(&structure->array[i]);
-
-            if (error) {
-              if (error == EBUSY) return F_status_set_error(F_busy);
-              if (error == EINVAL) return F_status_set_error(F_parameter);
-
-              return F_status_set_error(F_failure);
-            }
-          } // for
-        }
-
-        return f_memory_array_resize(length, sizeof(f_thread_lock_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_lock_attributes_increase_by_
-
-#ifndef _di_f_thread_lock_attributes_resize_
-  f_status_t f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_lock_attributes_resize_callback_
+  f_status_t f_thread_lock_attributes_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_lock_attributes_t * const array = (f_thread_lock_attributes_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_rwlockattr_destroy(&structure->array[i]);
+        error = pthread_rwlockattr_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -189,9 +49,9 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_resize(length, sizeof(f_thread_lock_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_lock_attributes_resize_
+#endif // _di_f_thread_lock_attributes_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 96ec164d29b23aa5afb409140ed61f1ea5c3de0b..3566a3be498c703b0b747912a826b61d9c135d62 100644 (file)
@@ -28,8 +28,6 @@ extern "C" {
 
   // This does not clear the thread.attributes.__size array (may need to memset() against a sizeof(pthread_attr_t)).
   #define macro_f_thread_lock_attribute_t_clear(attribute) attribute.__align = 0;
-
-  #define macro_f_thread_lock_attribute_t_delete_simple(attribute) f_thread_lock_attribute_delete(&attribute);
 #endif // _di_f_thread_lock_attribute_t_
 
 /**
@@ -52,148 +50,61 @@ extern "C" {
 
   #define macro_f_thread_lock_attributes_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_lock_attributes_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_lock_attributes_t_resize(status, attributes, length) status = f_thread_lock_attributes_resize(length, &attributes);
-  #define macro_f_thread_lock_attributes_t_adjust(status, attributes, length) status = f_thread_lock_attributes_adjust(length, &attributes);
-
-  #define macro_f_thread_lock_attributes_t_delete_simple(attributes)  f_thread_lock_attributes_resize(0, &attributes);
-  #define macro_f_thread_lock_attributes_t_destroy_simple(attributes) f_thread_lock_attributes_adjust(0, &attributes);
-
-  #define macro_f_thread_lock_attributes_t_increase(status, step, attributes)      status = f_thread_lock_attributes_increase(step, attributes);
-  #define macro_f_thread_lock_attributes_t_increase_by(status, attributes, amount) status = f_thread_lock_attributes_increase_by(amount, attributes);
-  #define macro_f_thread_lock_attributes_t_decrease_by(status, attributes, amount) status = f_thread_lock_attributes_decrease_by(amount, attributes);
-  #define macro_f_thread_lock_attributes_t_decimate_by(status, attributes, amount) status = f_thread_lock_attributes_decimate_by(amount, attributes);
 #endif // _di_f_thread_lock_attributes_t_
 
 /**
- * Resize the thread lock_attributes array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread lock_attributes array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_lock_attributes_adjust_
-  extern f_status_t f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure);
-#endif // _di_f_thread_lock_attributes_adjust_
-
-/**
- * Resize the thread lock_attributes array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread lock_attributes array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_lock_attributes_decimate_by_
-  extern f_status_t f_thread_lock_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure);
-#endif // _di_f_thread_lock_attributes_decimate_by_
-
-/**
- * Resize the thread lock_attributes array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_lock_attributess_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread lock_attributes array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_lock_attributes_decrease_by_
-  extern f_status_t f_thread_lock_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure);
-#endif // _di_f_thread_lock_attributes_decrease_by_
-
-/**
- * Increase the size of the thread lock_attributes array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread lock_attributes array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_lock_attributes_increase_
-  extern f_status_t f_thread_lock_attributes_increase(const f_number_unsigned_t step, f_thread_lock_attributes_t * const structure);
-#endif // _di_f_thread_lock_attributes_increase_
+#ifndef _di_f_thread_lock_attributes_adjust_callback_
+  extern f_status_t f_thread_lock_attributes_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_lock_attributes_adjust_callback_
 
 /**
- * Resize the thread lock_attributes array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_lock_attributess_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread lock_attributes array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_lock_attributes_increase_by_
-  extern f_status_t f_thread_lock_attributes_increase_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure);
-#endif // _di_f_thread_lock_attributes_increase_by_
-
-/**
- * Resize the thread lock_attributes array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread lock_attributes array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_lock_attributes_resize_
-  extern f_status_t f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure);
-#endif // _di_f_thread_lock_attributes_resize_
+#ifndef _di_f_thread_lock_attributes_resize_callback_
+  extern f_status_t f_thread_lock_attributes_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_lock_attributes_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index bbf6fe5786f2b5505196e8787517b08339e81ea1..d3154d079fb424539c354d4d9ea6bae30f20afd5 100644 (file)
@@ -5,18 +5,16 @@
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_mutexs_adjust_
-  f_status_t f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_mutexs_adjust_callback_
+  f_status_t f_thread_mutexs_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_mutexs_t * const array = (f_thread_mutexs_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_mutex_destroy(&structure->array[i]);
+        error = pthread_mutex_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -27,158 +25,20 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_adjust(length, sizeof(f_thread_mutex_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_mutexs_adjust_
+#endif // _di_f_thread_mutexs_adjust_callback_
 
-#ifndef _di_f_thread_mutexs_decimate_by_
-  f_status_t f_thread_mutexs_decimate_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_mutex_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_adjust(length, sizeof(f_thread_mutex_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_mutexs_decimate_by_
-
-#ifndef _di_f_thread_mutexs_decrease_by_
-  f_status_t f_thread_mutexs_decrease_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_mutex_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_resize(length, sizeof(f_thread_mutex_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_mutexs_decrease_by_
-
-#ifndef _di_f_thread_mutexs_increase_
-  f_status_t f_thread_mutexs_increase(const f_number_unsigned_t step, f_thread_mutexs_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      {
-        int error = 0;
-
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-          error = pthread_mutex_destroy(&structure->array[i]);
-
-          if (error) {
-            if (error == EBUSY) return F_status_set_error(F_busy);
-            if (error == EINVAL) return F_status_set_error(F_parameter);
-
-            return F_status_set_error(F_failure);
-          }
-        } // for
-      }
-
-      return f_memory_array_resize(length, sizeof(f_thread_mutex_t), (void **) &structure->array, &structure->used, &structure->size);
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_mutexs_increase_
-
-#ifndef _di_f_thread_mutexs_increase_by_
-  f_status_t f_thread_mutexs_increase_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-      const f_number_unsigned_t length = structure->used + amount;
-
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        {
-          int error = 0;
-
-          for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-            error = pthread_mutex_destroy(&structure->array[i]);
-
-            if (error) {
-              if (error == EBUSY) return F_status_set_error(F_busy);
-              if (error == EINVAL) return F_status_set_error(F_parameter);
-
-              return F_status_set_error(F_failure);
-            }
-          } // for
-        }
-
-        return f_memory_array_resize(length, sizeof(f_thread_mutex_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_mutexs_increase_by_
-
-#ifndef _di_f_thread_mutexs_resize_
-  f_status_t f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_mutexs_resize_callback_
+  f_status_t f_thread_mutexs_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_mutexs_t * const array = (f_thread_mutexs_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_mutex_destroy(&structure->array[i]);
+        error = pthread_mutex_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -189,9 +49,9 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_resize(length, sizeof(f_thread_mutex_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_mutexs_resize_
+#endif // _di_f_thread_mutexs_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index cacf0aa4bbe3ba426ef8ef466348b07e2d61781a..57d203d5453954a05da98f2c612418a6bdd6fbc1 100644 (file)
@@ -30,8 +30,6 @@ extern "C" {
   #define f_thread_mutex_t_initialize PTHREAD_MUTEX_INITIALIZER
 
   #define macro_f_thread_mutex_t_initialize_1(mutex) mutex
-
-  #define macro_f_thread_mutex_t_delete_simple(mutex) f_thread_mutex_delete(&mutex);
 #endif // _di_f_thread_mutex_t_
 
 /**
@@ -54,148 +52,61 @@ extern "C" {
 
   #define macro_f_thread_mutexs_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_mutexs_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_mutexs_t_resize(status, mutexs, length) status = f_thread_mutexs_resize(length, &mutexs);
-  #define macro_f_thread_mutexs_t_adjust(status, mutexs, length) status = f_thread_mutexs_adjust(length, &mutexs);
-
-  #define macro_f_thread_mutexs_t_delete_simple(mutexs)  f_thread_mutexs_resize(0, &mutexs);
-  #define macro_f_thread_mutexs_t_destroy_simple(mutexs) f_thread_mutexs_adjust(0, &mutexs);
-
-  #define macro_f_thread_mutexs_t_increase(status, step, mutexs)      status = f_thread_mutexs_increase(step, mutexs);
-  #define macro_f_thread_mutexs_t_increase_by(status, mutexs, amount) status = f_thread_mutexs_increase_by(amount, mutexs);
-  #define macro_f_thread_mutexs_t_decrease_by(status, mutexs, amount) status = f_thread_mutexs_decrease_by(amount, mutexs);
-  #define macro_f_thread_mutexs_t_decimate_by(status, mutexs, amount) status = f_thread_mutexs_decimate_by(amount, mutexs);
 #endif // _di_f_thread_mutexs_t_
 
 /**
- * Resize the thread mutexs array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread mutexs array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_mutexs_adjust_
-  extern f_status_t f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const structure);
-#endif // _di_f_thread_mutexs_adjust_
-
-/**
- * Resize the thread mutexs array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread mutexs array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_mutexs_decimate_by_
-  extern f_status_t f_thread_mutexs_decimate_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure);
-#endif // _di_f_thread_mutexs_decimate_by_
-
-/**
- * Resize the thread mutexs array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_mutexss_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread mutexs array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_mutexs_decrease_by_
-  extern f_status_t f_thread_mutexs_decrease_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure);
-#endif // _di_f_thread_mutexs_decrease_by_
-
-/**
- * Increase the size of the thread mutexs array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread mutexs array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_mutexs_increase_
-  extern f_status_t f_thread_mutexs_increase(const f_number_unsigned_t step, f_thread_mutexs_t * const structure);
-#endif // _di_f_thread_mutexs_increase_
+#ifndef _di_f_thread_mutexs_adjust_callback_
+  extern f_status_t f_thread_mutexs_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_mutexs_adjust_callback_
 
 /**
- * Resize the thread mutexs array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_mutexss_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread mutexs array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_mutexs_increase_by_
-  extern f_status_t f_thread_mutexs_increase_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure);
-#endif // _di_f_thread_mutexs_increase_by_
-
-/**
- * Resize the thread mutexs array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread mutexs array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_mutexs_resize_
-  extern f_status_t f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const structure);
-#endif // _di_f_thread_mutexs_resize_
+#ifndef _di_f_thread_mutexs_resize_callback_
+  extern f_status_t f_thread_mutexs_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_mutexs_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 82257fd570844bacf8ec15aeae610e76f9321ed0..f7dd39f637e3b1696e7cee16e5ef0a5c63ffb962 100644 (file)
@@ -5,18 +5,16 @@
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_mutex_attributes_adjust_
-  f_status_t f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_mutex_attributes_adjust_callback_
+  f_status_t f_thread_mutex_attributes_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_mutex_attributes_t * const array = (f_thread_mutex_attributes_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_mutexattr_destroy(&structure->array[i]);
+        error = pthread_mutexattr_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -27,158 +25,20 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_adjust(length, sizeof(f_thread_mutex_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_mutex_attributes_adjust_
+#endif // _di_f_thread_mutex_attributes_adjust_callback_
 
-#ifndef _di_f_thread_mutex_attributes_decimate_by_
-  f_status_t f_thread_mutex_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_mutexattr_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_adjust(length, sizeof(f_thread_mutex_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_mutex_attributes_decimate_by_
-
-#ifndef _di_f_thread_mutex_attributes_decrease_by_
-  f_status_t f_thread_mutex_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_mutexattr_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_resize(length, sizeof(f_thread_mutex_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_mutex_attributes_decrease_by_
-
-#ifndef _di_f_thread_mutex_attributes_increase_
-  f_status_t f_thread_mutex_attributes_increase(const f_number_unsigned_t step, f_thread_mutex_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      {
-        int error = 0;
-
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-          error = pthread_mutexattr_destroy(&structure->array[i]);
-
-          if (error) {
-            if (error == EBUSY) return F_status_set_error(F_busy);
-            if (error == EINVAL) return F_status_set_error(F_parameter);
-
-            return F_status_set_error(F_failure);
-          }
-        } // for
-      }
-
-      return f_memory_array_resize(length, sizeof(f_thread_mutex_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_mutex_attributes_increase_
-
-#ifndef _di_f_thread_mutex_attributes_increase_by_
-  f_status_t f_thread_mutex_attributes_increase_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-      const f_number_unsigned_t length = structure->used + amount;
-
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        {
-          int error = 0;
-
-          for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-            error = pthread_mutexattr_destroy(&structure->array[i]);
-
-            if (error) {
-              if (error == EBUSY) return F_status_set_error(F_busy);
-              if (error == EINVAL) return F_status_set_error(F_parameter);
-
-              return F_status_set_error(F_failure);
-            }
-          } // for
-        }
-
-        return f_memory_array_resize(length, sizeof(f_thread_mutex_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_mutex_attributes_increase_by_
-
-#ifndef _di_f_thread_mutex_attributes_resize_
-  f_status_t f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_mutex_attributes_resize_callback_
+  f_status_t f_thread_mutex_attributes_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_mutex_attributes_t * const array = (f_thread_mutex_attributes_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_mutexattr_destroy(&structure->array[i]);
+        error = pthread_mutexattr_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -189,9 +49,9 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_resize(length, sizeof(f_thread_mutex_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_mutex_attributes_resize_
+#endif // _di_f_thread_mutex_attributes_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index f3d06efabd74a6356fbe2887cdae6b5e7fee739d..dd24c0481ff3872384a05dbfd3aa201584b756c6 100644 (file)
@@ -28,8 +28,6 @@ extern "C" {
 
   // This does not clear the thread.attributes.__size array (may need to memset() against a sizeof(pthread_attr_t)).
   #define macro_f_thread_mutex_attribute_t_clear(attribute) attribute.__align = 0;
-
-  #define macro_f_thread_mutex_attribute_t_delete_simple(attribute) f_thread_mutex_attribute_delete(&attribute);
 #endif // _di_f_thread_mutex_attribute_t_
 
 /**
@@ -52,148 +50,61 @@ extern "C" {
 
   #define macro_f_thread_mutex_attributes_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_mutex_attributes_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_mutex_attributes_t_resize(status, attributes, length) status = f_thread_mutex_attributes_resize(length, &attributes);
-  #define macro_f_thread_mutex_attributes_t_adjust(status, attributes, length) status = f_thread_mutex_attributes_adjust(length, &attributes);
-
-  #define macro_f_thread_mutex_attributes_t_delete_simple(attributes)  f_thread_mutex_attributes_resize(0, &attributes);
-  #define macro_f_thread_mutex_attributes_t_destroy_simple(attributes) f_thread_mutex_attributes_adjust(0, &attributes);
-
-  #define macro_f_thread_mutex_attributes_t_increase(status, step, attributes)      status = f_thread_mutex_attributes_increase(step, attributes);
-  #define macro_f_thread_mutex_attributes_t_increase_by(status, attributes, amount) status = f_thread_mutex_attributes_increase_by(amount, attributes);
-  #define macro_f_thread_mutex_attributes_t_decrease_by(status, attributes, amount) status = f_thread_mutex_attributes_decrease_by(amount, attributes);
-  #define macro_f_thread_mutex_attributes_t_decimate_by(status, attributes, amount) status = f_thread_mutex_attributes_decimate_by(amount, attributes);
 #endif // _di_f_thread_mutex_attributes_t_
 
 /**
- * Resize the thread mutex_attributes array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread mutex_attributes array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_mutex_attributes_adjust_
-  extern f_status_t f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure);
-#endif // _di_f_thread_mutex_attributes_adjust_
-
-/**
- * Resize the thread mutex_attributes array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread mutex_attributes array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_mutex_attributes_decimate_by_
-  extern f_status_t f_thread_mutex_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure);
-#endif // _di_f_thread_mutex_attributes_decimate_by_
-
-/**
- * Resize the thread mutex_attributes array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_mutex_attributess_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread mutex_attributes array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_mutex_attributes_decrease_by_
-  extern f_status_t f_thread_mutex_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure);
-#endif // _di_f_thread_mutex_attributes_decrease_by_
-
-/**
- * Increase the size of the thread mutex_attributes array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread mutex_attributes array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_mutex_attributes_increase_
-  extern f_status_t f_thread_mutex_attributes_increase(const f_number_unsigned_t step, f_thread_mutex_attributes_t * const structure);
-#endif // _di_f_thread_mutex_attributes_increase_
+#ifndef _di_f_thread_mutex_attributes_adjust_callback_
+  extern f_status_t f_thread_mutex_attributes_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_mutex_attributes_adjust_callback_
 
 /**
- * Resize the thread mutex_attributes array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_mutex_attributess_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread mutex_attributes array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_mutex_attributes_increase_by_
-  extern f_status_t f_thread_mutex_attributes_increase_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure);
-#endif // _di_f_thread_mutex_attributes_increase_by_
-
-/**
- * Resize the thread mutex_attributes array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread mutex_attributes array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_mutex_attributes_resize_
-  extern f_status_t f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure);
-#endif // _di_f_thread_mutex_attributes_resize_
+#ifndef _di_f_thread_mutex_attributes_resize_callback_
+  extern f_status_t f_thread_mutex_attributes_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_mutex_attributes_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 6f98338d9b22ab359d83093ceb7dccd239f4435e..a5326ed0af7e773e2d6c7fd3a55956af171a08d8 100644 (file)
@@ -5,66 +5,6 @@
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_onces_adjust_
-  f_status_t f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_adjust(length, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_onces_adjust_
-
-#ifndef _di_f_thread_onces_decimate_by_
-  f_status_t f_thread_onces_decimate_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_decimate_by(amount, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_onces_decimate_by_
-
-#ifndef _di_f_thread_onces_decrease_by_
-  f_status_t f_thread_onces_decrease_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_decrease_by(amount, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_onces_decrease_by_
-
-#ifndef _di_f_thread_onces_increase_
-  f_status_t f_thread_onces_increase(const f_number_unsigned_t step, f_thread_onces_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_increase(step, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_onces_increase_
-
-#ifndef _di_f_thread_onces_increase_by_
-  f_status_t f_thread_onces_increase_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_increase_by(amount, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_onces_increase_by_
-
-#ifndef _di_f_thread_onces_resize_
-  f_status_t f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    return f_memory_array_resize(length, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_onces_resize_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 52c55aaf2158546ecff42e0965f596a2b5e9b44f..700470dd031445db8e40714e4c632ec90d2741e5 100644 (file)
@@ -52,148 +52,8 @@ extern "C" {
 
   #define macro_f_thread_onces_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_onces_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_onces_t_resize(status, onces, length) status = f_thread_onces_resize(length, &onces);
-  #define macro_f_thread_onces_t_adjust(status, onces, length) status = f_thread_onces_adjust(length, &onces);
-
-  #define macro_f_thread_onces_t_delete_simple(onces)  f_thread_onces_resize(0, &onces);
-  #define macro_f_thread_onces_t_destroy_simple(onces) f_thread_onces_adjust(0, &onces);
-
-  #define macro_f_thread_onces_t_increase(status, step, onces)      status = f_thread_onces_increase(step, onces);
-  #define macro_f_thread_onces_t_increase_by(status, onces, amount) status = f_thread_onces_increase_by(amount, onces);
-  #define macro_f_thread_onces_t_decrease_by(status, onces, amount) status = f_thread_onces_decrease_by(amount, onces);
-  #define macro_f_thread_onces_t_decimate_by(status, onces, amount) status = f_thread_onces_decimate_by(amount, onces);
 #endif // _di_f_thread_onces_t_
 
-/**
- * Resize the thread onces array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread onces array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_onces_adjust_
-  extern f_status_t f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const structure);
-#endif // _di_f_thread_onces_adjust_
-
-/**
- * Resize the thread onces array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread onces array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_onces_decimate_by_
-  extern f_status_t f_thread_onces_decimate_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure);
-#endif // _di_f_thread_onces_decimate_by_
-
-/**
- * Resize the thread onces array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread onces array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_onces_decrease_by_
-  extern f_status_t f_thread_onces_decrease_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure);
-#endif // _di_f_thread_onces_decrease_by_
-
-/**
- * Increase the size of the thread onces array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread onces array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_onces_increase_
-  extern f_status_t f_thread_onces_increase(const f_number_unsigned_t step, f_thread_onces_t * const structure);
-#endif // _di_f_thread_onces_increase_
-
-/**
- * Resize the thread onces array to a larger size.
- *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread onces array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_onces_increase_by_
-  extern f_status_t f_thread_onces_increase_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure);
-#endif // _di_f_thread_onces_increase_by_
-
-/**
- * Resize the thread onces array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread onces array to adjust.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_onces_resize_
-  extern f_status_t f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const structure);
-#endif // _di_f_thread_onces_resize_
 
 #ifdef __cplusplus
 } // extern "C"
diff --git a/level_0/f_thread/c/thread/private-once.c b/level_0/f_thread/c/thread/private-once.c
deleted file mode 100644 (file)
index 34c1509..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "../thread.h"
-#include "private-once.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/c/thread/private-once.h b/level_0/f_thread/c/thread/private-once.h
deleted file mode 100644 (file)
index 06504d6..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_thread_once_h
-#define _PRIVATE_F_thread_once_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_thread_once_h
index 484c92345715fb251976e87e13bf8670215e178d..9e21eae9003a6dcb079bbc2b733289eb1815cf1e 100644 (file)
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_semaphores_adjust_
-  f_status_t f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_semaphores_adjust_callback_
+  f_status_t f_thread_semaphores_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (sem_destroy(&structure->array[i]) == -1) return (errno == EINVAL) ? F_status_set_error(F_parameter) : F_status_set_error(F_failure);
-    } // for
+    {
+      f_thread_semaphores_t * const array = (f_thread_semaphores_t *) void_array;
 
-    return f_memory_array_adjust(length, sizeof(f_thread_semaphore_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_semaphores_adjust_
-
-#ifndef _di_f_thread_semaphores_decimate_by_
-  f_status_t f_thread_semaphores_decimate_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (sem_destroy(&structure->array[i]) == -1) return (errno == EINVAL) ? F_status_set_error(F_parameter) : F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_adjust(length, sizeof(f_thread_semaphore_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_semaphores_decimate_by_
-
-#ifndef _di_f_thread_semaphores_decrease_by_
-  f_status_t f_thread_semaphores_decrease_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (sem_destroy(&structure->array[i]) == -1) return (errno == EINVAL) ? F_status_set_error(F_parameter) : F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_resize(length, sizeof(f_thread_semaphore_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_semaphores_decrease_by_
-
-#ifndef _di_f_thread_semaphores_increase_
-  f_status_t f_thread_semaphores_increase(const f_number_unsigned_t step, f_thread_semaphores_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-        if (sem_destroy(&structure->array[i]) == -1) return (errno == EINVAL) ? F_status_set_error(F_parameter) : F_status_set_error(F_failure);
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+        if (sem_destroy(&array->array[i]) == -1) return (errno == EINVAL) ? F_status_set_error(F_parameter) : F_status_set_error(F_failure);
       } // for
-
-      return f_memory_array_resize(length, sizeof(f_thread_semaphore_t), (void **) &structure->array, &structure->used, &structure->size);
     }
 
-    return F_data_not;
+    return F_none;
   }
-#endif // _di_f_thread_semaphores_increase_
-
-#ifndef _di_f_thread_semaphores_increase_by_
-  f_status_t f_thread_semaphores_increase_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+#endif // _di_f_thread_semaphores_adjust_callback_
 
-      const f_number_unsigned_t length = structure->used + amount;
+#ifndef _di_f_thread_semaphores_resize_callback_
+  f_status_t f_thread_semaphores_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+    {
+      f_thread_semaphores_t * const array = (f_thread_semaphores_t *) void_array;
 
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-          if (sem_destroy(&structure->array[i]) == -1) return (errno == EINVAL) ? F_status_set_error(F_parameter) : F_status_set_error(F_failure);
-        } // for
-
-        return f_memory_array_resize(length, sizeof(f_thread_semaphore_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+        if (sem_destroy(&array->array[i]) == -1) return (errno == EINVAL) ? F_status_set_error(F_parameter) : F_status_set_error(F_failure);
+      } // for
     }
 
-    return F_data_not;
+    return F_none;
   }
-#endif // _di_f_thread_semaphores_increase_by_
-
-#ifndef _di_f_thread_semaphores_resize_
-  f_status_t f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (sem_destroy(&structure->array[i]) == -1) return (errno == EINVAL) ? F_status_set_error(F_parameter) : F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_resize(length, sizeof(f_thread_semaphore_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_semaphores_resize_
-
+#endif // _di_f_thread_semaphores_resize_callback_
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 1f622fedb1b438cf3523aadd158e08848f51a7c5..b439014560108cd716dcef1152ccbc2e4927d987 100644 (file)
@@ -29,8 +29,6 @@ extern "C" {
   #define f_thread_semaphore_t_initialize { (long) 0 }
 
   #define macro_f_thread_semaphore_t_initialize_1(semaphore) semaphore
-
-  #define macro_f_thread_semaphore_t_delete_simple(semaphore) f_thread_semaphore_delete(&semaphore);
 #endif // _di_f_thread_semaphore_t_
 
 /**
@@ -53,148 +51,61 @@ extern "C" {
 
   #define macro_f_thread_semaphores_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_semaphores_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_semaphores_t_resize(status, semaphores, length) status = f_thread_semaphores_resize(length, &semaphores);
-  #define macro_f_thread_semaphores_t_adjust(status, semaphores, length) status = f_thread_semaphores_adjust(length, &semaphores);
-
-  #define macro_f_thread_semaphores_t_delete_simple(semaphores)  f_thread_semaphores_resize(0, &semaphores);
-  #define macro_f_thread_semaphores_t_destroy_simple(semaphores) f_thread_semaphores_adjust(0, &semaphores);
-
-  #define macro_f_thread_semaphores_t_increase(status, step, semaphores)      status = f_thread_semaphores_increase(step, semaphores);
-  #define macro_f_thread_semaphores_t_increase_by(status, semaphores, amount) status = f_thread_semaphores_increase_by(amount, semaphores);
-  #define macro_f_thread_semaphores_t_decrease_by(status, semaphores, amount) status = f_thread_semaphores_decrease_by(amount, semaphores);
-  #define macro_f_thread_semaphores_t_decimate_by(status, semaphores, amount) status = f_thread_semaphores_decimate_by(amount, semaphores);
 #endif // _di_f_thread_semaphores_t_
 
 /**
- * Resize the thread semaphores array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread semaphores array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_semaphores_adjust_
-  extern f_status_t f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const structure);
-#endif // _di_f_thread_semaphores_adjust_
-
-/**
- * Resize the thread semaphores array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread semaphores array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_semaphores_decimate_by_
-  extern f_status_t f_thread_semaphores_decimate_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure);
-#endif // _di_f_thread_semaphores_decimate_by_
-
-/**
- * Resize the thread semaphores array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_semaphoress_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread semaphores array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_semaphores_decrease_by_
-  extern f_status_t f_thread_semaphores_decrease_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure);
-#endif // _di_f_thread_semaphores_decrease_by_
-
-/**
- * Increase the size of the thread semaphores array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread semaphores array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_semaphores_increase_
-  extern f_status_t f_thread_semaphores_increase(const f_number_unsigned_t step, f_thread_semaphores_t * const structure);
-#endif // _di_f_thread_semaphores_increase_
+#ifndef _di_f_thread_semaphores_adjust_callback_
+  extern f_status_t f_thread_semaphores_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_semaphores_adjust_callback_
 
 /**
- * Resize the thread semaphores array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_semaphoress_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread semaphores array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_semaphores_increase_by_
-  extern f_status_t f_thread_semaphores_increase_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure);
-#endif // _di_f_thread_semaphores_increase_by_
-
-/**
- * Resize the thread semaphores array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread semaphores array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_semaphores_resize_
-  extern f_status_t f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const structure);
-#endif // _di_f_thread_semaphores_resize_
+#ifndef _di_f_thread_semaphores_resize_callback_
+  extern f_status_t f_thread_semaphores_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_semaphores_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index f0eb8a7b2045a8bf62948143bbbe8c886dfdb498..182049b70f3e8e81253e7569081102f51429b013 100644 (file)
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_sets_adjust_
-  f_status_t f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_sets_adjust_callback_
+  f_status_t f_thread_sets_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_attr_destroy(&structure->array[i].attribute)) return F_status_set_error(F_failure);
-    } // for
+    {
+      f_thread_sets_t * const array = (f_thread_sets_t *) void_array;
 
-    return f_memory_array_adjust(length, sizeof(f_thread_set_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_sets_adjust_
-
-#ifndef _di_f_thread_sets_decimate_by_
-  f_status_t f_thread_sets_decimate_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_attr_destroy(&structure->array[i].attribute)) return F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_adjust(length, sizeof(f_thread_set_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_sets_decimate_by_
-
-#ifndef _di_f_thread_sets_decrease_by_
-  f_status_t f_thread_sets_decrease_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_attr_destroy(&structure->array[i].attribute)) return F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_resize(length, sizeof(f_thread_set_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_sets_decrease_by_
-
-#ifndef _di_f_thread_sets_increase_
-  f_status_t f_thread_sets_increase(const f_number_unsigned_t step, f_thread_sets_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-        if (pthread_attr_destroy(&structure->array[i].attribute)) return F_status_set_error(F_failure);
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+        if (pthread_attr_destroy(&array->array[i].attribute)) return F_status_set_error(F_failure);
       } // for
-
-      return f_memory_array_resize(length, sizeof(f_thread_set_t), (void **) &structure->array, &structure->used, &structure->size);
     }
 
-    return F_data_not;
+    return F_none;
   }
-#endif // _di_f_thread_sets_increase_
-
-#ifndef _di_f_thread_sets_increase_by_
-  f_status_t f_thread_sets_increase_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+#endif // _di_f_thread_sets_adjust_callback_
 
-      const f_number_unsigned_t length = structure->used + amount;
+#ifndef _di_f_thread_sets_resize_callback_
+  f_status_t f_thread_sets_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+    {
+      f_thread_sets_t * const array = (f_thread_sets_t *) void_array;
 
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-          if (pthread_attr_destroy(&structure->array[i].attribute)) return F_status_set_error(F_failure);
-        } // for
-
-        return f_memory_array_resize(length, sizeof(f_thread_set_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+        if (pthread_attr_destroy(&array->array[i].attribute)) return F_status_set_error(F_failure);
+      } // for
     }
 
-    return F_data_not;
-  }
-#endif // _di_f_thread_sets_increase_by_
-
-#ifndef _di_f_thread_sets_resize_
-  f_status_t f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-      if (pthread_attr_destroy(&structure->array[i].attribute)) return F_status_set_error(F_failure);
-    } // for
-
-    return f_memory_array_resize(length, sizeof(f_thread_set_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_sets_resize_
+#endif // _di_f_thread_sets_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 539f6304fd3b32bff114b2febfbb0e3376af5dec..5eb8fa4bb7967a0190469b4089b67f64893d02eb 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
     int result;
   } f_thread_set_t;
 
-  #define f_thread_set_t_initialize { f_thread_attribute_t_initialize, f_thread_id_t_initialize, 0 }
+  #define f_thread_set_t_initialize { 0 }
 
   #define macro_f_thread_set_t_initialize_1(attribute, id, result) { attribute, id, result }
 
@@ -39,8 +39,6 @@ extern "C" {
     macro_f_thread_attribute_t_clear(thread.attribute) \
     macro_f_thread_id_t_clear(thread.id) \
     result = 0;
-
-  #define macro_f_thread_set_t_delete_simple(set) macro_f_thread_attribute_t_delete_simple(set.attribute)
 #endif // _di_f_thread_set_t_
 
 /**
@@ -63,148 +61,61 @@ extern "C" {
 
   #define macro_f_thread_sets_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_sets_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_sets_t_resize(status, sets, length) status = f_thread_sets_resize(length, &sets);
-  #define macro_f_thread_sets_t_adjust(status, sets, length) status = f_thread_sets_adjust(length, &sets);
-
-  #define macro_f_thread_sets_t_delete_simple(sets)  f_thread_sets_resize(0, &sets);
-  #define macro_f_thread_sets_t_destroy_simple(sets) f_thread_sets_adjust(0, &sets);
-
-  #define macro_f_thread_sets_t_increase(status, step, sets)      status = f_thread_sets_increase(step, sets);
-  #define macro_f_thread_sets_t_increase_by(status, sets, amount) status = f_thread_sets_increase_by(amount, sets);
-  #define macro_f_thread_sets_t_decrease_by(status, sets, amount) status = f_thread_sets_decrease_by(amount, sets);
-  #define macro_f_thread_sets_t_decimate_by(status, sets, amount) status = f_thread_sets_decimate_by(amount, sets);
 #endif // _di_f_thread_sets_t_
 
 /**
- * Resize the thread sets array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread sets array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_sets_adjust_
-  extern f_status_t f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const structure);
-#endif // _di_f_thread_sets_adjust_
-
-/**
- * Resize the thread sets array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread sets array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_sets_decimate_by_
-  extern f_status_t f_thread_sets_decimate_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure);
-#endif // _di_f_thread_sets_decimate_by_
-
-/**
- * Resize the thread sets array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_setss_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread sets array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_sets_decrease_by_
-  extern f_status_t f_thread_sets_decrease_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure);
-#endif // _di_f_thread_sets_decrease_by_
-
-/**
- * Increase the size of the thread sets array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread sets array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_sets_increase_
-  extern f_status_t f_thread_sets_increase(const f_number_unsigned_t step, f_thread_sets_t * const structure);
-#endif // _di_f_thread_sets_increase_
+#ifndef _di_f_thread_sets_adjust_callback_
+  extern f_status_t f_thread_sets_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_sets_adjust_callback_
 
 /**
- * Resize the thread sets array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_setss_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread sets array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_sets_increase_by_
-  extern f_status_t f_thread_sets_increase_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure);
-#endif // _di_f_thread_sets_increase_by_
-
-/**
- * Resize the thread sets array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread sets array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_sets_resize_
-  extern f_status_t f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const structure);
-#endif // _di_f_thread_sets_resize_
+#ifndef _di_f_thread_sets_resize_callback_
+  extern f_status_t f_thread_sets_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_sets_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index 6f2f08db1e89e6fc9642d94d14d8ed5fec15de56..030d1df3b53460b265738bec4c41fef61647acad 100644 (file)
@@ -5,18 +5,16 @@
 extern "C" {
 #endif
 
-#ifndef _di_f_thread_spins_adjust_
-  f_status_t f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_spins_adjust_callback_
+  f_status_t f_thread_spins_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_spins_t * const array = (f_thread_spins_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_spin_destroy(&structure->array[i]);
+        error = pthread_spin_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -27,158 +25,20 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_adjust(length, sizeof(f_thread_spin_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_spins_adjust_
+#endif // _di_f_thread_spins_adjust_callback_
 
-#ifndef _di_f_thread_spins_decimate_by_
-  f_status_t f_thread_spins_decimate_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_spin_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_adjust(length, sizeof(f_thread_spin_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_spins_decimate_by_
-
-#ifndef _di_f_thread_spins_decrease_by_
-  f_status_t f_thread_spins_decrease_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (!amount) return F_data_not;
-
-    const f_number_unsigned_t length = (structure->size > amount) ? structure->size - amount : 0;
-
-    {
-      int error = 0;
-
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-        error = pthread_spin_destroy(&structure->array[i]);
-
-        if (error) {
-          if (error == EBUSY) return F_status_set_error(F_busy);
-          if (error == EINVAL) return F_status_set_error(F_parameter);
-
-          return F_status_set_error(F_failure);
-        }
-      } // for
-    }
-
-    return f_memory_array_resize(length, sizeof(f_thread_spin_t), (void **) &structure->array, &structure->used, &structure->size);
-  }
-#endif // _di_f_thread_spins_decrease_by_
-
-#ifndef _di_f_thread_spins_increase_
-  f_status_t f_thread_spins_increase(const f_number_unsigned_t step, f_thread_spins_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (step && structure->used + 1 > structure->size) {
-      f_number_unsigned_t length = structure->used + step;
-
-      if (length > F_number_t_size_unsigned_d) {
-        if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        length = F_number_t_size_unsigned_d;
-      }
-
-      {
-        int error = 0;
-
-        for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-          error = pthread_spin_destroy(&structure->array[i]);
-
-          if (error) {
-            if (error == EBUSY) return F_status_set_error(F_busy);
-            if (error == EINVAL) return F_status_set_error(F_parameter);
-
-            return F_status_set_error(F_failure);
-          }
-        } // for
-      }
-
-      return f_memory_array_resize(length, sizeof(f_thread_spin_t), (void **) &structure->array, &structure->used, &structure->size);
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_spins_increase_
-
-#ifndef _di_f_thread_spins_increase_by_
-  f_status_t f_thread_spins_increase_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
-
-    if (amount) {
-      if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-      const f_number_unsigned_t length = structure->used + amount;
-
-      if (length > structure->size) {
-        if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
-        {
-          int error = 0;
-
-          for (f_number_unsigned_t i = length; i < structure->size; ++i) {
-
-            error = pthread_spin_destroy(&structure->array[i]);
-
-            if (error) {
-              if (error == EBUSY) return F_status_set_error(F_busy);
-              if (error == EINVAL) return F_status_set_error(F_parameter);
-
-              return F_status_set_error(F_failure);
-            }
-          } // for
-        }
-
-        return f_memory_array_resize(length, sizeof(f_thread_spin_t), (void **) &structure->array, &structure->used, &structure->size);
-      }
-    }
-
-    return F_data_not;
-  }
-#endif // _di_f_thread_spins_increase_by_
-
-#ifndef _di_f_thread_spins_resize_
-  f_status_t f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const structure) {
-    #ifndef _di_level_0_parameter_checking_
-      if (!structure) return F_status_set_error(F_parameter);
-    #endif // _di_level_0_parameter_checking_
+#ifndef _di_f_thread_spins_resize_callback_
+  f_status_t f_thread_spins_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
+      f_thread_spins_t * const array = (f_thread_spins_t *) void_array;
       int error = 0;
 
-      for (f_number_unsigned_t i = length; i < structure->size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
-        error = pthread_spin_destroy(&structure->array[i]);
+        error = pthread_spin_destroy(&array->array[i]);
 
         if (error) {
           if (error == EBUSY) return F_status_set_error(F_busy);
@@ -189,9 +49,9 @@ extern "C" {
       } // for
     }
 
-    return f_memory_array_resize(length, sizeof(f_thread_spin_t), (void **) &structure->array, &structure->used, &structure->size);
+    return F_none;
   }
-#endif // _di_f_thread_spins_resize_
+#endif // _di_f_thread_spins_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index fd67e6fb7d86036c26729dc204ef395b0778f74e..be235b4d0abf2c966bcc4009cd2700cdd0e40581 100644 (file)
@@ -27,8 +27,6 @@ extern "C" {
   #define f_thread_spin_t_initialize ((pthread_spinlock_t) 0xFFFFFFFF)
 
   #define macro_f_thread_spin_t_initialize_1(spin) spin
-
-  #define macro_f_thread_spin_t_delete_simple(spin) f_thread_spin_delete(&spin);
 #endif // _di_f_thread_spin_t_
 
 /**
@@ -51,148 +49,61 @@ extern "C" {
 
   #define macro_f_thread_spins_t_initialize_1(array, size, used) { array, size, used }
   #define macro_f_thread_spins_t_initialize_2(array, length) { array, length, length }
-
-  #define macro_f_thread_spins_t_resize(status, spins, length) status = f_thread_spins_resize(length, &spins);
-  #define macro_f_thread_spins_t_adjust(status, spins, length) status = f_thread_spins_adjust(length, &spins);
-
-  #define macro_f_thread_spins_t_delete_simple(spins)  f_thread_spins_resize(0, &spins);
-  #define macro_f_thread_spins_t_destroy_simple(spins) f_thread_spins_adjust(0, &spins);
-
-  #define macro_f_thread_spins_t_increase(status, step, spins)      status = f_thread_spins_increase(step, spins);
-  #define macro_f_thread_spins_t_increase_by(status, spins, amount) status = f_thread_spins_increase_by(amount, spins);
-  #define macro_f_thread_spins_t_decrease_by(status, spins, amount) status = f_thread_spins_decrease_by(amount, spins);
-  #define macro_f_thread_spins_t_decimate_by(status, spins, amount) status = f_thread_spins_decimate_by(amount, spins);
 #endif // _di_f_thread_spins_t_
 
 /**
- * Resize the thread spins array.
- *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread spins array to resize.
- *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_spins_adjust_
-  extern f_status_t f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const structure);
-#endif // _di_f_thread_spins_adjust_
-
-/**
- * Resize the thread spins array to a smaller size.
- *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
- *
- * @param amount
- *   A positive number representing how much to decimate the size by.
- * @param structure
- *   The thread spins array to resize.
- *
- * @return
- *   F_none on success.
- *   F_data_not if amount is 0.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_spins_decimate_by_
-  extern f_status_t f_thread_spins_decimate_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure);
-#endif // _di_f_thread_spins_decimate_by_
-
-/**
- * Resize the thread spins array to a smaller size.
+ * A callback intended to be passed to f_memory_arrays_adjust() for an f_thread_spinss_t structure.
  *
- * This will resize making the array smaller based on (size - given length).
- * If the given length is too small, then the resize will fail.
- * This will not shrink the size to less than 0.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to decrease the size by.
- * @param structure
- *   The thread spins array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not if amount is 0.
  *
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_spins_decrease_by_
-  extern f_status_t f_thread_spins_decrease_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure);
-#endif // _di_f_thread_spins_decrease_by_
-
-/**
- * Increase the size of the thread spins array, but only if necessary.
- *
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
  *
- * @param step
- *   The allocation step to use.
- *   Must be greater than 0.
- * @param structure
- *   The thread spins array to resize.
+ *   Errors (with error bit) from: f_memory_array_adjust().
  *
- * @return
- *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_adjust()
+ * @see f_memory_arrays_adjust()
  */
-#ifndef _di_f_thread_spins_increase_
-  extern f_status_t f_thread_spins_increase(const f_number_unsigned_t step, f_thread_spins_t * const structure);
-#endif // _di_f_thread_spins_increase_
+#ifndef _di_f_thread_spins_adjust_callback_
+  extern f_status_t f_thread_spins_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_spins_adjust_callback_
 
 /**
- * Resize the thread spins array to a larger size.
+ * A callback intended to be passed to f_memory_arrays_resize() for an f_thread_spinss_t structure.
  *
- * This will resize making the array larger based on the given length.
- * If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
- * If already set to the maximum buffer size, then the resize will fail.
+ * This does not do parameter checking.
  *
- * @param amount
- *   A positive number representing how much to increase the size by.
- * @param structure
- *   The thread spins array to resize.
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
  *
  * @return
  *   F_none on success.
- *   F_data_not on success, but there is no reason to increase size (used + amount <= size).
  *
- *   F_array_too_large (with error bit) if the new array length is too large.
- *   F_memory_not (with error bit) on out of memory.
  *   F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_thread_spins_increase_by_
-  extern f_status_t f_thread_spins_increase_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure);
-#endif // _di_f_thread_spins_increase_by_
-
-/**
- * Resize the thread spins array.
  *
- * @param length
- *   The new size to use.
- * @param structure
- *   The thread spins array to adjust.
+ *   Errors (with error bit) from: f_memory_array_resize().
  *
- * @return
- *   F_none on success.
- *
- *   F_memory_not (with error bit) on out of memory.
- *   F_parameter (with error bit) if a parameter is invalid.
+ * @see f_memory_array_resize()
+ * @see f_memory_arrays_resize()
  */
-#ifndef _di_f_thread_spins_resize_
-  extern f_status_t f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const structure);
-#endif // _di_f_thread_spins_resize_
+#ifndef _di_f_thread_spins_resize_callback_
+  extern f_status_t f_thread_spins_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_f_thread_spins_resize_callback_
 
 #ifdef __cplusplus
 } // extern "C"
index e09a69db0cfbe3d2ccf836c4ebc4795922909a1f..d1fb85c10a1d4e0b0fdfdf046c042c350806a198 100644 (file)
@@ -30,7 +30,8 @@ build_language c
 build_libraries -pthread -lc
 build_libraries-individual -lf_memory -lf_string
 
-build_sources_library thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c ../../tests/unit/c/mock-thread.c
+build_sources_library thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c
+build_sources_library ../../tests/unit/c/mock-thread.c
 
 build_sources_headers thread.h thread/attribute.h thread/barrier.h thread/barrier_attribute.h thread/condition.h thread/condition_attribute.h thread/id.h thread/key.h thread/lock.h thread/lock_attribute.h thread/mutex.h thread/mutex_attribute.h thread/once.h thread/semaphore.h thread/set.h thread/spin.h
 
@@ -64,6 +65,8 @@ flags-coverage --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
 flags_library -fPIC
 
 # Inject mocks.
+flags -Wl,--wrap=f_memory_array_adjust
+flags -Wl,--wrap=f_memory_array_resize
 flags -Wl,--wrap=pthread_atfork
 flags -Wl,--wrap=pthread_attr_destroy
 flags -Wl,--wrap=pthread_attr_getaffinity_np
index ef1c26f6a5266100505619756f6236a9b8a6cc8e..7d6fe4cdc1b47256366bd0c48136d9d1d190e877 100644 (file)
@@ -25,21 +25,19 @@ build_language c
 build_libraries -lc -lcmocka
 build_libraries-individual -lf_memory -lf_string -lf_thread
 
-build_sources_program test-thread-attributes_adjust.c test-thread-attributes_decimate_by.c test-thread-attributes_decrease_by.c test-thread-attributes_increase.c test-thread-attributes_increase_by.c test-thread-attributes_resize.c
-build_sources_program test-thread-barrier_attributes_adjust.c test-thread-barrier_attributes_decimate_by.c test-thread-barrier_attributes_decrease_by.c test-thread-barrier_attributes_increase.c test-thread-barrier_attributes_increase_by.c test-thread-barrier_attributes_resize.c
-build_sources_program test-thread-barriers_adjust.c test-thread-barriers_decimate_by.c test-thread-barriers_decrease_by.c test-thread-barriers_increase.c test-thread-barriers_increase_by.c test-thread-barriers_resize.c
-build_sources_program test-thread-condition_attributes_adjust.c test-thread-condition_attributes_decimate_by.c test-thread-condition_attributes_decrease_by.c test-thread-condition_attributes_increase.c test-thread-condition_attributes_increase_by.c test-thread-condition_attributes_resize.c
-build_sources_program test-thread-conditions_adjust.c test-thread-conditions_decimate_by.c test-thread-conditions_decrease_by.c test-thread-conditions_increase.c test-thread-conditions_increase_by.c test-thread-conditions_resize.c
-build_sources_program test-thread-ids_adjust.c test-thread-ids_decimate_by.c test-thread-ids_decrease_by.c test-thread-ids_increase.c test-thread-ids_increase_by.c test-thread-ids_resize.c
-build_sources_program test-thread-keys_adjust.c test-thread-keys_decimate_by.c test-thread-keys_decrease_by.c test-thread-keys_increase.c test-thread-keys_increase_by.c test-thread-keys_resize.c
-build_sources_program test-thread-lock_attributes_adjust.c test-thread-lock_attributes_decimate_by.c test-thread-lock_attributes_decrease_by.c test-thread-lock_attributes_increase.c test-thread-lock_attributes_increase_by.c test-thread-lock_attributes_resize.c
-build_sources_program test-thread-locks_adjust.c test-thread-locks_decimate_by.c test-thread-locks_decrease_by.c test-thread-locks_increase.c test-thread-locks_increase_by.c test-thread-locks_resize.c
-build_sources_program test-thread-mutex_attributes_adjust.c test-thread-mutex_attributes_decimate_by.c test-thread-mutex_attributes_decrease_by.c test-thread-mutex_attributes_increase.c test-thread-mutex_attributes_increase_by.c test-thread-mutex_attributes_resize.c
-build_sources_program test-thread-mutexs_adjust.c test-thread-mutexs_decimate_by.c test-thread-mutexs_decrease_by.c test-thread-mutexs_increase.c test-thread-mutexs_increase_by.c test-thread-mutexs_resize.c
-build_sources_program test-thread-onces_adjust.c test-thread-onces_decimate_by.c test-thread-onces_decrease_by.c test-thread-onces_increase.c test-thread-onces_increase_by.c test-thread-onces_resize.c
-build_sources_program test-thread-semaphores_adjust.c test-thread-semaphores_decimate_by.c test-thread-semaphores_decrease_by.c test-thread-semaphores_increase.c test-thread-semaphores_increase_by.c test-thread-semaphores_resize.c
-build_sources_program test-thread-sets_adjust.c test-thread-sets_decimate_by.c test-thread-sets_decrease_by.c test-thread-sets_increase.c test-thread-sets_increase_by.c test-thread-sets_resize.c
-build_sources_program test-thread-spins_adjust.c test-thread-spins_decimate_by.c test-thread-spins_decrease_by.c test-thread-spins_increase.c test-thread-spins_increase_by.c test-thread-spins_resize.c
+build_sources_program test-thread-attributes_adjust_callback.c test-thread-attributes_resize_callback.c
+build_sources_program test-thread-barriers_adjust_callback.c test-thread-barriers_resize_callback.c
+build_sources_program test-thread-barrier_attributes_adjust_callback.c test-thread-barrier_attributes_resize_callback.c
+build_sources_program test-thread-conditions_adjust_callback.c test-thread-conditions_resize_callback.c
+build_sources_program test-thread-condition_attributes_adjust_callback.c test-thread-condition_attributes_resize_callback.c
+build_sources_program test-thread-keys_adjust_callback.c test-thread-keys_resize_callback.c
+build_sources_program test-thread-locks_adjust_callback.c test-thread-locks_resize_callback.c
+build_sources_program test-thread-lock_attributes_adjust_callback.c test-thread-lock_attributes_resize_callback.c
+build_sources_program test-thread-mutexs_adjust_callback.c test-thread-mutexs_resize_callback.c
+build_sources_program test-thread-mutex_attributes_adjust_callback.c test-thread-mutex_attributes_resize_callback.c
+build_sources_program test-thread-semaphores_adjust_callback.c test-thread-semaphores_resize_callback.c
+build_sources_program test-thread-sets_adjust_callback.c test-thread-sets_resize_callback.c
+build_sources_program test-thread-spins_adjust_callback.c test-thread-spins_resize_callback.c
 
 build_sources_program test-thread-at_fork.c
 build_sources_program test-thread-attribute_affinity_get.c test-thread-attribute_affinity_set.c
index 26f4aaf4e46f1b3dc4cd8a71c8db25d1ed31649b..c674e2a54e4345314744413efd62ad8d123b9e31 100644 (file)
@@ -4,6 +4,32 @@
 extern "C" {
 #endif
 
+f_status_t __wrap_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
+
+  if (!array || !used || !size) return F_status_set_error(F_parameter_not);
+
+  const bool failure = mock_type(bool);
+
+  if (failure) return mock_type(f_status_t);
+
+  *size = length;
+
+  return mock_type(f_status_t);
+}
+
+f_status_t __wrap_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
+
+  if (!array || !used || !size) return F_status_set_error(F_parameter_not);
+
+  const bool failure = mock_type(bool);
+
+  if (failure) return mock_type(f_status_t);
+
+  *size = length;
+
+  return mock_type(f_status_t);
+}
+
 int __wrap_pthread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void)) {
 
   const bool failure = mock_type(bool);
index 92e6f7c1824cb600b9d33c98cb451e7517d1a9d9..80c7bc2bb7aa17f9f0abe37cd296ade5050a59f3 100644 (file)
@@ -29,6 +29,8 @@ extern "C" {
 
 const static int mock_errno_generic = 32767;
 
+extern f_status_t __wrap_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
+extern f_status_t __wrap_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
 extern int __wrap_pthread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void));
 extern int __wrap_pthread_attr_destroy(pthread_attr_t *attr);
 extern int __wrap_pthread_attr_getaffinity_np(const pthread_attr_t *attr, size_t cpusetsize, cpu_set_t *cpuset);
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-attributes_adjust.c
deleted file mode 100644 (file)
index e8c1a2d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-attributes_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_attributes_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_attributes_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-attributes_adjust.h
deleted file mode 100644 (file)
index e9cb0fd..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_attributes_adjust
-#define _TEST__F_thread__thread_attributes_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_attributes_adjust()
- */
-extern void test__f_thread_attributes_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_attributes_adjust()
- */
-extern void test__f_thread_attributes_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_attributes_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-attributes_adjust_callback.c
new file mode 100644 (file)
index 0000000..00c6157
--- /dev/null
@@ -0,0 +1,55 @@
+#include "test-thread.h"
+#include "test-thread-attributes_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_attributes_adjust_callback__fails(void **state) {
+
+  f_thread_attribute_t data = f_thread_attribute_t_initialize;
+  f_thread_attribute_t data_array[] = { data };
+  f_thread_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_attributes_t datass_array[] = { datas };
+
+  int errnos[] = {
+    1,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_failure),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_pthread_attr_destroy, true);
+    will_return(__wrap_pthread_attr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_attributes_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_attributes_adjust_callback__works(void **state) {
+
+  f_thread_attribute_t data = f_thread_attribute_t_initialize;
+  f_thread_attribute_t data_array[] = { data };
+  f_thread_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_attributes_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_attr_destroy, false);
+
+    const f_status_t status = f_thread_attributes_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-attributes_adjust_callback.h
new file mode 100644 (file)
index 0000000..ba2b2c9
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__attributes_adjust_callback
+#define _TEST__F_thread__attributes_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_attributes_adjust_callback_()
+ */
+extern void test__f_thread_attributes_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_attributes_adjust_callback_()
+ */
+extern void test__f_thread_attributes_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__attributes_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-attributes_decimate_by.c
deleted file mode 100644 (file)
index 713cf52..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-attributes_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_attributes_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_attributes_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_attributes_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_attributes_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_attr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_attributes_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-attributes_decimate_by.h
deleted file mode 100644 (file)
index 1e22f8c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_attributes_decimate_by
-#define _TEST__F_thread__thread_attributes_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_attributes_decimate_by()
- */
-extern void test__f_thread_attributes_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_attributes_decimate_by()
- */
-extern void test__f_thread_attributes_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_attributes_decimate_by()
- */
-extern void test__f_thread_attributes_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_attributes_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-attributes_decrease_by.c
deleted file mode 100644 (file)
index 6e650bc..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-attributes_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_attributes_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_attributes_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_attributes_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_attributes_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_attr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_attributes_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-attributes_decrease_by.h
deleted file mode 100644 (file)
index 8e4418e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_attributes_decrease_by
-#define _TEST__F_thread__thread_attributes_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_attributes_decrease_by()
- */
-extern void test__f_thread_attributes_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_attributes_decrease_by()
- */
-extern void test__f_thread_attributes_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_attributes_decrease_by()
- */
-extern void test__f_thread_attributes_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_attributes_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_increase.c b/level_0/f_thread/tests/unit/c/test-thread-attributes_increase.c
deleted file mode 100644 (file)
index 134b72d..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-attributes_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_attributes_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_attributes_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_attributes_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_attributes_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_attributes_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_increase.h b/level_0/f_thread/tests/unit/c/test-thread-attributes_increase.h
deleted file mode 100644 (file)
index 0ea2031..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_attributes_increase
-#define _TEST__F_thread__thread_attributes_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_attributes_increase()
- */
-extern void test__f_thread_attributes_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_attributes_increase()
- */
-extern void test__f_thread_attributes_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_attributes_increase()
- */
-extern void test__f_thread_attributes_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_attributes_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-attributes_increase_by.c
deleted file mode 100644 (file)
index 98cb6ed..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-attributes_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_attributes_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_attributes_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_attributes_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_attributes_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_attributes_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-attributes_increase_by.h
deleted file mode 100644 (file)
index 86a8d2e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_attributes_increase_by
-#define _TEST__F_thread__thread_attributes_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_attributes_increase_by()
- */
-extern void test__f_thread_attributes_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_attributes_increase_by()
- */
-extern void test__f_thread_attributes_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_attributes_increase_by()
- */
-extern void test__f_thread_attributes_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_attributes_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_resize.c b/level_0/f_thread/tests/unit/c/test-thread-attributes_resize.c
deleted file mode 100644 (file)
index 5bca614..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-attributes_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_attributes_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_attributes_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_attributes_t data = f_thread_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_resize.h b/level_0/f_thread/tests/unit/c/test-thread-attributes_resize.h
deleted file mode 100644 (file)
index ed0cc60..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_attributes_resize
-#define _TEST__F_thread__thread_attributes_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_attributes_resize()
- */
-extern void test__f_thread_attributes_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_attributes_resize()
- */
-extern void test__f_thread_attributes_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_attributes_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-attributes_resize_callback.c
new file mode 100644 (file)
index 0000000..17c4c59
--- /dev/null
@@ -0,0 +1,55 @@
+#include "test-thread.h"
+#include "test-thread-attributes_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_attributes_resize_callback__fails(void **state) {
+
+  f_thread_attribute_t data = f_thread_attribute_t_initialize;
+  f_thread_attribute_t data_array[] = { data };
+  f_thread_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_attributes_t datass_array[] = { datas };
+
+  int errnos[] = {
+    1,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_failure),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_pthread_attr_destroy, true);
+    will_return(__wrap_pthread_attr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_attributes_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_attributes_resize_callback__works(void **state) {
+
+  f_thread_attribute_t data = f_thread_attribute_t_initialize;
+  f_thread_attribute_t data_array[] = { data };
+  f_thread_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_attributes_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_attr_destroy, false);
+
+    const f_status_t status = f_thread_attributes_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-attributes_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-attributes_resize_callback.h
new file mode 100644 (file)
index 0000000..b7e9d73
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__attributes_resize_callback
+#define _TEST__F_thread__attributes_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_attributes_resize_callback_()
+ */
+extern void test__f_thread_attributes_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_attributes_resize_callback_()
+ */
+extern void test__f_thread_attributes_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__attributes_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust.c
deleted file mode 100644 (file)
index d1c47f3..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barrier_attributes_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barrier_attributes_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_barrier_attributes_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust.h
deleted file mode 100644 (file)
index e745db0..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barrier_attributes_adjust
-#define _TEST__F_thread__thread_barrier_attributes_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barrier_attributes_adjust()
- */
-extern void test__f_thread_barrier_attributes_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barrier_attributes_adjust()
- */
-extern void test__f_thread_barrier_attributes_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_barrier_attributes_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust_callback.c
new file mode 100644 (file)
index 0000000..1265c66
--- /dev/null
@@ -0,0 +1,55 @@
+#include "test-thread.h"
+#include "test-thread-barrier_attributes_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_barrier_attributes_adjust_callback__fails(void **state) {
+
+  f_thread_barrier_attribute_t data = f_thread_barrier_attribute_t_initialize;
+  f_thread_barrier_attribute_t data_array[] = { data };
+  f_thread_barrier_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_barrier_attributes_t datass_array[] = { datas };
+
+  int errnos[] = {
+    1,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_failure),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_pthread_barrierattr_destroy, true);
+    will_return(__wrap_pthread_barrierattr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_barrier_attributes_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_barrier_attributes_adjust_callback__works(void **state) {
+
+  f_thread_barrier_attribute_t data = f_thread_barrier_attribute_t_initialize;
+  f_thread_barrier_attribute_t data_array[] = { data };
+  f_thread_barrier_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_barrier_attributes_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_barrierattr_destroy, false);
+
+    const f_status_t status = f_thread_barrier_attributes_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_adjust_callback.h
new file mode 100644 (file)
index 0000000..b8a7b13
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__barrier_attributes_adjust_callback
+#define _TEST__F_thread__barrier_attributes_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_barrier_attributes_adjust_callback_()
+ */
+extern void test__f_thread_barrier_attributes_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_barrier_attributes_adjust_callback_()
+ */
+extern void test__f_thread_barrier_attributes_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__barrier_attributes_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decimate_by.c
deleted file mode 100644 (file)
index 0117a97..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barrier_attributes_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barrier_attributes_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_barrier_attributes_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_barrier_attributes_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_barrierattr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_barrier_attributes_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decimate_by.h
deleted file mode 100644 (file)
index 5951459..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barrier_attributes_decimate_by
-#define _TEST__F_thread__thread_barrier_attributes_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barrier_attributes_decimate_by()
- */
-extern void test__f_thread_barrier_attributes_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_barrier_attributes_decimate_by()
- */
-extern void test__f_thread_barrier_attributes_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barrier_attributes_decimate_by()
- */
-extern void test__f_thread_barrier_attributes_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_barrier_attributes_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decrease_by.c
deleted file mode 100644 (file)
index a87ad3e..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barrier_attributes_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barrier_attributes_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_barrier_attributes_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_barrier_attributes_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_barrierattr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_barrier_attributes_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_decrease_by.h
deleted file mode 100644 (file)
index cd71547..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barrier_attributes_decrease_by
-#define _TEST__F_thread__thread_barrier_attributes_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barrier_attributes_decrease_by()
- */
-extern void test__f_thread_barrier_attributes_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_barrier_attributes_decrease_by()
- */
-extern void test__f_thread_barrier_attributes_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barrier_attributes_decrease_by()
- */
-extern void test__f_thread_barrier_attributes_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_barrier_attributes_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase.c b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase.c
deleted file mode 100644 (file)
index a51e3da..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barrier_attributes_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barrier_attributes_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_barrier_attributes_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_barrier_attributes_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_barrier_attributes_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase.h b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase.h
deleted file mode 100644 (file)
index d8068fb..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barrier_attributes_increase
-#define _TEST__F_thread__thread_barrier_attributes_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barrier_attributes_increase()
- */
-extern void test__f_thread_barrier_attributes_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_barrier_attributes_increase()
- */
-extern void test__f_thread_barrier_attributes_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barrier_attributes_increase()
- */
-extern void test__f_thread_barrier_attributes_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_barrier_attributes_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase_by.c
deleted file mode 100644 (file)
index 30382ab..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barrier_attributes_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barrier_attributes_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_barrier_attributes_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_barrier_attributes_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_barrier_attributes_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_increase_by.h
deleted file mode 100644 (file)
index 800d330..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barrier_attributes_increase_by
-#define _TEST__F_thread__thread_barrier_attributes_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barrier_attributes_increase_by()
- */
-extern void test__f_thread_barrier_attributes_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_barrier_attributes_increase_by()
- */
-extern void test__f_thread_barrier_attributes_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barrier_attributes_increase_by()
- */
-extern void test__f_thread_barrier_attributes_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_barrier_attributes_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize.c b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize.c
deleted file mode 100644 (file)
index 8255c02..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barrier_attributes_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barrier_attributes_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_barrier_attributes_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_barrier_attributes_t data = f_thread_barrier_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barrier_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize.h b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize.h
deleted file mode 100644 (file)
index be3af2d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barrier_attributes_resize
-#define _TEST__F_thread__thread_barrier_attributes_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barrier_attributes_resize()
- */
-extern void test__f_thread_barrier_attributes_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barrier_attributes_resize()
- */
-extern void test__f_thread_barrier_attributes_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_barrier_attributes_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize_callback.c
new file mode 100644 (file)
index 0000000..8472f8c
--- /dev/null
@@ -0,0 +1,55 @@
+#include "test-thread.h"
+#include "test-thread-barrier_attributes_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_barrier_attributes_resize_callback__fails(void **state) {
+
+  f_thread_barrier_attribute_t data = f_thread_barrier_attribute_t_initialize;
+  f_thread_barrier_attribute_t data_array[] = { data };
+  f_thread_barrier_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_barrier_attributes_t datass_array[] = { datas };
+
+  int errnos[] = {
+    1,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_failure),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_pthread_barrierattr_destroy, true);
+    will_return(__wrap_pthread_barrierattr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_barrier_attributes_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_barrier_attributes_resize_callback__works(void **state) {
+
+  f_thread_barrier_attribute_t data = f_thread_barrier_attribute_t_initialize;
+  f_thread_barrier_attribute_t data_array[] = { data };
+  f_thread_barrier_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_barrier_attributes_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_barrierattr_destroy, false);
+
+    const f_status_t status = f_thread_barrier_attributes_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-barrier_attributes_resize_callback.h
new file mode 100644 (file)
index 0000000..5b636f8
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__barrier_attributes_resize_callback
+#define _TEST__F_thread__barrier_attributes_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_barrier_attributes_resize_callback_()
+ */
+extern void test__f_thread_barrier_attributes_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_barrier_attributes_resize_callback_()
+ */
+extern void test__f_thread_barrier_attributes_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__barrier_attributes_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-barriers_adjust.c
deleted file mode 100644 (file)
index 75dd228..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barriers_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barriers_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_barriers_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-barriers_adjust.h
deleted file mode 100644 (file)
index 90ab39b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barriers_adjust
-#define _TEST__F_thread__thread_barriers_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barriers_adjust()
- */
-extern void test__f_thread_barriers_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barriers_adjust()
- */
-extern void test__f_thread_barriers_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_barriers_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-barriers_adjust_callback.c
new file mode 100644 (file)
index 0000000..1712b0d
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-barriers_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_barriers_adjust_callback__fails(void **state) {
+
+  f_thread_barrier_t data = f_thread_barrier_t_initialize;
+  f_thread_barrier_t data_array[] = { data };
+  f_thread_barriers_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_barriers_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_barrier_destroy, true);
+    will_return(__wrap_pthread_barrier_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_barriers_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_barriers_adjust_callback__works(void **state) {
+
+  f_thread_barrier_t data = f_thread_barrier_t_initialize;
+  f_thread_barrier_t data_array[] = { data };
+  f_thread_barriers_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_barriers_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_barrier_destroy, false);
+
+    const f_status_t status = f_thread_barriers_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-barriers_adjust_callback.h
new file mode 100644 (file)
index 0000000..b17f657
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__barriers_adjust_callback
+#define _TEST__F_thread__barriers_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_barriers_adjust_callback_()
+ */
+extern void test__f_thread_barriers_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_barriers_adjust_callback_()
+ */
+extern void test__f_thread_barriers_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__barriers_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-barriers_decimate_by.c
deleted file mode 100644 (file)
index ac22ea8..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barriers_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barriers_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_barriers_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_barriers_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_barriers_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_barrier_destroy, F_false);
-    } // for
-
-    const f_status_t status = f_thread_barriers_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-barriers_decimate_by.h
deleted file mode 100644 (file)
index 3d7cf14..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barriers_decimate_by
-#define _TEST__F_thread__thread_barriers_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barriers_decimate_by()
- */
-extern void test__f_thread_barriers_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_barriers_decimate_by()
- */
-extern void test__f_thread_barriers_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barriers_decimate_by()
- */
-extern void test__f_thread_barriers_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_barriers_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-barriers_decrease_by.c
deleted file mode 100644 (file)
index 0af5a54..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barriers_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barriers_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_barriers_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_barriers_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_barriers_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_barrier_destroy, F_false);
-    } // for
-
-    const f_status_t status = f_thread_barriers_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-barriers_decrease_by.h
deleted file mode 100644 (file)
index d76a072..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barriers_decrease_by
-#define _TEST__F_thread__thread_barriers_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barriers_decrease_by()
- */
-extern void test__f_thread_barriers_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_barriers_decrease_by()
- */
-extern void test__f_thread_barriers_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barriers_decrease_by()
- */
-extern void test__f_thread_barriers_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_barriers_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_increase.c b/level_0/f_thread/tests/unit/c/test-thread-barriers_increase.c
deleted file mode 100644 (file)
index f70549b..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barriers_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barriers_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_barriers_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_barriers_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_barriers_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_barriers_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_increase.h b/level_0/f_thread/tests/unit/c/test-thread-barriers_increase.h
deleted file mode 100644 (file)
index 282d369..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barriers_increase
-#define _TEST__F_thread__thread_barriers_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barriers_increase()
- */
-extern void test__f_thread_barriers_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_barriers_increase()
- */
-extern void test__f_thread_barriers_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barriers_increase()
- */
-extern void test__f_thread_barriers_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_barriers_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-barriers_increase_by.c
deleted file mode 100644 (file)
index 478e3dc..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barriers_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barriers_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_barriers_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_barriers_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_barriers_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_barriers_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-barriers_increase_by.h
deleted file mode 100644 (file)
index a81cd8b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barriers_increase_by
-#define _TEST__F_thread__thread_barriers_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barriers_increase_by()
- */
-extern void test__f_thread_barriers_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_barriers_increase_by()
- */
-extern void test__f_thread_barriers_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barriers_increase_by()
- */
-extern void test__f_thread_barriers_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_barriers_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_resize.c b/level_0/f_thread/tests/unit/c/test-thread-barriers_resize.c
deleted file mode 100644 (file)
index 1c617e2..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-barriers_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_barriers_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_barriers_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_barriers_t data = f_thread_barriers_t_initialize;
-
-  {
-    const f_status_t status = f_thread_barriers_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_resize.h b/level_0/f_thread/tests/unit/c/test-thread-barriers_resize.h
deleted file mode 100644 (file)
index 17e277b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_barriers_resize
-#define _TEST__F_thread__thread_barriers_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_barriers_resize()
- */
-extern void test__f_thread_barriers_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_barriers_resize()
- */
-extern void test__f_thread_barriers_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_barriers_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-barriers_resize_callback.c
new file mode 100644 (file)
index 0000000..1bb278a
--- /dev/null
@@ -0,0 +1,56 @@
+#include "test-thread.h"
+#include "test-thread-barriers_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_barriers_resize_callback__fails(void **state) {
+
+  f_thread_barrier_t data = f_thread_barrier_t_initialize;
+  f_thread_barrier_t data_array[] = { data };
+  f_thread_barriers_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_barriers_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+    will_return(__wrap_pthread_barrier_destroy, true);
+    will_return(__wrap_pthread_barrier_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_barriers_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_barriers_resize_callback__works(void **state) {
+
+  f_thread_barrier_t data = f_thread_barrier_t_initialize;
+  f_thread_barrier_t data_array[] = { data };
+  f_thread_barriers_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_barriers_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_barrier_destroy, false);
+
+    const f_status_t status = f_thread_barriers_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-barriers_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-barriers_resize_callback.h
new file mode 100644 (file)
index 0000000..3f62b4b
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__barriers_resize_callback
+#define _TEST__F_thread__barriers_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_barriers_resize_callback_()
+ */
+extern void test__f_thread_barriers_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_barriers_resize_callback_()
+ */
+extern void test__f_thread_barriers_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__barriers_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust.c
deleted file mode 100644 (file)
index 5751d5c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-condition_attributes_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_condition_attributes_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_condition_attributes_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust.h
deleted file mode 100644 (file)
index 9f1fc47..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_condition_attributes_adjust
-#define _TEST__F_thread__thread_condition_attributes_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_condition_attributes_adjust()
- */
-extern void test__f_thread_condition_attributes_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_condition_attributes_adjust()
- */
-extern void test__f_thread_condition_attributes_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_condition_attributes_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust_callback.c
new file mode 100644 (file)
index 0000000..f7c00d5
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-condition_attributes_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_condition_attributes_adjust_callback__fails(void **state) {
+
+  f_thread_condition_attribute_t data = f_thread_condition_attribute_t_initialize;
+  f_thread_condition_attribute_t data_array[] = { data };
+  f_thread_condition_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_condition_attributes_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_condattr_destroy, true);
+    will_return(__wrap_pthread_condattr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_condition_attributes_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_condition_attributes_adjust_callback__works(void **state) {
+
+  f_thread_condition_attribute_t data = f_thread_condition_attribute_t_initialize;
+  f_thread_condition_attribute_t data_array[] = { data };
+  f_thread_condition_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_condition_attributes_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_condattr_destroy, false);
+
+    const f_status_t status = f_thread_condition_attributes_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_adjust_callback.h
new file mode 100644 (file)
index 0000000..181edfb
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__condition_attributes_adjust_callback
+#define _TEST__F_thread__condition_attributes_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_condition_attributes_adjust_callback_()
+ */
+extern void test__f_thread_condition_attributes_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_condition_attributes_adjust_callback_()
+ */
+extern void test__f_thread_condition_attributes_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__condition_attributes_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decimate_by.c
deleted file mode 100644 (file)
index 114c55e..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-condition_attributes_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_condition_attributes_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_condition_attributes_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_condition_attributes_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_condition_attributes_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_condattr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_condition_attributes_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decimate_by.h
deleted file mode 100644 (file)
index 93fcf5a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_condition_attributes_decimate_by
-#define _TEST__F_thread__thread_condition_attributes_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_condition_attributes_decimate_by()
- */
-extern void test__f_thread_condition_attributes_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_condition_attributes_decimate_by()
- */
-extern void test__f_thread_condition_attributes_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_condition_attributes_decimate_by()
- */
-extern void test__f_thread_condition_attributes_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_condition_attributes_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decrease_by.c
deleted file mode 100644 (file)
index d6efaf1..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-condition_attributes_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_condition_attributes_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_condition_attributes_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_condition_attributes_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_condition_attributes_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_condattr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_condition_attributes_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_decrease_by.h
deleted file mode 100644 (file)
index bd8fcff..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_condition_attributes_decrease_by
-#define _TEST__F_thread__thread_condition_attributes_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_condition_attributes_decrease_by()
- */
-extern void test__f_thread_condition_attributes_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_condition_attributes_decrease_by()
- */
-extern void test__f_thread_condition_attributes_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_condition_attributes_decrease_by()
- */
-extern void test__f_thread_condition_attributes_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_condition_attributes_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase.c b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase.c
deleted file mode 100644 (file)
index 6ab17e6..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-condition_attributes_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_condition_attributes_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_condition_attributes_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_condition_attributes_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_condition_attributes_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_condition_attributes_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase.h b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase.h
deleted file mode 100644 (file)
index ee0c022..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_condition_attributes_increase
-#define _TEST__F_thread__thread_condition_attributes_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_condition_attributes_increase()
- */
-extern void test__f_thread_condition_attributes_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_condition_attributes_increase()
- */
-extern void test__f_thread_condition_attributes_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_condition_attributes_increase()
- */
-extern void test__f_thread_condition_attributes_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_condition_attributes_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase_by.c
deleted file mode 100644 (file)
index 10f3398..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-condition_attributes_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_condition_attributes_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_condition_attributes_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_condition_attributes_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_condition_attributes_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_condition_attributes_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_increase_by.h
deleted file mode 100644 (file)
index 04778dc..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_condition_attributes_increase_by
-#define _TEST__F_thread__thread_condition_attributes_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_condition_attributes_increase_by()
- */
-extern void test__f_thread_condition_attributes_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_condition_attributes_increase_by()
- */
-extern void test__f_thread_condition_attributes_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_condition_attributes_increase_by()
- */
-extern void test__f_thread_condition_attributes_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_condition_attributes_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize.c b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize.c
deleted file mode 100644 (file)
index 3bfd003..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-condition_attributes_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_condition_attributes_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_condition_attributes_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_condition_attributes_t data = f_thread_condition_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_condition_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize.h b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize.h
deleted file mode 100644 (file)
index a39c5de..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_condition_attributes_resize
-#define _TEST__F_thread__thread_condition_attributes_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_condition_attributes_resize()
- */
-extern void test__f_thread_condition_attributes_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_condition_attributes_resize()
- */
-extern void test__f_thread_condition_attributes_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_condition_attributes_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize_callback.c
new file mode 100644 (file)
index 0000000..87e174c
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-condition_attributes_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_condition_attributes_resize_callback__fails(void **state) {
+
+  f_thread_condition_attribute_t data = f_thread_condition_attribute_t_initialize;
+  f_thread_condition_attribute_t data_array[] = { data };
+  f_thread_condition_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_condition_attributes_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_condattr_destroy, true);
+    will_return(__wrap_pthread_condattr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_condition_attributes_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_condition_attributes_resize_callback__works(void **state) {
+
+  f_thread_condition_attribute_t data = f_thread_condition_attribute_t_initialize;
+  f_thread_condition_attribute_t data_array[] = { data };
+  f_thread_condition_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_condition_attributes_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_condattr_destroy, false);
+
+    const f_status_t status = f_thread_condition_attributes_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-condition_attributes_resize_callback.h
new file mode 100644 (file)
index 0000000..dd63a80
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__condition_attributes_resize_callback
+#define _TEST__F_thread__condition_attributes_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_condition_attributes_resize_callback_()
+ */
+extern void test__f_thread_condition_attributes_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_condition_attributes_resize_callback_()
+ */
+extern void test__f_thread_condition_attributes_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__condition_attributes_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-conditions_adjust.c
deleted file mode 100644 (file)
index 69f85a3..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-conditions_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_conditions_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_conditions_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-conditions_adjust.h
deleted file mode 100644 (file)
index 206fe19..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_conditions_adjust
-#define _TEST__F_thread__thread_conditions_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_conditions_adjust()
- */
-extern void test__f_thread_conditions_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_conditions_adjust()
- */
-extern void test__f_thread_conditions_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_conditions_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-conditions_adjust_callback.c
new file mode 100644 (file)
index 0000000..9876422
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-conditions_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_conditions_adjust_callback__fails(void **state) {
+
+  f_thread_condition_t data = f_thread_condition_t_initialize;
+  f_thread_condition_t data_array[] = { data };
+  f_thread_conditions_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_conditions_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_cond_destroy, true);
+    will_return(__wrap_pthread_cond_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_conditions_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_conditions_adjust_callback__works(void **state) {
+
+  f_thread_condition_t data = f_thread_condition_t_initialize;
+  f_thread_condition_t data_array[] = { data };
+  f_thread_conditions_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_conditions_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_cond_destroy, false);
+
+    const f_status_t status = f_thread_conditions_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-conditions_adjust_callback.h
new file mode 100644 (file)
index 0000000..dfa578e
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__conditions_adjust_callback
+#define _TEST__F_thread__conditions_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_conditions_adjust_callback_()
+ */
+extern void test__f_thread_conditions_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_conditions_adjust_callback_()
+ */
+extern void test__f_thread_conditions_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__conditions_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-conditions_decimate_by.c
deleted file mode 100644 (file)
index 3b16379..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-conditions_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_conditions_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_conditions_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_conditions_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_conditions_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_cond_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_conditions_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-conditions_decimate_by.h
deleted file mode 100644 (file)
index 95c4e7f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_conditions_decimate_by
-#define _TEST__F_thread__thread_conditions_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_conditions_decimate_by()
- */
-extern void test__f_thread_conditions_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_conditions_decimate_by()
- */
-extern void test__f_thread_conditions_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_conditions_decimate_by()
- */
-extern void test__f_thread_conditions_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_conditions_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-conditions_decrease_by.c
deleted file mode 100644 (file)
index dca2d1d..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-conditions_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_conditions_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_conditions_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_conditions_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_conditions_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_cond_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_conditions_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-conditions_decrease_by.h
deleted file mode 100644 (file)
index 51a98cb..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_conditions_decrease_by
-#define _TEST__F_thread__thread_conditions_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_conditions_decrease_by()
- */
-extern void test__f_thread_conditions_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_conditions_decrease_by()
- */
-extern void test__f_thread_conditions_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_conditions_decrease_by()
- */
-extern void test__f_thread_conditions_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_conditions_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_increase.c b/level_0/f_thread/tests/unit/c/test-thread-conditions_increase.c
deleted file mode 100644 (file)
index 640b590..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-conditions_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_conditions_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_conditions_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_conditions_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_conditions_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_conditions_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_increase.h b/level_0/f_thread/tests/unit/c/test-thread-conditions_increase.h
deleted file mode 100644 (file)
index 540a223..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_conditions_increase
-#define _TEST__F_thread__thread_conditions_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_conditions_increase()
- */
-extern void test__f_thread_conditions_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_conditions_increase()
- */
-extern void test__f_thread_conditions_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_conditions_increase()
- */
-extern void test__f_thread_conditions_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_conditions_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-conditions_increase_by.c
deleted file mode 100644 (file)
index 1b7772e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-conditions_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_conditions_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_conditions_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_conditions_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_conditions_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_conditions_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-conditions_increase_by.h
deleted file mode 100644 (file)
index 681e467..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_conditions_increase_by
-#define _TEST__F_thread__thread_conditions_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_conditions_increase_by()
- */
-extern void test__f_thread_conditions_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_conditions_increase_by()
- */
-extern void test__f_thread_conditions_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_conditions_increase_by()
- */
-extern void test__f_thread_conditions_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_conditions_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_resize.c b/level_0/f_thread/tests/unit/c/test-thread-conditions_resize.c
deleted file mode 100644 (file)
index b630119..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-conditions_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_conditions_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_conditions_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_conditions_t data = f_thread_conditions_t_initialize;
-
-  {
-    const f_status_t status = f_thread_conditions_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_resize.h b/level_0/f_thread/tests/unit/c/test-thread-conditions_resize.h
deleted file mode 100644 (file)
index 786e9cf..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_conditions_resize
-#define _TEST__F_thread__thread_conditions_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_conditions_resize()
- */
-extern void test__f_thread_conditions_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_conditions_resize()
- */
-extern void test__f_thread_conditions_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_conditions_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-conditions_resize_callback.c
new file mode 100644 (file)
index 0000000..ad6d92f
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-conditions_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_conditions_resize_callback__fails(void **state) {
+
+  f_thread_condition_t data = f_thread_condition_t_initialize;
+  f_thread_condition_t data_array[] = { data };
+  f_thread_conditions_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_conditions_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_cond_destroy, true);
+    will_return(__wrap_pthread_cond_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_conditions_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_conditions_resize_callback__works(void **state) {
+
+  f_thread_condition_t data = f_thread_condition_t_initialize;
+  f_thread_condition_t data_array[] = { data };
+  f_thread_conditions_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_conditions_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_cond_destroy, false);
+
+    const f_status_t status = f_thread_conditions_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-conditions_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-conditions_resize_callback.h
new file mode 100644 (file)
index 0000000..61b23fa
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__conditions_resize_callback
+#define _TEST__F_thread__conditions_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_conditions_resize_callback_()
+ */
+extern void test__f_thread_conditions_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_conditions_resize_callback_()
+ */
+extern void test__f_thread_conditions_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__conditions_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-ids_adjust.c
deleted file mode 100644 (file)
index 2ce2fc3..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-ids_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_ids_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_ids_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-ids_adjust.h
deleted file mode 100644 (file)
index 43a593f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_ids_adjust
-#define _TEST__F_thread__thread_ids_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_ids_adjust()
- */
-extern void test__f_thread_ids_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_ids_adjust()
- */
-extern void test__f_thread_ids_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_ids_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-ids_decimate_by.c
deleted file mode 100644 (file)
index d55dfb6..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-ids_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_ids_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_ids_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_ids_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_ids_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_ids_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-ids_decimate_by.h
deleted file mode 100644 (file)
index cc66223..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_ids_decimate_by
-#define _TEST__F_thread__thread_ids_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_ids_decimate_by()
- */
-extern void test__f_thread_ids_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_ids_decimate_by()
- */
-extern void test__f_thread_ids_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_ids_decimate_by()
- */
-extern void test__f_thread_ids_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_ids_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-ids_decrease_by.c
deleted file mode 100644 (file)
index c7d0bf7..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-ids_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_ids_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_ids_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_ids_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_ids_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_ids_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-ids_decrease_by.h
deleted file mode 100644 (file)
index 617e75e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_ids_decrease_by
-#define _TEST__F_thread__thread_ids_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_ids_decrease_by()
- */
-extern void test__f_thread_ids_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_ids_decrease_by()
- */
-extern void test__f_thread_ids_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_ids_decrease_by()
- */
-extern void test__f_thread_ids_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_ids_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_increase.c b/level_0/f_thread/tests/unit/c/test-thread-ids_increase.c
deleted file mode 100644 (file)
index cc6d6eb..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-ids_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_ids_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_ids_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_ids_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_ids_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_ids_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_increase.h b/level_0/f_thread/tests/unit/c/test-thread-ids_increase.h
deleted file mode 100644 (file)
index 5ed6c70..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_ids_increase
-#define _TEST__F_thread__thread_ids_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_ids_increase()
- */
-extern void test__f_thread_ids_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_ids_increase()
- */
-extern void test__f_thread_ids_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_ids_increase()
- */
-extern void test__f_thread_ids_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_ids_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-ids_increase_by.c
deleted file mode 100644 (file)
index 55195d6..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-ids_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_ids_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_ids_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_ids_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_ids_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_ids_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-ids_increase_by.h
deleted file mode 100644 (file)
index 1b253f7..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_ids_increase_by
-#define _TEST__F_thread__thread_ids_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_ids_increase_by()
- */
-extern void test__f_thread_ids_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_ids_increase_by()
- */
-extern void test__f_thread_ids_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_ids_increase_by()
- */
-extern void test__f_thread_ids_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_ids_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_resize.c b/level_0/f_thread/tests/unit/c/test-thread-ids_resize.c
deleted file mode 100644 (file)
index e2f5ccc..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-ids_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_ids_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_ids_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_ids_t data = f_thread_ids_t_initialize;
-
-  {
-    const f_status_t status = f_thread_ids_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-ids_resize.h b/level_0/f_thread/tests/unit/c/test-thread-ids_resize.h
deleted file mode 100644 (file)
index 4843405..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_ids_resize
-#define _TEST__F_thread__thread_ids_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_ids_resize()
- */
-extern void test__f_thread_ids_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_ids_resize()
- */
-extern void test__f_thread_ids_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_ids_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-keys_adjust.c
deleted file mode 100644 (file)
index 5527b06..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-keys_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_keys_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_keys_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-keys_adjust.h
deleted file mode 100644 (file)
index cd3101a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_keys_adjust
-#define _TEST__F_thread__thread_keys_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_keys_adjust()
- */
-extern void test__f_thread_keys_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_keys_adjust()
- */
-extern void test__f_thread_keys_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_keys_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-keys_adjust_callback.c
new file mode 100644 (file)
index 0000000..d84bf35
--- /dev/null
@@ -0,0 +1,54 @@
+#include "test-thread.h"
+#include "test-thread-keys_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_keys_adjust_callback__fails(void **state) {
+
+  f_thread_key_t data = f_thread_key_t_initialize;
+  f_thread_key_t data_array[] = { data };
+  f_thread_keys_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_keys_t datass_array[] = { datas };
+
+  int errnos[] = {
+    1,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_failure),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_pthread_key_delete, errnos[i]);
+
+    const f_status_t status = f_thread_keys_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_keys_adjust_callback__works(void **state) {
+
+  f_thread_key_t data = f_thread_key_t_initialize;
+  f_thread_key_t data_array[] = { data };
+  f_thread_keys_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_keys_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_key_delete, false);
+
+    const f_status_t status = f_thread_keys_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-keys_adjust_callback.h
new file mode 100644 (file)
index 0000000..f9c1984
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__keys_adjust_callback
+#define _TEST__F_thread__keys_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_keys_adjust_callback_()
+ */
+extern void test__f_thread_keys_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_keys_adjust_callback_()
+ */
+extern void test__f_thread_keys_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__keys_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-keys_decimate_by.c
deleted file mode 100644 (file)
index 460f57b..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-keys_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_keys_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_keys_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_keys_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_keys_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_key_delete, F_false);
-    } // for
-
-    const f_status_t status = f_thread_keys_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-keys_decimate_by.h
deleted file mode 100644 (file)
index 28df2d3..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_keys_decimate_by
-#define _TEST__F_thread__thread_keys_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_keys_decimate_by()
- */
-extern void test__f_thread_keys_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_keys_decimate_by()
- */
-extern void test__f_thread_keys_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_keys_decimate_by()
- */
-extern void test__f_thread_keys_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_keys_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-keys_decrease_by.c
deleted file mode 100644 (file)
index 229ce77..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-keys_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_keys_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_keys_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_keys_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_keys_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_key_delete, F_false);
-    } // for
-
-    const f_status_t status = f_thread_keys_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-keys_decrease_by.h
deleted file mode 100644 (file)
index 25548fd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_keys_decrease_by
-#define _TEST__F_thread__thread_keys_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_keys_decrease_by()
- */
-extern void test__f_thread_keys_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_keys_decrease_by()
- */
-extern void test__f_thread_keys_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_keys_decrease_by()
- */
-extern void test__f_thread_keys_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_keys_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_increase.c b/level_0/f_thread/tests/unit/c/test-thread-keys_increase.c
deleted file mode 100644 (file)
index 7a78b0e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-keys_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_keys_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_keys_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_keys_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_keys_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_keys_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_increase.h b/level_0/f_thread/tests/unit/c/test-thread-keys_increase.h
deleted file mode 100644 (file)
index d7242b1..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_keys_increase
-#define _TEST__F_thread__thread_keys_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_keys_increase()
- */
-extern void test__f_thread_keys_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_keys_increase()
- */
-extern void test__f_thread_keys_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_keys_increase()
- */
-extern void test__f_thread_keys_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_keys_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-keys_increase_by.c
deleted file mode 100644 (file)
index 3a4bfcf..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-keys_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_keys_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_keys_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_keys_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_keys_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_keys_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-keys_increase_by.h
deleted file mode 100644 (file)
index 70d7218..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_keys_increase_by
-#define _TEST__F_thread__thread_keys_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_keys_increase_by()
- */
-extern void test__f_thread_keys_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_keys_increase_by()
- */
-extern void test__f_thread_keys_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_keys_increase_by()
- */
-extern void test__f_thread_keys_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_keys_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_resize.c b/level_0/f_thread/tests/unit/c/test-thread-keys_resize.c
deleted file mode 100644 (file)
index a5c290c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-keys_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_keys_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_keys_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_keys_t data = f_thread_keys_t_initialize;
-
-  {
-    const f_status_t status = f_thread_keys_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_resize.h b/level_0/f_thread/tests/unit/c/test-thread-keys_resize.h
deleted file mode 100644 (file)
index ebcbfa0..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_keys_resize
-#define _TEST__F_thread__thread_keys_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_keys_resize()
- */
-extern void test__f_thread_keys_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_keys_resize()
- */
-extern void test__f_thread_keys_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_keys_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-keys_resize_callback.c
new file mode 100644 (file)
index 0000000..6e84644
--- /dev/null
@@ -0,0 +1,54 @@
+#include "test-thread.h"
+#include "test-thread-keys_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_keys_resize_callback__fails(void **state) {
+
+  f_thread_key_t data = f_thread_key_t_initialize;
+  f_thread_key_t data_array[] = { data };
+  f_thread_keys_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_keys_t datass_array[] = { datas };
+
+  int errnos[] = {
+    1,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_failure),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_pthread_key_delete, errnos[i]);
+
+    const f_status_t status = f_thread_keys_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_keys_resize_callback__works(void **state) {
+
+  f_thread_key_t data = f_thread_key_t_initialize;
+  f_thread_key_t data_array[] = { data };
+  f_thread_keys_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_keys_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_key_delete, false);
+
+    const f_status_t status = f_thread_keys_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-keys_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-keys_resize_callback.h
new file mode 100644 (file)
index 0000000..142f33b
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__keys_resize_callback
+#define _TEST__F_thread__keys_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_keys_resize_callback_()
+ */
+extern void test__f_thread_keys_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_keys_resize_callback_()
+ */
+extern void test__f_thread_keys_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__keys_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust.c
deleted file mode 100644 (file)
index 9c93521..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-lock_attributes_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_lock_attributes_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_lock_attributes_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust.h
deleted file mode 100644 (file)
index 935d9f0..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_lock_attributes_adjust
-#define _TEST__F_thread__thread_lock_attributes_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_lock_attributes_adjust()
- */
-extern void test__f_thread_lock_attributes_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_lock_attributes_adjust()
- */
-extern void test__f_thread_lock_attributes_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_lock_attributes_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust_callback.c
new file mode 100644 (file)
index 0000000..83be29a
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-lock_attributes_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_attributes_adjust_callback__fails(void **state) {
+
+  f_thread_lock_attribute_t data = f_thread_lock_attribute_t_initialize;
+  f_thread_lock_attribute_t data_array[] = { data };
+  f_thread_lock_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_lock_attributes_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_rwlockattr_destroy, true);
+    will_return(__wrap_pthread_rwlockattr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_lock_attributes_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_lock_attributes_adjust_callback__works(void **state) {
+
+  f_thread_lock_attribute_t data = f_thread_lock_attribute_t_initialize;
+  f_thread_lock_attribute_t data_array[] = { data };
+  f_thread_lock_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_lock_attributes_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_rwlockattr_destroy, false);
+
+    const f_status_t status = f_thread_lock_attributes_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_adjust_callback.h
new file mode 100644 (file)
index 0000000..40d1b9a
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__lock_attributes_adjust_callback
+#define _TEST__F_thread__lock_attributes_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_lock_attributes_adjust_callback_()
+ */
+extern void test__f_thread_lock_attributes_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_lock_attributes_adjust_callback_()
+ */
+extern void test__f_thread_lock_attributes_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__lock_attributes_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decimate_by.c
deleted file mode 100644 (file)
index 1c5330f..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-lock_attributes_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_lock_attributes_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_lock_attributes_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_lock_attributes_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_lock_attributes_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_rwlockattr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_lock_attributes_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decimate_by.h
deleted file mode 100644 (file)
index d57a4f0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_lock_attributes_decimate_by
-#define _TEST__F_thread__thread_lock_attributes_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_lock_attributes_decimate_by()
- */
-extern void test__f_thread_lock_attributes_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_lock_attributes_decimate_by()
- */
-extern void test__f_thread_lock_attributes_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_lock_attributes_decimate_by()
- */
-extern void test__f_thread_lock_attributes_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_lock_attributes_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decrease_by.c
deleted file mode 100644 (file)
index 0ab8f5a..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-lock_attributes_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_lock_attributes_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_lock_attributes_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_lock_attributes_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_lock_attributes_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_rwlockattr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_lock_attributes_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_decrease_by.h
deleted file mode 100644 (file)
index a5e720e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_lock_attributes_decrease_by
-#define _TEST__F_thread__thread_lock_attributes_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_lock_attributes_decrease_by()
- */
-extern void test__f_thread_lock_attributes_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_lock_attributes_decrease_by()
- */
-extern void test__f_thread_lock_attributes_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_lock_attributes_decrease_by()
- */
-extern void test__f_thread_lock_attributes_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_lock_attributes_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase.c b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase.c
deleted file mode 100644 (file)
index 4600307..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-lock_attributes_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_lock_attributes_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_lock_attributes_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_lock_attributes_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_lock_attributes_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_lock_attributes_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase.h b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase.h
deleted file mode 100644 (file)
index abca646..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_lock_attributes_increase
-#define _TEST__F_thread__thread_lock_attributes_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_lock_attributes_increase()
- */
-extern void test__f_thread_lock_attributes_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_lock_attributes_increase()
- */
-extern void test__f_thread_lock_attributes_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_lock_attributes_increase()
- */
-extern void test__f_thread_lock_attributes_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_lock_attributes_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase_by.c
deleted file mode 100644 (file)
index c217c6f..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-lock_attributes_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_lock_attributes_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_lock_attributes_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_lock_attributes_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_lock_attributes_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_lock_attributes_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_increase_by.h
deleted file mode 100644 (file)
index d58cb61..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_lock_attributes_increase_by
-#define _TEST__F_thread__thread_lock_attributes_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_lock_attributes_increase_by()
- */
-extern void test__f_thread_lock_attributes_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_lock_attributes_increase_by()
- */
-extern void test__f_thread_lock_attributes_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_lock_attributes_increase_by()
- */
-extern void test__f_thread_lock_attributes_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_lock_attributes_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize.c b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize.c
deleted file mode 100644 (file)
index 5f2f839..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-lock_attributes_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_lock_attributes_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_lock_attributes_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_lock_attributes_t data = f_thread_lock_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_lock_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize.h b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize.h
deleted file mode 100644 (file)
index 20df50c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_lock_attributes_resize
-#define _TEST__F_thread__thread_lock_attributes_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_lock_attributes_resize()
- */
-extern void test__f_thread_lock_attributes_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_lock_attributes_resize()
- */
-extern void test__f_thread_lock_attributes_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_lock_attributes_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize_callback.c
new file mode 100644 (file)
index 0000000..37dc6bd
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-lock_attributes_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_attributes_resize_callback__fails(void **state) {
+
+  f_thread_lock_attribute_t data = f_thread_lock_attribute_t_initialize;
+  f_thread_lock_attribute_t data_array[] = { data };
+  f_thread_lock_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_lock_attributes_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_rwlockattr_destroy, true);
+    will_return(__wrap_pthread_rwlockattr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_lock_attributes_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_lock_attributes_resize_callback__works(void **state) {
+
+  f_thread_lock_attribute_t data = f_thread_lock_attribute_t_initialize;
+  f_thread_lock_attribute_t data_array[] = { data };
+  f_thread_lock_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_lock_attributes_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_rwlockattr_destroy, false);
+
+    const f_status_t status = f_thread_lock_attributes_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-lock_attributes_resize_callback.h
new file mode 100644 (file)
index 0000000..5854895
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__lock_attributes_resize_callback
+#define _TEST__F_thread__lock_attributes_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_lock_attributes_resize_callback_()
+ */
+extern void test__f_thread_lock_attributes_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_lock_attributes_resize_callback_()
+ */
+extern void test__f_thread_lock_attributes_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__lock_attributes_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-locks_adjust.c
deleted file mode 100644 (file)
index 3494da4..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-locks_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_locks_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_locks_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-locks_adjust.h
deleted file mode 100644 (file)
index e0590fb..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_locks_adjust
-#define _TEST__F_thread__thread_locks_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_locks_adjust()
- */
-extern void test__f_thread_locks_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_locks_adjust()
- */
-extern void test__f_thread_locks_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_locks_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-locks_adjust_callback.c
new file mode 100644 (file)
index 0000000..ae1d1cc
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-locks_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_locks_adjust_callback__fails(void **state) {
+
+  f_thread_lock_t data = f_thread_lock_t_initialize;
+  f_thread_lock_t data_array[] = { data };
+  f_thread_locks_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_locks_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_rwlock_destroy, true);
+    will_return(__wrap_pthread_rwlock_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_locks_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_locks_adjust_callback__works(void **state) {
+
+  f_thread_lock_t data = f_thread_lock_t_initialize;
+  f_thread_lock_t data_array[] = { data };
+  f_thread_locks_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_locks_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_rwlock_destroy, false);
+
+    const f_status_t status = f_thread_locks_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-locks_adjust_callback.h
new file mode 100644 (file)
index 0000000..d3a3e48
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__locks_adjust_callback
+#define _TEST__F_thread__locks_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_locks_adjust_callback_()
+ */
+extern void test__f_thread_locks_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_locks_adjust_callback_()
+ */
+extern void test__f_thread_locks_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__locks_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-locks_decimate_by.c
deleted file mode 100644 (file)
index 56423a4..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-locks_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_locks_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_locks_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_locks_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_locks_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_rwlock_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_locks_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-locks_decimate_by.h
deleted file mode 100644 (file)
index 66426a8..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_locks_decimate_by
-#define _TEST__F_thread__thread_locks_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_locks_decimate_by()
- */
-extern void test__f_thread_locks_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_locks_decimate_by()
- */
-extern void test__f_thread_locks_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_locks_decimate_by()
- */
-extern void test__f_thread_locks_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_locks_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-locks_decrease_by.c
deleted file mode 100644 (file)
index c64948d..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-locks_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_locks_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_locks_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_locks_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_locks_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_rwlock_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_locks_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-locks_decrease_by.h
deleted file mode 100644 (file)
index 02dfafd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_locks_decrease_by
-#define _TEST__F_thread__thread_locks_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_locks_decrease_by()
- */
-extern void test__f_thread_locks_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_locks_decrease_by()
- */
-extern void test__f_thread_locks_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_locks_decrease_by()
- */
-extern void test__f_thread_locks_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_locks_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_increase.c b/level_0/f_thread/tests/unit/c/test-thread-locks_increase.c
deleted file mode 100644 (file)
index 9863205..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-locks_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_locks_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_locks_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_locks_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_locks_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_locks_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_increase.h b/level_0/f_thread/tests/unit/c/test-thread-locks_increase.h
deleted file mode 100644 (file)
index e1692c4..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_locks_increase
-#define _TEST__F_thread__thread_locks_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_locks_increase()
- */
-extern void test__f_thread_locks_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_locks_increase()
- */
-extern void test__f_thread_locks_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_locks_increase()
- */
-extern void test__f_thread_locks_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_locks_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-locks_increase_by.c
deleted file mode 100644 (file)
index 29d428a..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-locks_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_locks_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_locks_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_locks_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_locks_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_locks_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-locks_increase_by.h
deleted file mode 100644 (file)
index a14772f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_locks_increase_by
-#define _TEST__F_thread__thread_locks_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_locks_increase_by()
- */
-extern void test__f_thread_locks_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_locks_increase_by()
- */
-extern void test__f_thread_locks_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_locks_increase_by()
- */
-extern void test__f_thread_locks_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_locks_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_resize.c b/level_0/f_thread/tests/unit/c/test-thread-locks_resize.c
deleted file mode 100644 (file)
index 195dfdd..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-locks_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_locks_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_locks_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_locks_t data = f_thread_locks_t_initialize;
-
-  {
-    const f_status_t status = f_thread_locks_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_resize.h b/level_0/f_thread/tests/unit/c/test-thread-locks_resize.h
deleted file mode 100644 (file)
index aebb72b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_locks_resize
-#define _TEST__F_thread__thread_locks_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_locks_resize()
- */
-extern void test__f_thread_locks_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_locks_resize()
- */
-extern void test__f_thread_locks_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_locks_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-locks_resize_callback.c
new file mode 100644 (file)
index 0000000..a036c91
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-locks_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_locks_resize_callback__fails(void **state) {
+
+  f_thread_lock_t data = f_thread_lock_t_initialize;
+  f_thread_lock_t data_array[] = { data };
+  f_thread_locks_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_locks_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_rwlock_destroy, true);
+    will_return(__wrap_pthread_rwlock_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_locks_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_locks_resize_callback__works(void **state) {
+
+  f_thread_lock_t data = f_thread_lock_t_initialize;
+  f_thread_lock_t data_array[] = { data };
+  f_thread_locks_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_locks_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_rwlock_destroy, false);
+
+    const f_status_t status = f_thread_locks_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-locks_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-locks_resize_callback.h
new file mode 100644 (file)
index 0000000..bd5bd5f
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__locks_resize_callback
+#define _TEST__F_thread__locks_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_locks_resize_callback_()
+ */
+extern void test__f_thread_locks_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_locks_resize_callback_()
+ */
+extern void test__f_thread_locks_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__locks_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust.c
deleted file mode 100644 (file)
index 6cf1b7e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutex_attributes_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutex_attributes_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_mutex_attributes_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust.h
deleted file mode 100644 (file)
index baae21c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutex_attributes_adjust
-#define _TEST__F_thread__thread_mutex_attributes_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutex_attributes_adjust()
- */
-extern void test__f_thread_mutex_attributes_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutex_attributes_adjust()
- */
-extern void test__f_thread_mutex_attributes_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutex_attributes_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust_callback.c
new file mode 100644 (file)
index 0000000..8600d9b
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-mutex_attributes_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attributes_adjust_callback__fails(void **state) {
+
+  f_thread_mutex_attribute_t data = f_thread_mutex_attribute_t_initialize;
+  f_thread_mutex_attribute_t data_array[] = { data };
+  f_thread_mutex_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_mutex_attributes_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_mutexattr_destroy, true);
+    will_return(__wrap_pthread_mutexattr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_mutex_attributes_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_mutex_attributes_adjust_callback__works(void **state) {
+
+  f_thread_mutex_attribute_t data = f_thread_mutex_attribute_t_initialize;
+  f_thread_mutex_attribute_t data_array[] = { data };
+  f_thread_mutex_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_mutex_attributes_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_mutexattr_destroy, false);
+
+    const f_status_t status = f_thread_mutex_attributes_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_adjust_callback.h
new file mode 100644 (file)
index 0000000..d9f9a2d
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__mutex_attributes_adjust_callback
+#define _TEST__F_thread__mutex_attributes_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_mutex_attributes_adjust_callback_()
+ */
+extern void test__f_thread_mutex_attributes_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_mutex_attributes_adjust_callback_()
+ */
+extern void test__f_thread_mutex_attributes_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attributes_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decimate_by.c
deleted file mode 100644 (file)
index 5e5fe16..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutex_attributes_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutex_attributes_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_mutex_attributes_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_mutex_attributes_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_mutexattr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_mutex_attributes_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decimate_by.h
deleted file mode 100644 (file)
index 1e2fda3..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutex_attributes_decimate_by
-#define _TEST__F_thread__thread_mutex_attributes_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutex_attributes_decimate_by()
- */
-extern void test__f_thread_mutex_attributes_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_mutex_attributes_decimate_by()
- */
-extern void test__f_thread_mutex_attributes_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutex_attributes_decimate_by()
- */
-extern void test__f_thread_mutex_attributes_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutex_attributes_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decrease_by.c
deleted file mode 100644 (file)
index 7289522..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutex_attributes_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutex_attributes_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_mutex_attributes_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_mutex_attributes_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_mutexattr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_mutex_attributes_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_decrease_by.h
deleted file mode 100644 (file)
index d5eb3bd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutex_attributes_decrease_by
-#define _TEST__F_thread__thread_mutex_attributes_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutex_attributes_decrease_by()
- */
-extern void test__f_thread_mutex_attributes_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_mutex_attributes_decrease_by()
- */
-extern void test__f_thread_mutex_attributes_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutex_attributes_decrease_by()
- */
-extern void test__f_thread_mutex_attributes_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutex_attributes_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase.c b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase.c
deleted file mode 100644 (file)
index daac9e5..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutex_attributes_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutex_attributes_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_mutex_attributes_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_mutex_attributes_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_mutex_attributes_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase.h b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase.h
deleted file mode 100644 (file)
index e557d6c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutex_attributes_increase
-#define _TEST__F_thread__thread_mutex_attributes_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutex_attributes_increase()
- */
-extern void test__f_thread_mutex_attributes_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_mutex_attributes_increase()
- */
-extern void test__f_thread_mutex_attributes_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutex_attributes_increase()
- */
-extern void test__f_thread_mutex_attributes_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutex_attributes_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase_by.c
deleted file mode 100644 (file)
index 3e7725e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutex_attributes_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutex_attributes_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_mutex_attributes_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_mutex_attributes_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_mutex_attributes_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_increase_by.h
deleted file mode 100644 (file)
index 72f5c5c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutex_attributes_increase_by
-#define _TEST__F_thread__thread_mutex_attributes_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutex_attributes_increase_by()
- */
-extern void test__f_thread_mutex_attributes_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_mutex_attributes_increase_by()
- */
-extern void test__f_thread_mutex_attributes_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutex_attributes_increase_by()
- */
-extern void test__f_thread_mutex_attributes_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutex_attributes_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize.c b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize.c
deleted file mode 100644 (file)
index 4d0fc65..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutex_attributes_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutex_attributes_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_mutex_attributes_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutex_attributes_t data = f_thread_mutex_attributes_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutex_attributes_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize.h b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize.h
deleted file mode 100644 (file)
index 84d297c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutex_attributes_resize
-#define _TEST__F_thread__thread_mutex_attributes_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutex_attributes_resize()
- */
-extern void test__f_thread_mutex_attributes_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutex_attributes_resize()
- */
-extern void test__f_thread_mutex_attributes_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutex_attributes_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize_callback.c
new file mode 100644 (file)
index 0000000..4fe73e8
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-mutex_attributes_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attributes_resize_callback__fails(void **state) {
+
+  f_thread_mutex_attribute_t data = f_thread_mutex_attribute_t_initialize;
+  f_thread_mutex_attribute_t data_array[] = { data };
+  f_thread_mutex_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_mutex_attributes_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_mutexattr_destroy, true);
+    will_return(__wrap_pthread_mutexattr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_mutex_attributes_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_mutex_attributes_resize_callback__works(void **state) {
+
+  f_thread_mutex_attribute_t data = f_thread_mutex_attribute_t_initialize;
+  f_thread_mutex_attribute_t data_array[] = { data };
+  f_thread_mutex_attributes_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_mutex_attributes_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_mutexattr_destroy, false);
+
+    const f_status_t status = f_thread_mutex_attributes_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-mutex_attributes_resize_callback.h
new file mode 100644 (file)
index 0000000..ac25fd1
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__mutex_attributes_resize_callback
+#define _TEST__F_thread__mutex_attributes_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_mutex_attributes_resize_callback_()
+ */
+extern void test__f_thread_mutex_attributes_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_mutex_attributes_resize_callback_()
+ */
+extern void test__f_thread_mutex_attributes_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attributes_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust.c
deleted file mode 100644 (file)
index 5b8d6e6..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutexs_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutexs_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_mutexs_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust.h
deleted file mode 100644 (file)
index 674947f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutexs_adjust
-#define _TEST__F_thread__thread_mutexs_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutexs_adjust()
- */
-extern void test__f_thread_mutexs_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutexs_adjust()
- */
-extern void test__f_thread_mutexs_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutexs_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust_callback.c
new file mode 100644 (file)
index 0000000..4513def
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-mutexs_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutexs_adjust_callback__fails(void **state) {
+
+  f_thread_mutex_t data = f_thread_mutex_t_initialize;
+  f_thread_mutex_t data_array[] = { data };
+  f_thread_mutexs_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_mutexs_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_mutex_destroy, true);
+    will_return(__wrap_pthread_mutex_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_mutexs_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_mutexs_adjust_callback__works(void **state) {
+
+  f_thread_mutex_t data = f_thread_mutex_t_initialize;
+  f_thread_mutex_t data_array[] = { data };
+  f_thread_mutexs_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_mutexs_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_mutex_destroy, false);
+
+    const f_status_t status = f_thread_mutexs_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-mutexs_adjust_callback.h
new file mode 100644 (file)
index 0000000..fcd4c45
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__mutexs_adjust_callback
+#define _TEST__F_thread__mutexs_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_mutexs_adjust_callback_()
+ */
+extern void test__f_thread_mutexs_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_mutexs_adjust_callback_()
+ */
+extern void test__f_thread_mutexs_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__mutexs_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-mutexs_decimate_by.c
deleted file mode 100644 (file)
index 8026da5..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutexs_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutexs_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_mutexs_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_mutexs_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_mutexs_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_mutex_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_mutexs_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-mutexs_decimate_by.h
deleted file mode 100644 (file)
index 47ccbf9..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutexs_decimate_by
-#define _TEST__F_thread__thread_mutexs_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutexs_decimate_by()
- */
-extern void test__f_thread_mutexs_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_mutexs_decimate_by()
- */
-extern void test__f_thread_mutexs_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutexs_decimate_by()
- */
-extern void test__f_thread_mutexs_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutexs_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-mutexs_decrease_by.c
deleted file mode 100644 (file)
index 3a73069..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutexs_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutexs_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_mutexs_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_mutexs_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_mutexs_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_mutex_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_mutexs_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-mutexs_decrease_by.h
deleted file mode 100644 (file)
index 7551f86..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutexs_decrease_by
-#define _TEST__F_thread__thread_mutexs_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutexs_decrease_by()
- */
-extern void test__f_thread_mutexs_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_mutexs_decrease_by()
- */
-extern void test__f_thread_mutexs_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutexs_decrease_by()
- */
-extern void test__f_thread_mutexs_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutexs_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_increase.c b/level_0/f_thread/tests/unit/c/test-thread-mutexs_increase.c
deleted file mode 100644 (file)
index af1186e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutexs_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutexs_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_mutexs_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_mutexs_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_mutexs_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_mutexs_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_increase.h b/level_0/f_thread/tests/unit/c/test-thread-mutexs_increase.h
deleted file mode 100644 (file)
index fe7dc0a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutexs_increase
-#define _TEST__F_thread__thread_mutexs_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutexs_increase()
- */
-extern void test__f_thread_mutexs_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_mutexs_increase()
- */
-extern void test__f_thread_mutexs_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutexs_increase()
- */
-extern void test__f_thread_mutexs_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutexs_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-mutexs_increase_by.c
deleted file mode 100644 (file)
index d5f41d8..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutexs_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutexs_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_mutexs_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_mutexs_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_mutexs_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_mutexs_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-mutexs_increase_by.h
deleted file mode 100644 (file)
index ea7ad30..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutexs_increase_by
-#define _TEST__F_thread__thread_mutexs_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutexs_increase_by()
- */
-extern void test__f_thread_mutexs_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_mutexs_increase_by()
- */
-extern void test__f_thread_mutexs_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutexs_increase_by()
- */
-extern void test__f_thread_mutexs_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutexs_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_resize.c b/level_0/f_thread/tests/unit/c/test-thread-mutexs_resize.c
deleted file mode 100644 (file)
index 1b98c29..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-mutexs_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_mutexs_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_mutexs_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_mutexs_t data = f_thread_mutexs_t_initialize;
-
-  {
-    const f_status_t status = f_thread_mutexs_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_resize.h b/level_0/f_thread/tests/unit/c/test-thread-mutexs_resize.h
deleted file mode 100644 (file)
index d2634aa..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_mutexs_resize
-#define _TEST__F_thread__thread_mutexs_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_mutexs_resize()
- */
-extern void test__f_thread_mutexs_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_mutexs_resize()
- */
-extern void test__f_thread_mutexs_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_mutexs_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-mutexs_resize_callback.c
new file mode 100644 (file)
index 0000000..5cf9357
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-mutexs_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutexs_resize_callback__fails(void **state) {
+
+  f_thread_mutex_t data = f_thread_mutex_t_initialize;
+  f_thread_mutex_t data_array[] = { data };
+  f_thread_mutexs_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_mutexs_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_mutex_destroy, true);
+    will_return(__wrap_pthread_mutex_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_mutexs_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_mutexs_resize_callback__works(void **state) {
+
+  f_thread_mutex_t data = f_thread_mutex_t_initialize;
+  f_thread_mutex_t data_array[] = { data };
+  f_thread_mutexs_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_mutexs_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_mutex_destroy, false);
+
+    const f_status_t status = f_thread_mutexs_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-mutexs_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-mutexs_resize_callback.h
new file mode 100644 (file)
index 0000000..7a1bb26
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__mutexs_resize_callback
+#define _TEST__F_thread__mutexs_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_mutexs_resize_callback_()
+ */
+extern void test__f_thread_mutexs_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_mutexs_resize_callback_()
+ */
+extern void test__f_thread_mutexs_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__mutexs_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-onces_adjust.c
deleted file mode 100644 (file)
index 7635ddd..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-onces_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_onces_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_onces_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-onces_adjust.h
deleted file mode 100644 (file)
index 0538d8c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_onces_adjust
-#define _TEST__F_thread__thread_onces_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_onces_adjust()
- */
-extern void test__f_thread_onces_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_onces_adjust()
- */
-extern void test__f_thread_onces_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_onces_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-onces_adjust_callback.c
new file mode 100644 (file)
index 0000000..10e99da
--- /dev/null
@@ -0,0 +1,55 @@
+#include "test-thread.h"
+#include "test-thread-onces_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_onces_adjust_callback__fails(void **state) {
+
+  f_thread_once_t data = f_thread_once_t_initialize;
+  f_thread_once_t data_array[] = { data };
+  f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_onces_t datass_array[] = { datas };
+
+  int errnos[] = {
+    1,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_failure),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_pthread_attr_destroy, true);
+    will_return(__wrap_pthread_attr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_onces_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_onces_adjust_callback__works(void **state) {
+
+  f_thread_once_t data = f_thread_once_t_initialize;
+  f_thread_once_t data_array[] = { data };
+  f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_onces_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_attr_destroy, false);
+
+    const f_status_t status = f_thread_onces_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-onces_adjust_callback.h
new file mode 100644 (file)
index 0000000..fe51cd7
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__onces_adjust_callback
+#define _TEST__F_thread__onces_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_onces_adjust_callback_()
+ */
+extern void test__f_thread_onces_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_onces_adjust_callback_()
+ */
+extern void test__f_thread_onces_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__onces_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-onces_decimate_by.c
deleted file mode 100644 (file)
index 3b8bae4..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-onces_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_onces_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_onces_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_onces_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_onces_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_onces_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-onces_decimate_by.h
deleted file mode 100644 (file)
index 54c3f04..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_onces_decimate_by
-#define _TEST__F_thread__thread_onces_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_onces_decimate_by()
- */
-extern void test__f_thread_onces_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_onces_decimate_by()
- */
-extern void test__f_thread_onces_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_onces_decimate_by()
- */
-extern void test__f_thread_onces_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_onces_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-onces_decrease_by.c
deleted file mode 100644 (file)
index 4af8293..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-onces_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_onces_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_onces_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_onces_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_onces_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_onces_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-onces_decrease_by.h
deleted file mode 100644 (file)
index 045607b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_onces_decrease_by
-#define _TEST__F_thread__thread_onces_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_onces_decrease_by()
- */
-extern void test__f_thread_onces_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_onces_decrease_by()
- */
-extern void test__f_thread_onces_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_onces_decrease_by()
- */
-extern void test__f_thread_onces_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_onces_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_increase.c b/level_0/f_thread/tests/unit/c/test-thread-onces_increase.c
deleted file mode 100644 (file)
index e527b0e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-onces_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_onces_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_onces_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_onces_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_onces_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_onces_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_increase.h b/level_0/f_thread/tests/unit/c/test-thread-onces_increase.h
deleted file mode 100644 (file)
index e37b16f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_onces_increase
-#define _TEST__F_thread__thread_onces_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_onces_increase()
- */
-extern void test__f_thread_onces_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_onces_increase()
- */
-extern void test__f_thread_onces_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_onces_increase()
- */
-extern void test__f_thread_onces_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_onces_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-onces_increase_by.c
deleted file mode 100644 (file)
index 7cc6803..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-onces_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_onces_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_onces_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_onces_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_onces_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_onces_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-onces_increase_by.h
deleted file mode 100644 (file)
index 478527a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_onces_increase_by
-#define _TEST__F_thread__thread_onces_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_onces_increase_by()
- */
-extern void test__f_thread_onces_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_onces_increase_by()
- */
-extern void test__f_thread_onces_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_onces_increase_by()
- */
-extern void test__f_thread_onces_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_onces_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_resize.c b/level_0/f_thread/tests/unit/c/test-thread-onces_resize.c
deleted file mode 100644 (file)
index 1f7a4d6..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-onces_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_onces_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_onces_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_onces_t data = f_thread_onces_t_initialize;
-
-  {
-    const f_status_t status = f_thread_onces_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_resize.h b/level_0/f_thread/tests/unit/c/test-thread-onces_resize.h
deleted file mode 100644 (file)
index 8a56330..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_onces_resize
-#define _TEST__F_thread__thread_onces_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_onces_resize()
- */
-extern void test__f_thread_onces_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_onces_resize()
- */
-extern void test__f_thread_onces_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_onces_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-onces_resize_callback.c
new file mode 100644 (file)
index 0000000..d2fea77
--- /dev/null
@@ -0,0 +1,55 @@
+#include "test-thread.h"
+#include "test-thread-onces_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_onces_resize_callback__fails(void **state) {
+
+  f_thread_once_t data = f_thread_once_t_initialize;
+  f_thread_once_t data_array[] = { data };
+  f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_onces_t datass_array[] = { datas };
+
+  int errnos[] = {
+    1,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_failure),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_pthread_attr_destroy, true);
+    will_return(__wrap_pthread_attr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_onces_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_onces_resize_callback__works(void **state) {
+
+  f_thread_once_t data = f_thread_once_t_initialize;
+  f_thread_once_t data_array[] = { data };
+  f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_onces_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_attr_destroy, false);
+
+    const f_status_t status = f_thread_onces_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-onces_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-onces_resize_callback.h
new file mode 100644 (file)
index 0000000..a9f7b3b
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__onces_resize_callback
+#define _TEST__F_thread__onces_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_onces_resize_callback_()
+ */
+extern void test__f_thread_onces_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_onces_resize_callback_()
+ */
+extern void test__f_thread_onces_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__onces_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust.c
deleted file mode 100644 (file)
index d848ddb..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-semaphores_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_semaphores_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_semaphores_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust.h
deleted file mode 100644 (file)
index 7292d62..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_semaphores_adjust
-#define _TEST__F_thread__thread_semaphores_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_semaphores_adjust()
- */
-extern void test__f_thread_semaphores_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_semaphores_adjust()
- */
-extern void test__f_thread_semaphores_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_semaphores_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust_callback.c
new file mode 100644 (file)
index 0000000..edbd177
--- /dev/null
@@ -0,0 +1,55 @@
+#include "test-thread.h"
+#include "test-thread-semaphores_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_semaphores_adjust_callback__fails(void **state) {
+
+  f_thread_semaphore_t data = f_thread_semaphore_t_initialize;
+  f_thread_semaphore_t data_array[] = { data };
+  f_thread_semaphores_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_semaphores_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_sem_destroy, true);
+    will_return(__wrap_sem_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_semaphores_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_semaphores_adjust_callback__works(void **state) {
+
+  f_thread_semaphore_t data = f_thread_semaphore_t_initialize;
+  f_thread_semaphore_t data_array[] = { data };
+  f_thread_semaphores_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_semaphores_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_sem_destroy, false);
+
+    const f_status_t status = f_thread_semaphores_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-semaphores_adjust_callback.h
new file mode 100644 (file)
index 0000000..063653b
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__semaphores_adjust_callback
+#define _TEST__F_thread__semaphores_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_semaphores_adjust_callback_()
+ */
+extern void test__f_thread_semaphores_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_semaphores_adjust_callback_()
+ */
+extern void test__f_thread_semaphores_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__semaphores_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-semaphores_decimate_by.c
deleted file mode 100644 (file)
index 1c1cba4..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-semaphores_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_semaphores_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_semaphores_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_semaphores_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_semaphores_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_sem_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_semaphores_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-semaphores_decimate_by.h
deleted file mode 100644 (file)
index 41a9791..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_semaphores_decimate_by
-#define _TEST__F_thread__thread_semaphores_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_semaphores_decimate_by()
- */
-extern void test__f_thread_semaphores_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_semaphores_decimate_by()
- */
-extern void test__f_thread_semaphores_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_semaphores_decimate_by()
- */
-extern void test__f_thread_semaphores_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_semaphores_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-semaphores_decrease_by.c
deleted file mode 100644 (file)
index 3d4133b..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-semaphores_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_semaphores_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_semaphores_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_semaphores_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_semaphores_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_sem_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_semaphores_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-semaphores_decrease_by.h
deleted file mode 100644 (file)
index 34df8c5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_semaphores_decrease_by
-#define _TEST__F_thread__thread_semaphores_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_semaphores_decrease_by()
- */
-extern void test__f_thread_semaphores_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_semaphores_decrease_by()
- */
-extern void test__f_thread_semaphores_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_semaphores_decrease_by()
- */
-extern void test__f_thread_semaphores_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_semaphores_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_increase.c b/level_0/f_thread/tests/unit/c/test-thread-semaphores_increase.c
deleted file mode 100644 (file)
index 42a101d..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-semaphores_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_semaphores_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_semaphores_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_semaphores_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_semaphores_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_semaphores_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_increase.h b/level_0/f_thread/tests/unit/c/test-thread-semaphores_increase.h
deleted file mode 100644 (file)
index 2ebc2a0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_semaphores_increase
-#define _TEST__F_thread__thread_semaphores_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_semaphores_increase()
- */
-extern void test__f_thread_semaphores_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_semaphores_increase()
- */
-extern void test__f_thread_semaphores_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_semaphores_increase()
- */
-extern void test__f_thread_semaphores_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_semaphores_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-semaphores_increase_by.c
deleted file mode 100644 (file)
index 1ece24a..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-semaphores_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_semaphores_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_semaphores_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_semaphores_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_semaphores_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_semaphores_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-semaphores_increase_by.h
deleted file mode 100644 (file)
index 11abcb2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_semaphores_increase_by
-#define _TEST__F_thread__thread_semaphores_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_semaphores_increase_by()
- */
-extern void test__f_thread_semaphores_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_semaphores_increase_by()
- */
-extern void test__f_thread_semaphores_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_semaphores_increase_by()
- */
-extern void test__f_thread_semaphores_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_semaphores_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_resize.c b/level_0/f_thread/tests/unit/c/test-thread-semaphores_resize.c
deleted file mode 100644 (file)
index 46d4275..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-semaphores_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_semaphores_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_semaphores_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_semaphores_t data = f_thread_semaphores_t_initialize;
-
-  {
-    const f_status_t status = f_thread_semaphores_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_resize.h b/level_0/f_thread/tests/unit/c/test-thread-semaphores_resize.h
deleted file mode 100644 (file)
index a41a3e1..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_semaphores_resize
-#define _TEST__F_thread__thread_semaphores_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_semaphores_resize()
- */
-extern void test__f_thread_semaphores_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_semaphores_resize()
- */
-extern void test__f_thread_semaphores_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_semaphores_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-semaphores_resize_callback.c
new file mode 100644 (file)
index 0000000..5e32c3e
--- /dev/null
@@ -0,0 +1,55 @@
+#include "test-thread.h"
+#include "test-thread-semaphores_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_semaphores_resize_callback__fails(void **state) {
+
+  f_thread_semaphore_t data = f_thread_semaphore_t_initialize;
+  f_thread_semaphore_t data_array[] = { data };
+  f_thread_semaphores_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_semaphores_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_sem_destroy, true);
+    will_return(__wrap_sem_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_semaphores_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_semaphores_resize_callback__works(void **state) {
+
+  f_thread_semaphore_t data = f_thread_semaphore_t_initialize;
+  f_thread_semaphore_t data_array[] = { data };
+  f_thread_semaphores_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_semaphores_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_sem_destroy, false);
+
+    const f_status_t status = f_thread_semaphores_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-semaphores_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-semaphores_resize_callback.h
new file mode 100644 (file)
index 0000000..d8d12f3
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__semaphores_resize_callback
+#define _TEST__F_thread__semaphores_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_semaphores_resize_callback_()
+ */
+extern void test__f_thread_semaphores_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_semaphores_resize_callback_()
+ */
+extern void test__f_thread_semaphores_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__semaphores_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-sets_adjust.c
deleted file mode 100644 (file)
index 9ada163..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-sets_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_sets_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_sets_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-sets_adjust.h
deleted file mode 100644 (file)
index adbefb2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_sets_adjust
-#define _TEST__F_thread__thread_sets_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_sets_adjust()
- */
-extern void test__f_thread_sets_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_sets_adjust()
- */
-extern void test__f_thread_sets_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_sets_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-sets_adjust_callback.c
new file mode 100644 (file)
index 0000000..7c11734
--- /dev/null
@@ -0,0 +1,55 @@
+#include "test-thread.h"
+#include "test-thread-sets_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_sets_adjust_callback__fails(void **state) {
+
+  f_thread_set_t data = f_thread_set_t_initialize;
+  f_thread_set_t data_array[] = { data };
+  f_thread_sets_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_sets_t datass_array[] = { datas };
+
+  int errnos[] = {
+    1,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_failure),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_pthread_attr_destroy, true);
+    will_return(__wrap_pthread_attr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_sets_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_sets_adjust_callback__works(void **state) {
+
+  f_thread_set_t data = f_thread_set_t_initialize;
+  f_thread_set_t data_array[] = { data };
+  f_thread_sets_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_sets_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_attr_destroy, false);
+
+    const f_status_t status = f_thread_sets_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-sets_adjust_callback.h
new file mode 100644 (file)
index 0000000..6af7dff
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__sets_adjust_callback
+#define _TEST__F_thread__sets_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_sets_adjust_callback_()
+ */
+extern void test__f_thread_sets_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_sets_adjust_callback_()
+ */
+extern void test__f_thread_sets_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__sets_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-sets_decimate_by.c
deleted file mode 100644 (file)
index 58f5a61..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-sets_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_sets_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_sets_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_sets_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_sets_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_attr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_sets_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-sets_decimate_by.h
deleted file mode 100644 (file)
index b10a23d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_sets_decimate_by
-#define _TEST__F_thread__thread_sets_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_sets_decimate_by()
- */
-extern void test__f_thread_sets_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_sets_decimate_by()
- */
-extern void test__f_thread_sets_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_sets_decimate_by()
- */
-extern void test__f_thread_sets_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_sets_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-sets_decrease_by.c
deleted file mode 100644 (file)
index 252d4b6..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-sets_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_sets_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_sets_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_sets_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_sets_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_attr_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_sets_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-sets_decrease_by.h
deleted file mode 100644 (file)
index 9745191..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_sets_decrease_by
-#define _TEST__F_thread__thread_sets_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_sets_decrease_by()
- */
-extern void test__f_thread_sets_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_sets_decrease_by()
- */
-extern void test__f_thread_sets_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_sets_decrease_by()
- */
-extern void test__f_thread_sets_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_sets_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_increase.c b/level_0/f_thread/tests/unit/c/test-thread-sets_increase.c
deleted file mode 100644 (file)
index c06b768..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-sets_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_sets_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_sets_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_sets_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_sets_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_sets_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_increase.h b/level_0/f_thread/tests/unit/c/test-thread-sets_increase.h
deleted file mode 100644 (file)
index 3643e48..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_sets_increase
-#define _TEST__F_thread__thread_sets_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_sets_increase()
- */
-extern void test__f_thread_sets_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_sets_increase()
- */
-extern void test__f_thread_sets_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_sets_increase()
- */
-extern void test__f_thread_sets_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_sets_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-sets_increase_by.c
deleted file mode 100644 (file)
index bea0a6d..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-sets_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_sets_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_sets_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_sets_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_sets_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_sets_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-sets_increase_by.h
deleted file mode 100644 (file)
index dea34d8..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_sets_increase_by
-#define _TEST__F_thread__thread_sets_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_sets_increase_by()
- */
-extern void test__f_thread_sets_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_sets_increase_by()
- */
-extern void test__f_thread_sets_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_sets_increase_by()
- */
-extern void test__f_thread_sets_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_sets_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_resize.c b/level_0/f_thread/tests/unit/c/test-thread-sets_resize.c
deleted file mode 100644 (file)
index e690f5c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-sets_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_sets_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_sets_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_sets_t data = f_thread_sets_t_initialize;
-
-  {
-    const f_status_t status = f_thread_sets_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_resize.h b/level_0/f_thread/tests/unit/c/test-thread-sets_resize.h
deleted file mode 100644 (file)
index a0c0ee6..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_sets_resize
-#define _TEST__F_thread__thread_sets_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_sets_resize()
- */
-extern void test__f_thread_sets_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_sets_resize()
- */
-extern void test__f_thread_sets_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_sets_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-sets_resize_callback.c
new file mode 100644 (file)
index 0000000..efe84c1
--- /dev/null
@@ -0,0 +1,55 @@
+#include "test-thread.h"
+#include "test-thread-sets_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_sets_resize_callback__fails(void **state) {
+
+  f_thread_set_t data = f_thread_set_t_initialize;
+  f_thread_set_t data_array[] = { data };
+  f_thread_sets_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_sets_t datass_array[] = { datas };
+
+  int errnos[] = {
+    1,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_failure),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 2; ++i) {
+
+    will_return(__wrap_pthread_attr_destroy, true);
+    will_return(__wrap_pthread_attr_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_sets_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_sets_resize_callback__works(void **state) {
+
+  f_thread_set_t data = f_thread_set_t_initialize;
+  f_thread_set_t data_array[] = { data };
+  f_thread_sets_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_sets_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_attr_destroy, false);
+
+    const f_status_t status = f_thread_sets_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-sets_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-sets_resize_callback.h
new file mode 100644 (file)
index 0000000..44f0d39
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__sets_resize_callback
+#define _TEST__F_thread__sets_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_sets_resize_callback_()
+ */
+extern void test__f_thread_sets_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_sets_resize_callback_()
+ */
+extern void test__f_thread_sets_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__sets_resize_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_adjust.c b/level_0/f_thread/tests/unit/c/test-thread-spins_adjust.c
deleted file mode 100644 (file)
index b7d39b7..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-spins_adjust.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_spins_adjust__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_adjust(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_spins_adjust__works(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_adjust(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_adjust.h b/level_0/f_thread/tests/unit/c/test-thread-spins_adjust.h
deleted file mode 100644 (file)
index 9ed73af..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_spins_adjust
-#define _TEST__F_thread__thread_spins_adjust
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_spins_adjust()
- */
-extern void test__f_thread_spins_adjust__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_spins_adjust()
- */
-extern void test__f_thread_spins_adjust__works(void **state);
-
-#endif // _TEST__F_thread__thread_spins_adjust
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_adjust_callback.c b/level_0/f_thread/tests/unit/c/test-thread-spins_adjust_callback.c
new file mode 100644 (file)
index 0000000..aca7456
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-spins_adjust_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_spins_adjust_callback__fails(void **state) {
+
+  f_thread_spin_t data = f_thread_spin_t_initialize;
+  f_thread_spin_t data_array[] = { data };
+  f_thread_spins_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_spins_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_spin_destroy, true);
+    will_return(__wrap_pthread_spin_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_spins_adjust_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_spins_adjust_callback__works(void **state) {
+
+  f_thread_spin_t data = f_thread_spin_t_initialize;
+  f_thread_spin_t data_array[] = { data };
+  f_thread_spins_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_spins_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_spin_destroy, false);
+
+    const f_status_t status = f_thread_spins_adjust_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_adjust_callback.h b/level_0/f_thread/tests/unit/c/test-thread-spins_adjust_callback.h
new file mode 100644 (file)
index 0000000..5c41d2b
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__spins_adjust_callback
+#define _TEST__F_thread__spins_adjust_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_spins_adjust_callback_()
+ */
+extern void test__f_thread_spins_adjust_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_spins_adjust_callback_()
+ */
+extern void test__f_thread_spins_adjust_callback__works(void **state);
+
+#endif // _TEST__F_thread__spins_adjust_callback
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_decimate_by.c b/level_0/f_thread/tests/unit/c/test-thread-spins_decimate_by.c
deleted file mode 100644 (file)
index 508474b..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-spins_decimate_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_spins_decimate_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_decimate_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_spins_decimate_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_spins_decimate_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_spins_decimate_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_spin_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_spins_decimate_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_decimate_by.h b/level_0/f_thread/tests/unit/c/test-thread-spins_decimate_by.h
deleted file mode 100644 (file)
index 31cecf0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_spins_decimate_by
-#define _TEST__F_thread__thread_spins_decimate_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_spins_decimate_by()
- */
-extern void test__f_thread_spins_decimate_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_spins_decimate_by()
- */
-extern void test__f_thread_spins_decimate_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_spins_decimate_by()
- */
-extern void test__f_thread_spins_decimate_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_spins_decimate_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_decrease_by.c b/level_0/f_thread/tests/unit/c/test-thread-spins_decrease_by.c
deleted file mode 100644 (file)
index d7277f4..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-spins_decrease_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_spins_decrease_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_decrease_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_spins_decrease_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_spins_decrease_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_spins_decrease_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    for (uint8_t i = 0; i < length; ++i) {
-      will_return(__wrap_pthread_spin_destroy, false);
-    } // for
-
-    const f_status_t status = f_thread_spins_decrease_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_decrease_by.h b/level_0/f_thread/tests/unit/c/test-thread-spins_decrease_by.h
deleted file mode 100644 (file)
index ef610d6..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_spins_decrease_by
-#define _TEST__F_thread__thread_spins_decrease_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_spins_decrease_by()
- */
-extern void test__f_thread_spins_decrease_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_spins_decrease_by()
- */
-extern void test__f_thread_spins_decrease_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_spins_decrease_by()
- */
-extern void test__f_thread_spins_decrease_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_spins_decrease_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_increase.c b/level_0/f_thread/tests/unit/c/test-thread-spins_increase.c
deleted file mode 100644 (file)
index daf465f..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-spins_increase.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_spins_increase__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_increase(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_spins_increase__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_spins_increase(length, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_spins_increase__works(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_spins_increase(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_increase.h b/level_0/f_thread/tests/unit/c/test-thread-spins_increase.h
deleted file mode 100644 (file)
index dc7566d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_spins_increase
-#define _TEST__F_thread__thread_spins_increase
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_spins_increase()
- */
-extern void test__f_thread_spins_increase__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_spins_increase()
- */
-extern void test__f_thread_spins_increase__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_spins_increase()
- */
-extern void test__f_thread_spins_increase__works(void **state);
-
-#endif // _TEST__F_thread__thread_spins_increase
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_increase_by.c b/level_0/f_thread/tests/unit/c/test-thread-spins_increase_by.c
deleted file mode 100644 (file)
index 7d404c2..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-spins_increase_by.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_spins_increase_by__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_increase_by(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_spins_increase_by__returns_data_not(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    const f_status_t status = f_thread_spins_increase_by(0, &data);
-
-    assert_int_equal(status, F_data_not);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-void test__f_thread_spins_increase_by__works(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  {
-    data.used = length;
-
-    const f_status_t status = f_thread_spins_increase_by(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, length);
-    assert_int_equal(data.size, length * 2);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_increase_by.h b/level_0/f_thread/tests/unit/c/test-thread-spins_increase_by.h
deleted file mode 100644 (file)
index 1e33bda..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_spins_increase_by
-#define _TEST__F_thread__thread_spins_increase_by
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_spins_increase_by()
- */
-extern void test__f_thread_spins_increase_by__parameter_checking(void **state);
-
-/**
- * Test that the function returns F_data_not.
- *
- * @see f_thread_spins_increase_by()
- */
-extern void test__f_thread_spins_increase_by__returns_data_not(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_spins_increase_by()
- */
-extern void test__f_thread_spins_increase_by__works(void **state);
-
-#endif // _TEST__F_thread__thread_spins_increase_by
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_resize.c b/level_0/f_thread/tests/unit/c/test-thread-spins_resize.c
deleted file mode 100644 (file)
index 0d5b60a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "test-thread.h"
-#include "test-thread-spins_resize.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_spins_resize__parameter_checking(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_resize(length, 0);
-
-    assert_int_equal(status, F_status_set_error(F_parameter));
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, 0);
-  }
-
-  assert_null(data.array);
-}
-
-void test__f_thread_spins_resize__works(void **state) {
-
-  const int length = 5;
-  f_thread_spins_t data = f_thread_spins_t_initialize;
-
-  {
-    const f_status_t status = f_thread_spins_resize(length, &data);
-
-    assert_int_equal(status, F_none);
-    assert_int_equal(data.used, 0);
-    assert_int_equal(data.size, length);
-  }
-
-  free((void *) data.array);
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_resize.h b/level_0/f_thread/tests/unit/c/test-thread-spins_resize.h
deleted file mode 100644 (file)
index 4fa350d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the thread project.
- */
-#ifndef _TEST__F_thread__thread_spins_resize
-#define _TEST__F_thread__thread_spins_resize
-
-/**
- * Test that the function correctly fails on invalid parameter.
- *
- * @see f_thread_spins_resize()
- */
-extern void test__f_thread_spins_resize__parameter_checking(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_spins_resize()
- */
-extern void test__f_thread_spins_resize__works(void **state);
-
-#endif // _TEST__F_thread__thread_spins_resize
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_resize_callback.c b/level_0/f_thread/tests/unit/c/test-thread-spins_resize_callback.c
new file mode 100644 (file)
index 0000000..321515f
--- /dev/null
@@ -0,0 +1,57 @@
+#include "test-thread.h"
+#include "test-thread-spins_resize_callback.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_spins_resize_callback__fails(void **state) {
+
+  f_thread_spin_t data = f_thread_spin_t_initialize;
+  f_thread_spin_t data_array[] = { data };
+  f_thread_spins_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_spins_t datass_array[] = { datas };
+
+  int errnos[] = {
+    EBUSY,
+    EINVAL,
+    mock_errno_generic,
+  };
+
+  f_status_t statuss[] = {
+    F_status_set_error(F_busy),
+    F_status_set_error(F_parameter),
+    F_status_set_error(F_failure),
+  };
+
+  for (uint8_t i = 0; i < 3; ++i) {
+
+    will_return(__wrap_pthread_spin_destroy, true);
+    will_return(__wrap_pthread_spin_destroy, errnos[i]);
+
+    const f_status_t status = f_thread_spins_resize_callback(0, 1, (void *) datass_array);
+
+    assert_int_equal(status, statuss[i]);
+  } // for
+}
+
+void test__f_thread_spins_resize_callback__works(void **state) {
+
+  f_thread_spin_t data = f_thread_spin_t_initialize;
+  f_thread_spin_t data_array[] = { data };
+  f_thread_spins_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_thread_spins_t datass_array[] = { datas };
+  const f_number_unsigned_t length = 1;
+
+  {
+    will_return(__wrap_pthread_spin_destroy, false);
+
+    const f_status_t status = f_thread_spins_resize_callback(0, length, (void *) datass_array);
+
+    assert_int_equal(status, F_none);
+  }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_thread/tests/unit/c/test-thread-spins_resize_callback.h b/level_0/f_thread/tests/unit/c/test-thread-spins_resize_callback.h
new file mode 100644 (file)
index 0000000..4876ff4
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_thread__spins_resize_callback
+#define _TEST__F_thread__spins_resize_callback
+
+/**
+ * Test that the function fails.
+ *
+ * @see f_thread_spins_resize_callback_()
+ */
+extern void test__f_thread_spins_resize_callback__fails(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_thread_spins_resize_callback_()
+ */
+extern void test__f_thread_spins_resize_callback__works(void **state);
+
+#endif // _TEST__F_thread__spins_resize_callback
index 944b87d0824a1bc68715b0de686b75487dd59b51..c7a85190b04991fdd2ffe3825e19861b5721d629 100644 (file)
@@ -19,185 +19,70 @@ int setdown(void **state) {
 int main(void) {
 
   const struct CMUnitTest tests[] = {
-    cmocka_unit_test(test__f_thread_attributes_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_attributes_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_attributes_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_attributes_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_attributes_adjust__works),
-    cmocka_unit_test(test__f_thread_attributes_decimate_by__works),
-    cmocka_unit_test(test__f_thread_attributes_decrease_by__works),
-    cmocka_unit_test(test__f_thread_attributes_increase__works),
-    cmocka_unit_test(test__f_thread_attributes_increase_by__works),
-    cmocka_unit_test(test__f_thread_attributes_resize__works),
-
-    cmocka_unit_test(test__f_thread_barrier_attributes_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_barrier_attributes_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_barrier_attributes_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_barrier_attributes_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_barrier_attributes_adjust__works),
-    cmocka_unit_test(test__f_thread_barrier_attributes_decimate_by__works),
-    cmocka_unit_test(test__f_thread_barrier_attributes_decrease_by__works),
-    cmocka_unit_test(test__f_thread_barrier_attributes_increase__works),
-    cmocka_unit_test(test__f_thread_barrier_attributes_increase_by__works),
-    cmocka_unit_test(test__f_thread_barrier_attributes_resize__works),
-
-    cmocka_unit_test(test__f_thread_barriers_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_barriers_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_barriers_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_barriers_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_barriers_adjust__works),
-    cmocka_unit_test(test__f_thread_barriers_decimate_by__works),
-    cmocka_unit_test(test__f_thread_barriers_decrease_by__works),
-    cmocka_unit_test(test__f_thread_barriers_increase__works),
-    cmocka_unit_test(test__f_thread_barriers_increase_by__works),
-    cmocka_unit_test(test__f_thread_barriers_resize__works),
-
-    cmocka_unit_test(test__f_thread_condition_attributes_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_condition_attributes_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_condition_attributes_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_condition_attributes_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_condition_attributes_adjust__works),
-    cmocka_unit_test(test__f_thread_condition_attributes_decimate_by__works),
-    cmocka_unit_test(test__f_thread_condition_attributes_decrease_by__works),
-    cmocka_unit_test(test__f_thread_condition_attributes_increase__works),
-    cmocka_unit_test(test__f_thread_condition_attributes_increase_by__works),
-    cmocka_unit_test(test__f_thread_condition_attributes_resize__works),
-
-    cmocka_unit_test(test__f_thread_conditions_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_conditions_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_conditions_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_conditions_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_conditions_adjust__works),
-    cmocka_unit_test(test__f_thread_conditions_decimate_by__works),
-    cmocka_unit_test(test__f_thread_conditions_decrease_by__works),
-    cmocka_unit_test(test__f_thread_conditions_increase__works),
-    cmocka_unit_test(test__f_thread_conditions_increase_by__works),
-    cmocka_unit_test(test__f_thread_conditions_resize__works),
-
-    cmocka_unit_test(test__f_thread_ids_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_ids_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_ids_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_ids_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_ids_adjust__works),
-    cmocka_unit_test(test__f_thread_ids_decimate_by__works),
-    cmocka_unit_test(test__f_thread_ids_decrease_by__works),
-    cmocka_unit_test(test__f_thread_ids_increase__works),
-    cmocka_unit_test(test__f_thread_ids_increase_by__works),
-    cmocka_unit_test(test__f_thread_ids_resize__works),
-
-    cmocka_unit_test(test__f_thread_keys_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_keys_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_keys_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_keys_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_keys_adjust__works),
-    cmocka_unit_test(test__f_thread_keys_decimate_by__works),
-    cmocka_unit_test(test__f_thread_keys_decrease_by__works),
-    cmocka_unit_test(test__f_thread_keys_increase__works),
-    cmocka_unit_test(test__f_thread_keys_increase_by__works),
-    cmocka_unit_test(test__f_thread_keys_resize__works),
-
-    cmocka_unit_test(test__f_thread_lock_attributes_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_lock_attributes_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_lock_attributes_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_lock_attributes_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_lock_attributes_adjust__works),
-    cmocka_unit_test(test__f_thread_lock_attributes_decimate_by__works),
-    cmocka_unit_test(test__f_thread_lock_attributes_decrease_by__works),
-    cmocka_unit_test(test__f_thread_lock_attributes_increase__works),
-    cmocka_unit_test(test__f_thread_lock_attributes_increase_by__works),
-    cmocka_unit_test(test__f_thread_lock_attributes_resize__works),
-
-    cmocka_unit_test(test__f_thread_locks_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_locks_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_locks_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_locks_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_locks_adjust__works),
-    cmocka_unit_test(test__f_thread_locks_decimate_by__works),
-    cmocka_unit_test(test__f_thread_locks_decrease_by__works),
-    cmocka_unit_test(test__f_thread_locks_increase__works),
-    cmocka_unit_test(test__f_thread_locks_increase_by__works),
-    cmocka_unit_test(test__f_thread_locks_resize__works),
-
-    cmocka_unit_test(test__f_thread_mutex_attributes_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_mutex_attributes_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_mutex_attributes_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_mutex_attributes_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_mutex_attributes_adjust__works),
-    cmocka_unit_test(test__f_thread_mutex_attributes_decimate_by__works),
-    cmocka_unit_test(test__f_thread_mutex_attributes_decrease_by__works),
-    cmocka_unit_test(test__f_thread_mutex_attributes_increase__works),
-    cmocka_unit_test(test__f_thread_mutex_attributes_increase_by__works),
-    cmocka_unit_test(test__f_thread_mutex_attributes_resize__works),
-
-    cmocka_unit_test(test__f_thread_mutexs_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_mutexs_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_mutexs_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_mutexs_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_mutexs_adjust__works),
-    cmocka_unit_test(test__f_thread_mutexs_decimate_by__works),
-    cmocka_unit_test(test__f_thread_mutexs_decrease_by__works),
-    cmocka_unit_test(test__f_thread_mutexs_increase__works),
-    cmocka_unit_test(test__f_thread_mutexs_increase_by__works),
-    cmocka_unit_test(test__f_thread_mutexs_resize__works),
-
-    cmocka_unit_test(test__f_thread_onces_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_onces_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_onces_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_onces_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_onces_adjust__works),
-    cmocka_unit_test(test__f_thread_onces_decimate_by__works),
-    cmocka_unit_test(test__f_thread_onces_decrease_by__works),
-    cmocka_unit_test(test__f_thread_onces_increase__works),
-    cmocka_unit_test(test__f_thread_onces_increase_by__works),
-    cmocka_unit_test(test__f_thread_onces_resize__works),
-
-    cmocka_unit_test(test__f_thread_semaphores_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_semaphores_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_semaphores_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_semaphores_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_semaphores_adjust__works),
-    cmocka_unit_test(test__f_thread_semaphores_decimate_by__works),
-    cmocka_unit_test(test__f_thread_semaphores_decrease_by__works),
-    cmocka_unit_test(test__f_thread_semaphores_increase__works),
-    cmocka_unit_test(test__f_thread_semaphores_increase_by__works),
-    cmocka_unit_test(test__f_thread_semaphores_resize__works),
-
-    cmocka_unit_test(test__f_thread_sets_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_sets_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_sets_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_sets_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_sets_adjust__works),
-    cmocka_unit_test(test__f_thread_sets_decimate_by__works),
-    cmocka_unit_test(test__f_thread_sets_decrease_by__works),
-    cmocka_unit_test(test__f_thread_sets_increase__works),
-    cmocka_unit_test(test__f_thread_sets_increase_by__works),
-    cmocka_unit_test(test__f_thread_sets_resize__works),
-
-    cmocka_unit_test(test__f_thread_spins_decimate_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_spins_decrease_by__returns_data_not),
-    cmocka_unit_test(test__f_thread_spins_increase__returns_data_not),
-    cmocka_unit_test(test__f_thread_spins_increase_by__returns_data_not),
-
-    cmocka_unit_test(test__f_thread_spins_adjust__works),
-    cmocka_unit_test(test__f_thread_spins_decimate_by__works),
-    cmocka_unit_test(test__f_thread_spins_decrease_by__works),
-    cmocka_unit_test(test__f_thread_spins_increase__works),
-    cmocka_unit_test(test__f_thread_spins_increase_by__works),
-    cmocka_unit_test(test__f_thread_spins_resize__works),
+    cmocka_unit_test(test__f_thread_attributes_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_attributes_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_attributes_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_attributes_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_barriers_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_barriers_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_barriers_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_barriers_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_barrier_attributes_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_barrier_attributes_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_barrier_attributes_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_barrier_attributes_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_conditions_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_conditions_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_conditions_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_conditions_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_condition_attributes_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_condition_attributes_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_condition_attributes_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_condition_attributes_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_keys_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_keys_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_keys_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_keys_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_locks_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_locks_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_locks_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_locks_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_lock_attributes_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_lock_attributes_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_lock_attributes_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_lock_attributes_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_mutexs_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_mutexs_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_mutexs_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_mutexs_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_mutex_attributes_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_mutex_attributes_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_mutex_attributes_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_mutex_attributes_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_semaphores_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_semaphores_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_semaphores_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_semaphores_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_sets_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_sets_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_sets_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_sets_resize_callback__works),
+
+    cmocka_unit_test(test__f_thread_spins_adjust_callback__fails),
+    cmocka_unit_test(test__f_thread_spins_resize_callback__fails),
+    cmocka_unit_test(test__f_thread_spins_adjust_callback__works),
+    cmocka_unit_test(test__f_thread_spins_resize_callback__works),
 
     cmocka_unit_test(test__f_thread_at_fork__fails),
     cmocka_unit_test(test__f_thread_at_fork__works),
@@ -522,110 +407,44 @@ int main(void) {
     cmocka_unit_test(test__f_thread_spin_unlock__works),
 
     #ifndef _di_level_0_parameter_checking_
-      cmocka_unit_test(test__f_thread_attributes_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_attributes_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_attributes_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_attributes_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_attributes_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_attributes_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_barrier_attributes_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_barrier_attributes_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_barrier_attributes_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_barrier_attributes_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_barrier_attributes_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_barrier_attributes_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_barriers_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_barriers_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_barriers_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_barriers_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_barriers_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_barriers_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_condition_attributes_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_condition_attributes_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_condition_attributes_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_condition_attributes_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_condition_attributes_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_condition_attributes_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_conditions_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_conditions_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_conditions_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_conditions_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_conditions_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_conditions_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_ids_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_ids_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_ids_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_ids_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_ids_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_ids_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_keys_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_keys_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_keys_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_keys_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_keys_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_keys_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_lock_attributes_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_lock_attributes_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_lock_attributes_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_lock_attributes_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_lock_attributes_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_lock_attributes_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_locks_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_locks_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_locks_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_locks_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_locks_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_locks_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_mutex_attributes_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_mutex_attributes_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_mutex_attributes_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_mutex_attributes_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_mutex_attributes_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_mutex_attributes_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_mutexs_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_mutexs_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_mutexs_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_mutexs_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_mutexs_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_mutexs_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_onces_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_onces_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_onces_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_onces_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_onces_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_onces_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_semaphores_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_semaphores_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_semaphores_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_semaphores_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_semaphores_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_semaphores_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_sets_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_sets_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_sets_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_sets_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_sets_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_sets_resize__parameter_checking),
-
-      cmocka_unit_test(test__f_thread_spins_adjust__parameter_checking),
-      cmocka_unit_test(test__f_thread_spins_decimate_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_spins_decrease_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_spins_increase__parameter_checking),
-      cmocka_unit_test(test__f_thread_spins_increase_by__parameter_checking),
-      cmocka_unit_test(test__f_thread_spins_resize__parameter_checking),
+      // f_thread_attributes_adjust_callback() doesn't use parameter checking.
+      // f_thread_attributes_resize_callback() doesn't use parameter checking.
+
+      // f_thread_barriers_adjust_callback() doesn't use parameter checking.
+      // f_thread_barriers_resize_callback() doesn't use parameter checking.
+
+      // f_thread_barrier_attributes_adjust_callback() doesn't use parameter checking.
+      // f_thread_barrier_attributes_resize_callback() doesn't use parameter checking.
+
+      // f_thread_conditions_adjust_callback() doesn't use parameter checking.
+      // f_thread_conditions_resize_callback() doesn't use parameter checking.
+
+      // f_thread_condition_attributes_adjust_callback() doesn't use parameter checking.
+      // f_thread_condition_attributes_resize_callback() doesn't use parameter checking.
+
+      // f_thread_keys_adjust_callback() doesn't use parameter checking.
+      // f_thread_keys_resize_callback() doesn't use parameter checking.
+
+      // f_thread_locks_adjust_callback() doesn't use parameter checking.
+      // f_thread_locks_resize_callback() doesn't use parameter checking.
+
+      // f_thread_lock_attributes_adjust_callback() doesn't use parameter checking.
+      // f_thread_lock_attributes_resize_callback() doesn't use parameter checking.
+
+      // f_thread_mutexs_adjust_callback() doesn't use parameter checking.
+      // f_thread_mutexs_resize_callback() doesn't use parameter checking.
+
+      // f_thread_mutex_attributes_adjust_callback() doesn't use parameter checking.
+      // f_thread_mutex_attributes_resize_callback() doesn't use parameter checking.
+
+      // f_thread_semaphores_adjust_callback() doesn't use parameter checking.
+      // f_thread_semaphores_resize_callback() doesn't use parameter checking.
+
+      // f_thread_sets_adjust_callback() doesn't use parameter checking.
+      // f_thread_sets_resize_callback() doesn't use parameter checking.
+
+      // f_thread_spins_adjust_callback() doesn't use parameter checking.
+      // f_thread_spins_resize_callback() doesn't use parameter checking.
 
       cmocka_unit_test(test__f_thread_at_fork__parameter_checking),
 
index 90734ebc0542464a2e1bd574e0e668fd5e4f8d2e..ed1702551ee096d4ef90246f011f7667d127e0ec 100644 (file)
 #include "mock-thread.h"
 
 // Test includes.
-#include "test-thread-attributes_adjust.h"
-#include "test-thread-attributes_decimate_by.h"
-#include "test-thread-attributes_decrease_by.h"
-#include "test-thread-attributes_increase.h"
-#include "test-thread-attributes_increase_by.h"
-#include "test-thread-attributes_resize.h"
-#include "test-thread-barriers_adjust.h"
-#include "test-thread-barriers_decimate_by.h"
-#include "test-thread-barriers_decrease_by.h"
-#include "test-thread-barriers_increase.h"
-#include "test-thread-barriers_increase_by.h"
-#include "test-thread-barriers_resize.h"
-#include "test-thread-barrier_attributes_adjust.h"
-#include "test-thread-barrier_attributes_decimate_by.h"
-#include "test-thread-barrier_attributes_decrease_by.h"
-#include "test-thread-barrier_attributes_increase.h"
-#include "test-thread-barrier_attributes_increase_by.h"
-#include "test-thread-barrier_attributes_resize.h"
-#include "test-thread-conditions_adjust.h"
-#include "test-thread-conditions_decimate_by.h"
-#include "test-thread-conditions_decrease_by.h"
-#include "test-thread-conditions_increase.h"
-#include "test-thread-conditions_increase_by.h"
-#include "test-thread-conditions_resize.h"
-#include "test-thread-condition_attributes_adjust.h"
-#include "test-thread-condition_attributes_decimate_by.h"
-#include "test-thread-condition_attributes_decrease_by.h"
-#include "test-thread-condition_attributes_increase.h"
-#include "test-thread-condition_attributes_increase_by.h"
-#include "test-thread-condition_attributes_resize.h"
-#include "test-thread-ids_adjust.h"
-#include "test-thread-ids_decimate_by.h"
-#include "test-thread-ids_decrease_by.h"
-#include "test-thread-ids_increase.h"
-#include "test-thread-ids_increase_by.h"
-#include "test-thread-ids_resize.h"
-#include "test-thread-keys_adjust.h"
-#include "test-thread-keys_decimate_by.h"
-#include "test-thread-keys_decrease_by.h"
-#include "test-thread-keys_increase.h"
-#include "test-thread-keys_increase_by.h"
-#include "test-thread-keys_resize.h"
-#include "test-thread-locks_adjust.h"
-#include "test-thread-locks_decimate_by.h"
-#include "test-thread-locks_decrease_by.h"
-#include "test-thread-locks_increase.h"
-#include "test-thread-locks_increase_by.h"
-#include "test-thread-locks_resize.h"
-#include "test-thread-lock_attributes_adjust.h"
-#include "test-thread-lock_attributes_decimate_by.h"
-#include "test-thread-lock_attributes_decrease_by.h"
-#include "test-thread-lock_attributes_increase.h"
-#include "test-thread-lock_attributes_increase_by.h"
-#include "test-thread-lock_attributes_resize.h"
-#include "test-thread-mutexs_adjust.h"
-#include "test-thread-mutexs_decimate_by.h"
-#include "test-thread-mutexs_decrease_by.h"
-#include "test-thread-mutexs_increase.h"
-#include "test-thread-mutexs_increase_by.h"
-#include "test-thread-mutexs_resize.h"
-#include "test-thread-mutex_attributes_adjust.h"
-#include "test-thread-mutex_attributes_decimate_by.h"
-#include "test-thread-mutex_attributes_decrease_by.h"
-#include "test-thread-mutex_attributes_increase.h"
-#include "test-thread-mutex_attributes_increase_by.h"
-#include "test-thread-mutex_attributes_resize.h"
-#include "test-thread-onces_adjust.h"
-#include "test-thread-onces_decimate_by.h"
-#include "test-thread-onces_decrease_by.h"
-#include "test-thread-onces_increase.h"
-#include "test-thread-onces_increase_by.h"
-#include "test-thread-onces_resize.h"
-#include "test-thread-semaphores_adjust.h"
-#include "test-thread-semaphores_decimate_by.h"
-#include "test-thread-semaphores_decrease_by.h"
-#include "test-thread-semaphores_increase.h"
-#include "test-thread-semaphores_increase_by.h"
-#include "test-thread-semaphores_resize.h"
-#include "test-thread-sets_adjust.h"
-#include "test-thread-sets_decimate_by.h"
-#include "test-thread-sets_decrease_by.h"
-#include "test-thread-sets_increase.h"
-#include "test-thread-sets_increase_by.h"
-#include "test-thread-sets_resize.h"
-#include "test-thread-spins_adjust.h"
-#include "test-thread-spins_decimate_by.h"
-#include "test-thread-spins_decrease_by.h"
-#include "test-thread-spins_increase.h"
-#include "test-thread-spins_increase_by.h"
-#include "test-thread-spins_resize.h"
+#include "test-thread-attributes_adjust_callback.h"
+#include "test-thread-attributes_resize_callback.h"
+#include "test-thread-barriers_adjust_callback.h"
+#include "test-thread-barriers_resize_callback.h"
+#include "test-thread-barrier_attributes_adjust_callback.h"
+#include "test-thread-barrier_attributes_resize_callback.h"
+#include "test-thread-conditions_adjust_callback.h"
+#include "test-thread-conditions_resize_callback.h"
+#include "test-thread-condition_attributes_adjust_callback.h"
+#include "test-thread-condition_attributes_resize_callback.h"
+#include "test-thread-keys_adjust_callback.h"
+#include "test-thread-keys_resize_callback.h"
+#include "test-thread-locks_adjust_callback.h"
+#include "test-thread-locks_resize_callback.h"
+#include "test-thread-lock_attributes_adjust_callback.h"
+#include "test-thread-lock_attributes_resize_callback.h"
+#include "test-thread-mutexs_adjust_callback.h"
+#include "test-thread-mutexs_resize_callback.h"
+#include "test-thread-mutex_attributes_adjust_callback.h"
+#include "test-thread-mutex_attributes_resize_callback.h"
+#include "test-thread-semaphores_adjust_callback.h"
+#include "test-thread-semaphores_resize_callback.h"
+#include "test-thread-sets_adjust_callback.h"
+#include "test-thread-sets_resize_callback.h"
+#include "test-thread-spins_adjust_callback.h"
+#include "test-thread-spins_resize_callback.h"
 
 #include "test-thread-at_fork.h"
 #include "test-thread-attribute_affinity_get.h"
index e9f6edc330955d44cc447f271824880e9c0c53b3..b3752ef79700108cdfc9e5082208c1948ba12f82 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_cells_adjust_callback_
-  f_status_t f_cells_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_cells_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_cells_t * const array = (f_cells_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(f_cell_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_cells_adjust_callback_
 
 #ifndef _di_f_cells_resize_callback_
-  f_status_t f_cells_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_cells_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_cells_t * const array = (f_cells_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(f_cell_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index 78ec6582a7386f4e25ee63d6d15a4bba816d00d9..5c4b5e1c89eca157ec0cd6bdb62db92745955fbc 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_cells_adjust_callback_
-  extern f_status_t f_cells_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_cells_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_cells_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_cells_resize_callback_
-  extern f_status_t f_cells_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_cells_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_cells_resize_callback_
 
 #ifdef __cplusplus
index cfa1ae86c67d843fd4b4e2530d2c2632b433c5aa..39a1d9e3b11ed6817ecc04b54ebc3787c5dd3a7f 100644 (file)
@@ -7,13 +7,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_files_adjust_callback_
-  f_status_t f_files_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_files_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_files_t * const array = (f_files_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(f_file_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -25,13 +25,13 @@ extern "C" {
 #endif // _di_f_files_adjust_callback_
 
 #ifndef _di_f_files_resize_callback_
-  f_status_t f_files_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_files_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_files_t * const array = (f_files_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(f_file_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index aa0a9b45700f1b7024b3ee6ead477ff046f5b745..4c18383854f169a174bca0a72609020a4db9201a 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_files_adjust_callback_
-  extern f_status_t f_files_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_files_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_files_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_files_resize_callback_
-  extern f_status_t f_files_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_files_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_files_resize_callback_
 
 #ifdef __cplusplus
index 1440c80205f20cdab7f903ab270de4fbb2ecce63..d19777ae0b0a06aec243189c907fcea2805c27ca 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_fll_ids_adjust_callback_
-  f_status_t f_fll_ids_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_fll_ids_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_fll_ids_t * const array = (f_fll_ids_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(f_fll_id_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_fll_ids_adjust_callback_
 
 #ifndef _di_f_fll_ids_resize_callback_
-  f_status_t f_fll_ids_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_fll_ids_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_fll_ids_t * const array = (f_fll_ids_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(f_fll_id_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index 09bea22bc0465c018d1ee03a01db6a461dec2202..35b85b39f46da0c194e5d779ddb1a0d9093d2366 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_fll_ids_adjust_callback_
-  extern f_status_t f_fll_ids_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_fll_ids_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_fll_ids_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_fll_ids_resize_callback_
-  extern f_status_t f_fll_ids_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_fll_ids_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_fll_ids_resize_callback_
 
 #ifdef __cplusplus
index a3416b5ac88e8d06324fb95009ff192d79ed95d0..9dcaa40843a414298fd46df01cd3f2cb79273bfa 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_int128s_adjust_callback_
-  f_status_t f_int128s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_int128s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_int128s_t * const array = (f_int128s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(f_int128_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_int128s_adjust_callback_
 
 #ifndef _di_f_int128s_resize_callback_
-  f_status_t f_int128s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_int128s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_int128s_t * const array = (f_int128s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(f_int128_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index e0122eb79d910a4cc0d34c82b77cbc7c26db9397..a2a714d6ef2203da9b33e4649cac5dd84f326c8e 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_int128s_adjust_callback_
-  extern f_status_t f_int128s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_int128s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_int128s_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_int128s_resize_callback_
-  extern f_status_t f_int128s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_int128s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_int128s_resize_callback_
 
 #ifdef __cplusplus
index 446baf3996278e93a665f566e2c0662ce0cfa4df..224c8a0ebb7505d7d2d87f2b7f57a8345ab50219 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_int16s_adjust_callback_
-  f_status_t f_int16s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_int16s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_int16s_t * const array = (f_int16s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(int16_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_int16s_adjust_callback_
 
 #ifndef _di_f_int16s_resize_callback_
-  f_status_t f_int16s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_int16s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_int16s_t * const array = (f_int16s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(int16_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index bccde6761a51e0b878042d84a14c0f8bd97d5a6a..cb6a90b36dd80b817a40bc02a131212d615962d1 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_int16s_adjust_callback_
-  extern f_status_t f_int16s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_int16s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_int16s_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_int16s_resize_callback_
-  extern f_status_t f_int16s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_int16s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_int16s_resize_callback_
 #ifdef __cplusplus
 } // extern "C"
index 4561c61e1ff8bb6c1b229b4dfc3fc8f348f87844..bdbd6ae4f49ffd6f638aa4e31245387bd377a1e9 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_int32s_adjust_callback_
-  f_status_t f_int32s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_int32s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_int32s_t * const array = (f_int32s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(int32_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_int32s_adjust_callback_
 
 #ifndef _di_f_int32s_resize_callback_
-  f_status_t f_int32s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_int32s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_int32s_t * const array = (f_int32s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(int32_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index 2cc3699f165f2574a9223503c0578e9df738aca8..0fb6de60f44e93136b9612b99c252e2df005cbee 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_int32s_adjust_callback_
-  extern f_status_t f_int32s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_int32s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_int32s_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_int32s_resize_callback_
-  extern f_status_t f_int32s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_int32s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_int32s_resize_callback_
 
 #ifdef __cplusplus
index 358375c9f44a39d28e025b7ccec8b25079a0f72e..2cb85ddb747995367ac98ce0a31f079d77bb489f 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_int64s_adjust_callback_
-  f_status_t f_int64s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_int64s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_int64s_t * const array = (f_int64s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(int64_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_int64s_adjust_callback_
 
 #ifndef _di_f_int64s_resize_callback_
-  f_status_t f_int64s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_int64s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_int64s_t * const array = (f_int64s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(int64_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index 87b9b8fc55020e0685a99e5c23669ea2598bdb4b..6cb81c04d41362143cb204ef086c15095b50154f 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_int64s_adjust_callback_
-  extern f_status_t f_int64s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_int64s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_int64s_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_int64s_resize_callback_
-  extern f_status_t f_int64s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_int64s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_int64s_resize_callback_
 
 #ifdef __cplusplus
index e362f132833a29c858865501f126a8a83856306f..44f1479a5ba3682148abe2d6b13d1271b261afbf 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_int8s_adjust_callback_
-  f_status_t f_int8s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_int8s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_int8s_t * const array = (f_int8s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(int8_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_int8s_adjust_callback_
 
 #ifndef _di_f_int8s_resize_callback_
-  f_status_t f_int8s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_int8s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_int8s_t * const array = (f_int8s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(int8_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index fc6f0ab92b294f48b5bb170537253c1b6d487d09..6478f18dae8bc8ee00469282f308c5aee305cbec 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_int8s_adjust_callback_
-  extern f_status_t f_int8s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_int8s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_int8s_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_int8s_resize_callback_
-  extern f_status_t f_int8s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_int8s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_int8s_resize_callback_
 
 #ifdef __cplusplus
index 966a6cf41beb22b5adb8f8b5e191f9ce6b400162..80207ee09575db128e2a2fee2e26d720a74ca62e 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_number_unsigneds_adjust_callback_
-  f_status_t f_number_unsigneds_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_number_unsigneds_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_number_unsigneds_t * const array = (f_number_unsigneds_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(f_number_unsigned_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_number_unsigneds_adjust_callback_
 
 #ifndef _di_f_number_unsigneds_resize_callback_
-  f_status_t f_number_unsigneds_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_number_unsigneds_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_number_unsigneds_t * const array = (f_number_unsigneds_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index 99ac11ec1fc2b85d5e80b26df0e187b210a570b5..b480f3702f8b36a4a04bbc7bea50cac83f6f19a9 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_number_unsigneds_adjust_callback_
-  extern f_status_t f_number_unsigneds_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_number_unsigneds_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_number_unsigneds_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_number_unsigneds_resize_callback_
-  extern f_status_t f_number_unsigneds_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_number_unsigneds_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_number_unsigneds_resize_callback_
 
 #ifdef __cplusplus
index 756bdaa5c83d392da94f1cc53e0169252d8f7e2f..356bdd16fbd4731ab1b773e265882101669746d3 100644 (file)
@@ -7,13 +7,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_polls_adjust_callback_
-  f_status_t f_polls_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_polls_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_polls_t * const array = (f_polls_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(f_poll_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -25,13 +25,13 @@ extern "C" {
 #endif // _di_f_polls_adjust_callback_
 
 #ifndef _di_f_polls_resize_callback_
-  f_status_t f_polls_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_polls_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_polls_t * const array = (f_polls_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(f_poll_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index bf2d72c888abbad5089726f2714ab0ed4436cf7c..cf65de3b8b9267645263d926b5d217e479941c38 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_polls_adjust_callback_
-  extern f_status_t f_polls_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_polls_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_polls_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_polls_resize_callback_
-  extern f_status_t f_polls_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_polls_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_polls_resize_callback_
 
 #ifdef __cplusplus
index eee580c8e2bd85545f0ecf6efd30cbaa2ab743aa..238116bd15dcd7736228d8d207c70af09a9961c8 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_states_adjust_callback_
-  f_status_t f_states_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_states_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_states_t * const array = (f_states_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(f_state_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_states_adjust_callback_
 
 #ifndef _di_f_states_resize_callback_
-  f_status_t f_states_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_states_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_states_t * const array = (f_states_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(f_state_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index 061b05fb846e0f2019cfd96d5a10ce1e3690e7b2..9bde006b03143a8d2056e495e09a4a9601f4d09d 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_states_adjust_callback_
-  extern f_status_t f_states_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_states_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_states_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_states_resize_callback_
-  extern f_status_t f_states_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_states_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_states_resize_callback_
 
 #ifdef __cplusplus
index c64c2cdd2f74b585425abe0d99099d4d8d78b711..eb5ad0d5e438b8b374086c730dc2e546e22172d9 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_statuss_adjust_callback_
-  f_status_t f_statuss_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_statuss_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_statuss_t * const array = (f_statuss_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(f_status_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_statuss_adjust_callback_
 
 #ifndef _di_f_statuss_resize_callback_
-  f_status_t f_statuss_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_statuss_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_statuss_t * const array = (f_statuss_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(f_status_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index dbbb40f6df1606ea6ae551aca8bea6f0ef8596e6..8f4ab6a59e1827dc97c2c19e4f50534dae8da79f 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_statuss_adjust_callback_
-  extern f_status_t f_statuss_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_statuss_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_statuss_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_statuss_resize_callback_
-  extern f_status_t f_statuss_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_statuss_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_statuss_resize_callback_
 
 #ifdef __cplusplus
index d24084df0ab1dc20bfc3925a0088ca3e2b50d221..3aa63bbc1e3962ee8394f17450040bd5b67ee2fc 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_uint128s_adjust_callback_
-  f_status_t f_uint128s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_uint128s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_uint128s_t * const array = (f_uint128s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(f_uint128_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_uint128s_adjust_callback_
 
 #ifndef _di_f_uint128s_resize_callback_
-  f_status_t f_uint128s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_uint128s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_uint128s_t * const array = (f_uint128s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(f_uint128_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index a46b8beee366997c38dc227fcdf9a7b3e4ec51a0..f3c9a0d31db5b4923284befbe65bdbd386776561 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_uint128s_adjust_callback_
-  extern f_status_t f_uint128s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_uint128s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_uint128s_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_uint128s_resize_callback_
-  extern f_status_t f_uint128s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_uint128s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_uint128s_resize_callback_
 
 #ifdef __cplusplus
index 076ba67262d6c18a5e4b7961e3494e97eb966ce2..47752754fc5d4fd1365f08903e6679ae75ca4563 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_uint16s_adjust_callback_
-  f_status_t f_uint16s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_uint16s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_uint16s_t * const array = (f_uint16s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(uint16_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_uint16s_adjust_callback_
 
 #ifndef _di_f_uint16s_resize_callback_
-  f_status_t f_uint16s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_uint16s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_uint16s_t * const array = (f_uint16s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(uint16_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index c110caca251f299b60bf5e44fe91f565f9d86438..b8f952e295e98b1d1ec55027c9d9fa1524e1fb85 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_uint16s_adjust_callback_
-  extern f_status_t f_uint16s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_uint16s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_uint16s_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_uint16s_resize_callback_
-  extern f_status_t f_uint16s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_uint16s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_uint16s_resize_callback_
 
 #ifdef __cplusplus
index 25de94b18dcff0bafb657ba7b2e899167f61ee2f..4a76c453b29639c509b78ebea17370b4b9d8583c 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_uint32s_adjust_callback_
-  f_status_t f_uint32s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_uint32s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_uint32s_t * const array = (f_uint32s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(uint32_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_uint32s_adjust_callback_
 
 #ifndef _di_f_uint32s_resize_callback_
-  f_status_t f_uint32s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_uint32s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_uint32s_t * const array = (f_uint32s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(uint32_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index 4f3e54ee03138bae4612cb06508f5d67db056a48..59f889d68511fcac61517ade73b919c9e1ccdffc 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_uint32s_adjust_callback_
-  extern f_status_t f_uint32s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_uint32s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_uint32s_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_uint32s_resize_callback_
-  extern f_status_t f_uint32s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_uint32s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_uint32s_resize_callback_
 
 #ifdef __cplusplus
index cc436cb5762ef262c426d8fd08a8332a603ea82c..d3ca2943fe8678fec299dbdfa43b0ed57ccc0e80 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_uint64s_adjust_callback_
-  f_status_t f_uint64s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_uint64s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_uint64s_t * const array = (f_uint64s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(uint64_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_uint64s_adjust_callback_
 
 #ifndef _di_f_uint64s_resize_callback_
-  f_status_t f_uint64s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_uint64s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_uint64s_t * const array = (f_uint64s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(uint64_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index 5d59fff2281b8034aeea1b3736d8c9ba069ee0ff..e3fcfebfff9d711c573350a88fe98db9da880de5 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_uint64s_adjust_callback_
-  extern f_status_t f_uint64s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_uint64s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_uint64s_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_uint64s_resize_callback_
-  extern f_status_t f_uint64s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_uint64s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_uint64s_resize_callback_
 
 #ifdef __cplusplus
index eed0283f83ac583e614922138403667cf600ab57..c10f751eb569b97cec8794e1aba38cc4ea46ab26 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_uint8s_adjust_callback_
-  f_status_t f_uint8s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_uint8s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_uint8s_t * const array = (f_uint8s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_adjust(0, sizeof(uint8_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
@@ -24,13 +24,13 @@ extern "C" {
 #endif // _di_f_uint8s_adjust_callback_
 
 #ifndef _di_f_uint8s_resize_callback_
-  f_status_t f_uint8s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const void_array) {
+  f_status_t f_uint8s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
     {
       f_uint8s_t * const array = (f_uint8s_t *) void_array;
       f_status_t status = F_none;
 
-      for (f_number_unsigned_t i = start; i < size; ++i) {
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
 
         status = f_memory_array_resize(0, sizeof(uint8_t), (void **) &array[i].array, &array[i].used, &array[i].size);
         if (F_status_is_error(status)) return status;
index 9ecab86cbe8f083f24f54241670872fdab7c12bb..c786cf785dbb41a28c3c0f665e073393389dcf14 100644 (file)
@@ -22,9 +22,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -40,7 +40,7 @@ extern "C" {
  * @see f_memory_arrays_adjust()
  */
 #ifndef _di_f_uint8s_adjust_callback_
-  extern f_status_t f_uint8s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_uint8s_adjust_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_uint8s_adjust_callback_
 
 /**
@@ -49,9 +49,9 @@ extern "C" {
  * This does not do parameter checking.
  *
  * @param start
- *   The start position in the array to start deleting.
+ *   The inclusive start position in the array to start deleting.
  * @param stop
- *   The stop in the array to stop deleting.
+ *   The exclusive stop position in the array to stop deleting.
  * @param array
  *   The array structure to delete all values of.
  *   Must not be NULL.
@@ -67,7 +67,7 @@ extern "C" {
  * @see f_memory_arrays_resize()
  */
 #ifndef _di_f_uint8s_resize_callback_
-  extern f_status_t f_uint8s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t size, void * const array);
+  extern f_status_t f_uint8s_resize_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
 #endif // _di_f_uint8s_resize_callback_
 
 #ifdef __cplusplus
index 771cdc3b609256bdefce5f5e619cda37445c22c0..02f61f7f828c5c46b7c7342085658be8442d22ad 100644 (file)
@@ -4,21 +4,6 @@
 extern "C" {
 #endif
 
-int __wrap_poll(f_poll_t *fds, nfds_t nfds, int timeout) {
-
-  const bool failure = mock_type(bool);
-
-  if (failure) {
-    errno = mock_type(int);
-
-    return -1;
-  }
-
-  fds->revents = mock_type(short);
-
-  return mock_type(int);
-}
-
 f_status_t __wrap_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
 
   if (!array || !used || !size) return F_status_set_error(F_parameter_not);
@@ -45,6 +30,21 @@ f_status_t __wrap_f_memory_array_resize(const f_number_unsigned_t length, const
   return mock_type(f_status_t);
 }
 
+int __wrap_poll(f_poll_t *fds, nfds_t nfds, int timeout) {
+
+  const bool failure = mock_type(bool);
+
+  if (failure) {
+    errno = mock_type(int);
+
+    return -1;
+  }
+
+  fds->revents = mock_type(short);
+
+  return mock_type(int);
+}
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index c9039209d02aceb858d758c0ef0d4968344256cd..92441e0df4732788c6490a8b93e6bb6b3c870aef 100644 (file)
@@ -30,9 +30,9 @@ extern "C" {
 
 const static int mock_errno_generic = 32767;
 
-extern int __wrap_poll(f_poll_t *fds, nfds_t nfds, int timeout);
 extern f_status_t __wrap_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
 extern f_status_t __wrap_f_memory_array_resizze(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
+extern int __wrap_poll(f_poll_t *fds, nfds_t nfds, int timeout);
 
 #ifdef __cplusplus
 } // extern "C"