This makes a second pass around f_thread memory and addresses other bugs found.
#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_
#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_
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"
// 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_
/**
#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"
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);
} // 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);
} // 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"
#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_
/**
#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"
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"
// 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_
/**
#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"
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);
} // 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);
} // 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"
#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_
/**
#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"
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);
} // 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);
} // 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"
// 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_
/**
#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"
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
#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
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"
#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_
/**
#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"
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);
} // 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);
} // 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"
#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_
/**
#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"
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);
} // 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);
} // 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"
// 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_
/**
#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"
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);
} // 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);
} // 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"
#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_
/**
#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"
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);
} // 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);
} // 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"
// 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_
/**
#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"
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
#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"
+++ /dev/null
-#include "../thread.h"
-#include "private-once.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * 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
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
#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_
/**
#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"
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"
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 }
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_
/**
#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"
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);
} // 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);
} // 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"
#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_
/**
#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"
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
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
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
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);
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);
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
+++ /dev/null
-#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
+++ /dev/null
-/**
- * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
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),
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),
#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"
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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"
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
#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;
#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;
* 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.
* @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_
/**
* 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.
* @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
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);
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
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"