flags -Wl,--wrap=pthread_barrier_destroy
flags -Wl,--wrap=pthread_barrier_init
flags -Wl,--wrap=pthread_barrier_wait
+flags -Wl,--wrap=pthread_create
+flags -Wl,--wrap=pthread_cancel
+flags -Wl,--wrap=pthread_cond_broadcast
+flags -Wl,--wrap=pthread_cond_destroy
+flags -Wl,--wrap=pthread_cond_init
+flags -Wl,--wrap=pthread_cond_signal
+flags -Wl,--wrap=pthread_cond_timedwait
+flags -Wl,--wrap=pthread_cond_wait
+flags -Wl,--wrap=pthread_condattr_destroy
flags -Wl,--wrap=pthread_condattr_getclock
flags -Wl,--wrap=pthread_condattr_getpshared
+flags -Wl,--wrap=pthread_condattr_init
flags -Wl,--wrap=pthread_condattr_setclock
flags -Wl,--wrap=pthread_condattr_setpshared
+flags -Wl,--wrap=pthread_detach
+flags -Wl,--wrap=pthread_equal
+flags -Wl,--wrap=pthread_exit
flags -Wl,--wrap=pthread_getattr_default_np
+flags -Wl,--wrap=pthread_getcpuclockid
+flags -Wl,--wrap=pthread_getconcurrency
+flags -Wl,--wrap=pthread_getspecific
+flags -Wl,--wrap=pthread_join
+flags -Wl,--wrap=pthread_key_create
flags -Wl,--wrap=pthread_key_delete
+flags -Wl,--wrap=pthread_self
flags -Wl,--wrap=pthread_setattr_default_np
+flags -Wl,--wrap=pthread_setcancelstate
+flags -Wl,--wrap=pthread_setcanceltype
+flags -Wl,--wrap=pthread_setconcurrency
+flags -Wl,--wrap=pthread_setspecific
+flags -Wl,--wrap=pthread_testcancel
+flags -Wl,--wrap=pthread_timedjoin_np
+flags -Wl,--wrap=pthread_tryjoin_np
+
+flags -Wl,--wrap=pthread_rwlock_destroy
+flags -Wl,--wrap=pthread_rwlock_init
+flags -Wl,--wrap=pthread_rwlock_rdlock
+flags -Wl,--wrap=pthread_rwlock_timedrdlock
+flags -Wl,--wrap=pthread_rwlock_timedwrlock
+flags -Wl,--wrap=pthread_rwlock_tryrdlock
+flags -Wl,--wrap=pthread_rwlock_trywrlock
+flags -Wl,--wrap=pthread_rwlock_unlock
+flags -Wl,--wrap=pthread_rwlock_wrlock
+flags -Wl,--wrap=pthread_rwlockattr_destroy
+flags -Wl,--wrap=pthread_rwlockattr_init
+flags -Wl,--wrap=pthread_rwlockattr_getpshared
+flags -Wl,--wrap=pthread_rwlockattr_setpshared
+flags -Wl,--wrap=pthread_mutex_destroy
+flags -Wl,--wrap=pthread_mutex_init
+flags -Wl,--wrap=pthread_mutex_lock
+flags -Wl,--wrap=pthread_mutex_timedlock
+flags -Wl,--wrap=pthread_mutex_trylock
+flags -Wl,--wrap=pthread_mutex_unlock
+flags -Wl,--wrap=pthread_mutexattr_destroy
+flags -Wl,--wrap=pthread_mutexattr_init
+flags -Wl,--wrap=pthread_mutexattr_getprioceiling
+flags -Wl,--wrap=pthread_mutexattr_getprotocol
+flags -Wl,--wrap=pthread_mutexattr_getpshared
+flags -Wl,--wrap=pthread_mutexattr_gettype
+flags -Wl,--wrap=pthread_mutexattr_setprioceiling
+flags -Wl,--wrap=pthread_mutexattr_setprotocol
+flags -Wl,--wrap=pthread_mutexattr_setpshared
+flags -Wl,--wrap=pthread_mutexattr_settype
+flags -Wl,--wrap=sem_destroy
build_sources_program test-thread-at_fork.c
build_sources_program test-thread-attribute_affinity_get.c test-thread-attribute_affinity_set.c
-build_sources_program test-thread-attribute_condition_clock_get.c test-thread-attribute_condition_clock_set.c
-build_sources_program test-thread-attribute_condition_shared_get.c test-thread-attribute_condition_shared_set.c
+build_sources_program test-thread-attribute_concurrency_get.c test-thread-attribute_concurrency_set.c
build_sources_program test-thread-attribute_create.c test-thread-attribute_delete.c
build_sources_program test-thread-attribute_default_get.c test-thread-attribute_default_set.c
build_sources_program test-thread-attribute_detach_get.c test-thread-attribute_detach_set.c
build_sources_program test-thread-barrier_attribute_shared_get.c test-thread-barrier_attribute_shared_set.c
build_sources_program test-thread-barrier_create.c test-thread-barrier_delete.c
build_sources_program test-thread-barrier_wait.c
+build_sources_program test-thread-caller.c
+build_sources_program test-thread-cancel.c
+build_sources_program test-thread-cancel_state_set.c
+build_sources_program test-thread-cancel_test.c
+build_sources_program test-thread-cancel_type_set.c
+build_sources_program test-thread-clock_get_id.c
+build_sources_program test-thread-compare.c
+build_sources_program test-thread-condition_attribute_clock_get.c test-thread-condition_attribute_clock_set.c
+build_sources_program test-thread-condition_attribute_create.c test-thread-condition_attribute_delete.c
+build_sources_program test-thread-condition_attribute_shared_get.c test-thread-condition_attribute_shared_set.c
+build_sources_program test-thread-condition_create.c test-thread-condition_delete.c
+build_sources_program test-thread-condition_signal.c test-thread-condition_signal_all.c
+build_sources_program test-thread-condition_wait.c test-thread-condition_wait_timed.c
+build_sources_program test-thread-create.c
+build_sources_program test-thread-detach.c
+build_sources_program test-thread-exit.c
+build_sources_program test-thread-join.c test-thread-join_try.c test-thread-join_timed.c
+build_sources_program test-thread-key_create.c test-thread-key_delete.c
+build_sources_program test-thread-key_get.c test-thread-key_set.c
+build_sources_program test-thread-lock_attribute_create.c test-thread-lock_attribute_delete.c
+build_sources_program test-thread-lock_attribute_shared_get.c test-thread-lock_attribute_shared_set.c
+build_sources_program test-thread-lock_create.c test-thread-lock_delete.c
+build_sources_program test-thread-lock_read.c test-thread-lock_read_timed.c test-thread-lock_read_try.c
+build_sources_program test-thread-lock_write.c test-thread-lock_write_timed.c test-thread-lock_write_try.c
+build_sources_program test-thread-mutex_attribute_create.c test-thread-mutex_attribute_delete.c
+build_sources_program test-thread-mutex_attribute_priority_ceiling_get.c test-thread-mutex_attribute_priority_ceiling_set.c
+build_sources_program test-thread-mutex_attribute_shared_get.c test-thread-mutex_attribute_shared_set.c
+build_sources_program test-thread-mutex_attribute_type_get.c test-thread-mutex_attribute_type_set.c
+build_sources_program test-thread-mutex_attribute_protocol_get.c test-thread-mutex_attribute_protocol_set.c
+build_sources_program test-thread-mutex_create.c test-thread-mutex_delete.c
+build_sources_program test-thread-mutex_lock.c test-thread-mutex_lock_timed.c test-thread-mutex_lock_try.c
build_sources_program test-thread.c
return 0;
}
-int __wrap_pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize) {
+int __wrap_pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_barrier_destroy(pthread_barrier_t *barrier) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned count) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_barrier_wait(pthread_barrier_t *barrier) {
const bool failure = mock_type(bool);
return 0;
}
-int __wrap_pthread_barrier_destroy(pthread_barrier_t *barrier) {
+int __wrap_pthread_cancel(pthread_t pthread) {
const bool failure = mock_type(bool);
return 0;
}
-int __wrap_pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned count) {
+int __wrap_pthread_cond_broadcast(pthread_cond_t *__cond) {
const bool failure = mock_type(bool);
return 0;
}
+int __wrap_pthread_cond_destroy(pthread_cond_t *__mutex) {
-int __wrap_pthread_barrier_wait(pthread_barrier_t *barrier) {
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+int __wrap_pthread_cond_init(pthread_cond_t *__cond, const pthread_condattr_t *__attr) {
const bool failure = mock_type(bool);
return 0;
}
-int __wrap_pthread_condattr_getclock(const pthread_condattr_t * restrict attr, clockid_t * restrict clock_id) {
+int __wrap_pthread_cond_signal(pthread_cond_t *__cond) {
const bool failure = mock_type(bool);
return 0;
}
-int __wrap_pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id) {
+int __wrap_pthread_cond_timedwait(pthread_cond_t *__cond, pthread_mutex_t *__mutex, const struct timespec *__abstime) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_cond_wait(pthread_cond_t *__cond, pthread_mutex_t *__mutex) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_condattr_destroy(pthread_condattr_t *__attr) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_condattr_getclock(const pthread_condattr_t * restrict attr, clockid_t * restrict clock_id) {
const bool failure = mock_type(bool);
return 0;
}
+int __wrap_pthread_condattr_init(pthread_condattr_t *__attr) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
int __wrap_pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared) {
const bool failure = mock_type(bool);
return 0;
}
+int __wrap_pthread_create(pthread_t *pthread, const pthread_attr_t *attr, void *(*routine)(void *), void *arg) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_detach(pthread_t pthread) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_equal(pthread_t __t1, pthread_t __t2) {
+
+ return mock_type(int);
+}
+
+void __wrap_pthread_exit(void *value) {
+
+ if (value) {
+ int *v = (int *) value;
+
+ *v = mock_type(int);
+ }
+}
+
int __wrap_pthread_getattr_default_np(pthread_attr_t *attr) {
const bool failure = mock_type(bool);
return 0;
}
+int __wrap_pthread_getconcurrency(void) {
+
+ return mock_type(int);;
+}
+
+int __wrap_pthread_getcpuclockid(pthread_t thread, clockid_t *clock_id) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+void *__wrap_pthread_getspecific(pthread_key_t key) {
+
+ return mock_type(void *);
+}
+
+int __wrap_pthread_join(pthread_t pthread, void **value_ptr) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_key_create(pthread_key_t *key, void (*destructor)(void *)) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
int __wrap_pthread_key_delete(pthread_key_t key) {
return mock_type(int);
}
+pthread_t __wrap_pthread_self(void) {
+
+ return mock_type(int);
+}
+
int __wrap_pthread_setattr_default_np(const pthread_attr_t *attr) {
const bool failure = mock_type(bool);
return 0;
}
-void stub(void) {
+int __wrap_pthread_setcancelstate(int state, int *oldstate) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_setcanceltype(int type, int *oldtype) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_setconcurrency(int new_level) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_setspecific(pthread_key_t key, const void *value) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+void __wrap_pthread_testcancel(void) {
+}
+
+int __wrap_pthread_timedjoin_np(pthread_t thread, void **retval) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_tryjoin_np(pthread_t thread, void **retval, const struct timespec *abstime) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlock_destroy(pthread_rwlock_t *rwlock) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock, const struct timespec *abstime) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock, const struct timespec *abstime) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlock_unlock(pthread_rwlock_t *rwlock) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlockattr_init(pthread_rwlockattr_t *attr) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *attr, int *pshared) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr, int pshared) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutex_destroy(pthread_mutex_t *mutex) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutex_lock(pthread_mutex_t *mutex) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *timeout) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutex_trylock(pthread_mutex_t *mutex) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutex_unlock(pthread_mutex_t *mutex) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutexattr_destroy(pthread_mutexattr_t *attr) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutexattr_init(pthread_mutexattr_t *attr) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr, int *prioceiling) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr, int *protocol) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr, int *pshared) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *kind) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr, int prioceiling) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+int __wrap_sem_destroy(sem_t *sem) {
+
+ const bool failure = mock_type(bool);
+
+ if (failure) {
+ return mock_type(int);
+ }
+
+ return 0;
+}
+
+void stub(void) {
+}
+
+void stub_other(void *arguments) {
+}
+
+void * stub_callback(void * const arguments) {
+
+ return 0;
}
#ifdef __cplusplus
extern int __wrap_pthread_attr_setscope(pthread_attr_t *attr, int contentionscope);
extern int __wrap_pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr, size_t stacksize);
extern int __wrap_pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize);
+extern int __wrap_pthread_barrier_destroy(pthread_barrier_t *barrier);
+extern int __wrap_pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned count);
+extern int __wrap_pthread_barrier_wait(pthread_barrier_t *barrier);
extern int __wrap_pthread_barrierattr_destroy(pthread_barrierattr_t *attr);
extern int __wrap_pthread_barrierattr_init(pthread_barrierattr_t *attr);
extern int __wrap_pthread_barrierattr_getpshared(const pthread_barrierattr_t *attr, int *pshared);
extern int __wrap_pthread_barrierattr_setpshared(pthread_barrierattr_t *attr, int pshared);
-extern int __wrap_pthread_barrier_destroy(pthread_barrier_t *barrier);
-extern int __wrap_pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned count);
-extern int __wrap_pthread_barrier_wait(pthread_barrier_t *barrier);
+extern int __wrap_pthread_cancel(pthread_t pthread);
+extern int __wrap_pthread_cond_broadcast(pthread_cond_t *__cond);
+extern int __wrap_pthread_cond_destroy(pthread_cond_t *__mutex);
+extern int __wrap_pthread_cond_init(pthread_cond_t *__cond, const pthread_condattr_t *__attr);
+extern int __wrap_pthread_cond_signal(pthread_cond_t *__cond);
+extern int __wrap_pthread_cond_timedwait(pthread_cond_t *__cond, pthread_mutex_t *__mutex, const struct timespec *__abstime);
+extern int __wrap_pthread_cond_wait(pthread_cond_t *__cond, pthread_mutex_t *__mutex);
+extern int __wrap_pthread_condattr_destroy(pthread_condattr_t *__attr);
extern int __wrap_pthread_condattr_getclock(const pthread_condattr_t * restrict attr, clockid_t * restrict clock_id);
extern int __wrap_pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared);
+extern int __wrap_pthread_condattr_init(pthread_condattr_t *__attr);
extern int __wrap_pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id);
extern int __wrap_pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared);
+extern int __wrap_pthread_create(pthread_t *pthread, const pthread_attr_t *attr, void *(*routine)(void *), void *arg);
+extern int __wrap_pthread_detach(pthread_t pthread);
+extern int __wrap_pthread_equal(pthread_t __t1, pthread_t __t2);
+extern void __wrap_pthread_exit(void *value);
extern int __wrap_pthread_getattr_default_np(pthread_attr_t *attr);
+extern int __wrap_pthread_getconcurrency(void);
+extern int __wrap_pthread_getcpuclockid(pthread_t thread, clockid_t *clock_id);
+extern void *__wrap_pthread_getspecific(pthread_key_t key);
+extern int __wrap_pthread_join(pthread_t pthread, void **value_ptr);
+extern int __wrap_pthread_key_create(pthread_key_t *key, void (*destructor)(void*));
extern int __wrap_pthread_key_delete(pthread_key_t key);
+extern pthread_t __wrap_pthread_self(void);
extern int __wrap_pthread_setattr_default_np(const pthread_attr_t *attr);
+extern int __wrap_pthread_setcancelstate(int state, int *oldstate);
+extern int __wrap_pthread_setcanceltype(int type, int *oldtype);
+extern int __wrap_pthread_setconcurrency(int new_level);
+extern int __wrap_pthread_setspecific(pthread_key_t key, const void *value);
+extern void __wrap_pthread_testcancel(void);
+extern int __wrap_pthread_timedjoin_np(pthread_t thread, void **retval);
+extern int __wrap_pthread_tryjoin_np(pthread_t thread, void **retval, const struct timespec *abstime);
+extern int __wrap_pthread_rwlock_destroy(pthread_rwlock_t *rwlock);
+extern int __wrap_pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr);
+extern int __wrap_pthread_rwlock_rdlock(pthread_rwlock_t *rwlock);
+extern int __wrap_pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock, const struct timespec *abstime);
+extern int __wrap_pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock, const struct timespec *abstime);
+extern int __wrap_pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock);
+extern int __wrap_pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock);
+extern int __wrap_pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
+extern int __wrap_pthread_rwlock_wrlock(pthread_rwlock_t *rwlock);
+extern int __wrap_pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr);
+extern int __wrap_pthread_rwlockattr_init(pthread_rwlockattr_t *attr);
+extern int __wrap_pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *attr, int *pshared);
+extern int __wrap_pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr, int pshared);
+extern int __wrap_pthread_mutex_destroy(pthread_mutex_t *mutex);
+extern int __wrap_pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr);
+extern int __wrap_pthread_mutex_lock(pthread_mutex_t *mutex);
+extern int __wrap_pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *timeout);
+extern int __wrap_pthread_mutex_trylock(pthread_mutex_t *mutex);
+extern int __wrap_pthread_mutex_unlock(pthread_mutex_t *mutex);
+extern int __wrap_pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
+extern int __wrap_pthread_mutexattr_init(pthread_mutexattr_t *attr);
+extern int __wrap_pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr, int *prioceiling);
+extern int __wrap_pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr, int *protocol);
+extern int __wrap_pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr, int *pshared);
+extern int __wrap_pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *kind);
+extern int __wrap_pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr, int prioceiling);
+extern int __wrap_pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol);
+extern int __wrap_pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared);
+extern int __wrap_pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind);
+extern int __wrap_sem_destroy(sem_t *sem);
/*
-pthread_setcancelstate
-pthread_testcancel
-pthread_setcanceltype
-pthread_getcpuclockid
-pthread_equal
-pthread_getconcurrency
-pthread_setconcurrency
-pthread_condattr_init
-pthread_cond_init
-pthread_cond_broadcast
-pthread_cond_signal
-pthread_cond_wait
-pthread_cond_timedwait
-pthread_create
-pthread_detach
-pthread_exit
-pthread_join
-pthread_tryjoin_np
-pthread_timedjoin_np
-pthread_key_create
-pthread_getspecific
-pthread_setspecific
-pthread_rwlockattr_init
-pthread_rwlockattr_getpshared
-pthread_rwlockattr_setpshared
-pthread_rwlock_init
-pthread_rwlock_rdlock
-pthread_rwlock_timedrdlock
-pthread_rwlock_tryrdlock
-pthread_rwlock_wrlock
-pthread_rwlock_timedwrlock
-pthread_rwlock_trywrlock
-pthread_mutexattr_init
-pthread_mutexattr_getprioceiling
-pthread_mutexattr_setprioceiling
-pthread_mutexattr_getpshared
-pthread_mutexattr_setpshared
-pthread_mutexattr_gettype
-pthread_mutexattr_settype
-pthread_mutexattr_getprotocol
-pthread_mutexattr_setprotocol
-pthread_mutex_init
-pthread_mutex_lock
-pthread_mutex_timedlock
-pthread_mutex_trylock
sem_init
sem_open
sem_close
*/
extern void stub(void);
+/**
+ * A stub intended to be used for passing to functions like f_thread_key_create().
+ */
+extern void stub_other(void *arguments);
+
+/**
+ * A stub intended to be used for passing to functions like f_thread_create().
+ */
+extern void *stub_callback(void * const arguments);
+
#ifdef __cplusplus
} // extern "C"
#endif
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-attribute_concurrency_get.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_attribute_concurrency_get__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_attribute_concurrency_get(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_attribute_concurrency_get__works(void **state) {
+
+ int level = 0;
+
+ {
+ will_return(__wrap_pthread_getconcurrency, 1);
+
+ const f_status_t status = f_thread_attribute_concurrency_get(&level);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(level, 1);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__attribute_concurrency_get_h
+#define _TEST__F_thread__attribute_concurrency_get_h
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_attribute_concurrency_get()
+ */
+extern void test__f_thread_attribute_concurrency_get__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_attribute_concurrency_get()
+ */
+extern void test__f_thread_attribute_concurrency_get__works(void **state);
+
+#endif // _TEST__F_thread__attribute_concurrency_get_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-attribute_concurrency_set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_attribute_concurrency_set__fails(void **state) {
+
+ int level = 0;
+
+ int errnos[] = {
+ EAGAIN,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_resource_not,
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 3; ++i) {
+
+ will_return(__wrap_pthread_setconcurrency, true);
+ will_return(__wrap_pthread_setconcurrency, errnos[i]);
+
+ const f_status_t status = f_thread_attribute_concurrency_set(level);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_attribute_concurrency_set__works(void **state) {
+
+ int level = 0;
+
+ {
+ will_return(__wrap_pthread_setconcurrency, false);
+
+ const f_status_t status = f_thread_attribute_concurrency_set(level);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__attribute_concurrency_set_h
+#define _TEST__F_thread__attribute_concurrency_set_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_attribute_concurrency_set()
+ */
+extern void test__f_thread_attribute_concurrency_set__fails(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_attribute_concurrency_set()
+ */
+extern void test__f_thread_attribute_concurrency_set__works(void **state);
+
+#endif // _TEST__F_thread__attribute_concurrency_set_h
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.5
- * Licenses: lgpl-2.1-or-later
- *
- * Test the thread project.
- */
-#ifndef _TEST__F_thread__attribute_condition_clock_get_h
-#define _TEST__F_thread__attribute_condition_clock_get_h
-
-/**
- * Test that function fails.
- *
- * @see f_thread_attribute_condition_clock_get()
- */
-extern void test__f_thread_attribute_condition_clock_get__fails(void **state);
-
-/**
- * Test that parameter checking works as expected.
- *
- * @see f_thread_attribute_condition_clock_get()
- */
-extern void test__f_thread_attribute_condition_clock_get__parameter_checking(void **state);
-
-/**
- * Test that function works.
- *
- * @see f_thread_attribute_condition_clock_get()
- */
-extern void test__f_thread_attribute_condition_clock_get__works(void **state);
-
-#endif // _TEST__F_thread__attribute_condition_clock_get_h
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.5
- * Licenses: lgpl-2.1-or-later
- *
- * Test the thread project.
- */
-#ifndef _TEST__F_thread__attribute_condition_clock_set_h
-#define _TEST__F_thread__attribute_condition_clock_set_h
-
-/**
- * Test that function fails.
- *
- * @see f_thread_attribute_condition_clock_set()
- */
-extern void test__f_thread_attribute_condition_clock_set__fails(void **state);
-
-/**
- * Test that parameter checking works as expected.
- *
- * @see f_thread_attribute_condition_clock_set()
- */
-extern void test__f_thread_attribute_condition_clock_set__parameter_checking(void **state);
-
-/**
- * Test that function works.
- *
- * @see f_thread_attribute_condition_clock_set()
- */
-extern void test__f_thread_attribute_condition_clock_set__works(void **state);
-
-#endif // _TEST__F_thread__attribute_condition_clock_set_h
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.5
- * Licenses: lgpl-2.1-or-later
- *
- * Test the thread project.
- */
-#ifndef _TEST__F_thread__attribute_condition_shared_get_h
-#define _TEST__F_thread__attribute_condition_shared_get_h
-
-/**
- * Test that function fails.
- *
- * @see f_thread_attribute_condition_shared_get()
- */
-extern void test__f_thread_attribute_condition_shared_get__fails(void **state);
-
-/**
- * Test that parameter checking works as expected.
- *
- * @see f_thread_attribute_condition_shared_get()
- */
-extern void test__f_thread_attribute_condition_shared_get__parameter_checking(void **state);
-
-/**
- * Test that function works.
- *
- * @see f_thread_attribute_condition_shared_get()
- */
-extern void test__f_thread_attribute_condition_shared_get__works(void **state);
-
-#endif // _TEST__F_thread__attribute_condition_shared_get_h
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.5
- * Licenses: lgpl-2.1-or-later
- *
- * Test the thread project.
- */
-#ifndef _TEST__F_thread__attribute_condition_shared_set_h
-#define _TEST__F_thread__attribute_condition_shared_set_h
-
-/**
- * Test that function fails.
- *
- * @see f_thread_attribute_condition_shared_set()
- */
-extern void test__f_thread_attribute_condition_shared_set__fails(void **state);
-
-/**
- * Test that parameter checking works as expected.
- *
- * @see f_thread_attribute_condition_shared_set()
- */
-extern void test__f_thread_attribute_condition_shared_set__parameter_checking(void **state);
-
-/**
- * Test that function works.
- *
- * @see f_thread_attribute_condition_shared_set()
- */
-extern void test__f_thread_attribute_condition_shared_set__works(void **state);
-
-#endif // _TEST__F_thread__attribute_condition_shared_set_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-caller.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_caller__works(void **state) {
+
+ {
+ will_return(__wrap_pthread_self, 1);
+
+ const f_thread_id_t id = f_thread_caller();
+
+ assert_int_equal(id, 1);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__caller_h
+#define _TEST__F_thread__caller_h
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_caller()
+ */
+extern void test__f_thread_caller__works(void **state);
+
+#endif // _TEST__F_thread__caller_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-cancel.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_cancel__fails(void **state) {
+
+ f_thread_id_t id = f_thread_id_t_initialize;
+
+ int errnos[] = {
+ ESRCH,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_found_not,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 2; ++i) {
+
+ will_return(__wrap_pthread_cancel, true);
+ will_return(__wrap_pthread_cancel, errnos[i]);
+
+ const f_status_t status = f_thread_cancel(id);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_cancel__works(void **state) {
+
+ f_thread_id_t id = f_thread_id_t_initialize;
+
+ {
+ will_return(__wrap_pthread_cancel, false);
+
+ const f_status_t status = f_thread_cancel(id);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__cancel_h
+#define _TEST__F_thread__cancel_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_cancel()
+ */
+extern void test__f_thread_cancel__fails(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_cancel()
+ */
+extern void test__f_thread_cancel__works(void **state);
+
+#endif // _TEST__F_thread__cancel_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-cancel_state_set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_cancel_state_set__fails(void **state) {
+
+ int state_data = 0;
+ int previous = 0;
+
+ int errnos[] = {
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 2; ++i) {
+
+ will_return(__wrap_pthread_setcancelstate, true);
+ will_return(__wrap_pthread_setcancelstate, errnos[i]);
+
+ const f_status_t status = f_thread_cancel_state_set(state_data, &previous);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_cancel_state_set__works(void **state) {
+
+ int state_data = 0;
+ int previous = 0;
+
+ {
+ will_return(__wrap_pthread_setcancelstate, false);
+
+ const f_status_t status = f_thread_cancel_state_set(state_data, &previous);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__cancel_state_set_h
+#define _TEST__F_thread__cancel_state_set_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_cancel_state_set()
+ */
+extern void test__f_thread_cancel_state_set__fails(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_cancel_state_set()
+ */
+extern void test__f_thread_cancel_state_set__works(void **state);
+
+#endif // _TEST__F_thread__cancel_state_set_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-cancel_test.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_cancel_test__works(void **state) {
+
+ {
+ const f_status_t status = f_thread_cancel_test();
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__cancel_test_h
+#define _TEST__F_thread__cancel_test_h
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_cancel_test()
+ */
+extern void test__f_thread_cancel_test__works(void **state);
+
+#endif // _TEST__F_thread__cancel_test_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-cancel_type_set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_cancel_type_set__fails(void **state) {
+
+ int type = 0;
+ int previous = 0;
+
+ int errnos[] = {
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 2; ++i) {
+
+ will_return(__wrap_pthread_setcanceltype, true);
+ will_return(__wrap_pthread_setcanceltype, errnos[i]);
+
+ const f_status_t status = f_thread_cancel_type_set(type, &previous);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_cancel_type_set__works(void **state) {
+
+ int result = 0;
+ int previous = 0;
+
+ {
+ will_return(__wrap_pthread_setcanceltype, false);
+
+ const f_status_t status = f_thread_cancel_type_set(result, &previous);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__cancel_type_set_h
+#define _TEST__F_thread__cancel_type_set_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_cancel_type_set()
+ */
+extern void test__f_thread_cancel_type_set__fails(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_cancel_type_set()
+ */
+extern void test__f_thread_cancel_type_set__works(void **state);
+
+#endif // _TEST__F_thread__cancel_type_set_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-clock_get_id.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_clock_get_id__fails(void **state) {
+
+ f_thread_id_t id_thread = f_thread_id_t_initialize;
+ clockid_t id_clock;
+
+ memset(&id_clock, 0, sizeof(clockid_t));
+
+ int errnos[] = {
+ ENOENT,
+ ESRCH,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_supported_not,
+ F_found_not,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 3; ++i) {
+
+ will_return(__wrap_pthread_getcpuclockid, true);
+ will_return(__wrap_pthread_getcpuclockid, errnos[i]);
+
+ const f_status_t status = f_thread_clock_get_id(id_thread, &id_clock);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_clock_get_id__parameter_checking(void **state) {
+
+ f_thread_id_t id_thread = f_thread_id_t_initialize;
+
+ {
+ const f_status_t status = f_thread_clock_get_id(id_thread, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_clock_get_id__works(void **state) {
+
+ f_thread_id_t id_thread = f_thread_id_t_initialize;
+ clockid_t id_clock;
+
+ memset(&id_clock, 0, sizeof(clockid_t));
+
+ {
+ will_return(__wrap_pthread_getcpuclockid, false);
+
+ const f_status_t status = f_thread_clock_get_id(id_thread, &id_clock);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__clock_get_id_h
+#define _TEST__F_thread__clock_get_id_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_clock_get_id()
+ */
+extern void test__f_thread_clock_get_id__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_clock_get_id()
+ */
+extern void test__f_thread_clock_get_id__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_clock_get_id()
+ */
+extern void test__f_thread_clock_get_id__works(void **state);
+
+#endif // _TEST__F_thread__clock_get_id_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-compare.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_compare__works(void **state) {
+
+ f_thread_id_t id1 = 0;
+ f_thread_id_t id2 = 0;
+
+ {
+ will_return(__wrap_pthread_equal, false);
+
+ const f_status_t status = f_thread_compare(id1, id2);
+
+ assert_int_equal(status, F_equal_to_not);
+ }
+
+ {
+ will_return(__wrap_pthread_equal, true);
+
+ const f_status_t status = f_thread_compare(id1, id2);
+
+ assert_int_equal(status, F_equal_to);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__compare_h
+#define _TEST__F_thread__compare_h
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_compare()
+ */
+extern void test__f_thread_compare__works(void **state);
+
+#endif // _TEST__F_thread__compare_h
#include "test-thread.h"
-#include "test-thread-attribute_condition_clock_get.h"
+#include "test-thread-condition_attribute_clock_get.h"
#ifdef __cplusplus
extern "C" {
#endif
-void test__f_thread_attribute_condition_clock_get__fails(void **state) {
+void test__f_thread_condition_attribute_clock_get__fails(void **state) {
f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
clockid_t id;
will_return(__wrap_pthread_condattr_getclock, true);
will_return(__wrap_pthread_condattr_getclock, errnos[i]);
- const f_status_t status = f_thread_attribute_condition_clock_get(&attribute, &id);
+ const f_status_t status = f_thread_condition_attribute_clock_get(&attribute, &id);
assert_int_equal(status, F_status_set_error(statuss[i]));
} // for
}
-void test__f_thread_attribute_condition_clock_get__parameter_checking(void **state) {
+void test__f_thread_condition_attribute_clock_get__parameter_checking(void **state) {
f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
{
- const f_status_t status = f_thread_attribute_condition_clock_get(&attribute, 0);
+ const f_status_t status = f_thread_condition_attribute_clock_get(&attribute, 0);
assert_int_equal(status, F_status_set_error(F_parameter));
}
}
-void test__f_thread_attribute_condition_clock_get__works(void **state) {
+void test__f_thread_condition_attribute_clock_get__works(void **state) {
f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
clockid_t id;
{
will_return(__wrap_pthread_condattr_getclock, false);
- const f_status_t status = f_thread_attribute_condition_clock_get(&attribute, &id);
+ const f_status_t status = f_thread_condition_attribute_clock_get(&attribute, &id);
assert_int_equal(status, F_none);
}
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_attribute_clock_get_h
+#define _TEST__F_thread__condition_attribute_clock_get_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_attribute_clock_get()
+ */
+extern void test__f_thread_condition_attribute_clock_get__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_attribute_clock_get()
+ */
+extern void test__f_thread_condition_attribute_clock_get__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_attribute_clock_get()
+ */
+extern void test__f_thread_condition_attribute_clock_get__works(void **state);
+
+#endif // _TEST__F_thread__condition_attribute_clock_get_h
#include "test-thread.h"
-#include "test-thread-attribute_condition_clock_set.h"
+#include "test-thread-condition_attribute_clock_set.h"
#ifdef __cplusplus
extern "C" {
#endif
-void test__f_thread_attribute_condition_clock_set__fails(void **state) {
+void test__f_thread_condition_attribute_clock_set__fails(void **state) {
f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
will_return(__wrap_pthread_condattr_setclock, true);
will_return(__wrap_pthread_condattr_setclock, errnos[i]);
- const f_status_t status = f_thread_attribute_condition_clock_set(0, &attribute);
+ const f_status_t status = f_thread_condition_attribute_clock_set(0, &attribute);
assert_int_equal(status, F_status_set_error(statuss[i]));
} // for
}
-void test__f_thread_attribute_condition_clock_set__parameter_checking(void **state) {
+void test__f_thread_condition_attribute_clock_set__parameter_checking(void **state) {
{
- const f_status_t status = f_thread_attribute_condition_clock_set(0, 0);
+ const f_status_t status = f_thread_condition_attribute_clock_set(0, 0);
assert_int_equal(status, F_status_set_error(F_parameter));
}
}
-void test__f_thread_attribute_condition_clock_set__works(void **state) {
+void test__f_thread_condition_attribute_clock_set__works(void **state) {
f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
{
will_return(__wrap_pthread_condattr_setclock, false);
- const f_status_t status = f_thread_attribute_condition_clock_set(0, &attribute);
+ const f_status_t status = f_thread_condition_attribute_clock_set(0, &attribute);
assert_int_equal(status, F_none);
}
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_attribute_clock_set_h
+#define _TEST__F_thread__condition_attribute_clock_set_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_attribute_clock_set()
+ */
+extern void test__f_thread_condition_attribute_clock_set__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_attribute_clock_set()
+ */
+extern void test__f_thread_condition_attribute_clock_set__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_attribute_clock_set()
+ */
+extern void test__f_thread_condition_attribute_clock_set__works(void **state);
+
+#endif // _TEST__F_thread__condition_attribute_clock_set_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-condition_attribute_create.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_condition_attribute_create__fails(void **state) {
+
+ f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
+
+ int errnos[] = {
+ EINVAL,
+ ENOMEM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_memory_not,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 3; ++i) {
+
+ will_return(__wrap_pthread_condattr_init, true);
+ will_return(__wrap_pthread_condattr_init, errnos[i]);
+
+ const f_status_t status = f_thread_condition_attribute_create(&attribute);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_condition_attribute_create__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_condition_attribute_create(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_condition_attribute_create__works(void **state) {
+
+ f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
+
+ {
+ will_return(__wrap_pthread_condattr_init, false);
+
+ const f_status_t status = f_thread_condition_attribute_create(&attribute);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_attribute_create_h
+#define _TEST__F_thread__condition_attribute_create_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_attribute_create()
+ */
+extern void test__f_thread_condition_attribute_create__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_attribute_create()
+ */
+extern void test__f_thread_condition_attribute_create__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_attribute_create()
+ */
+extern void test__f_thread_condition_attribute_create__works(void **state);
+
+#endif // _TEST__F_thread__condition_attribute_create_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-condition_attribute_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_condition_attribute_delete__fails(void **state) {
+
+ f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
+
+ int errnos[] = {
+ EBUSY,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_busy,
+ F_parameter,
+ 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_attribute_delete(&attribute);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_condition_attribute_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_condition_attribute_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_condition_attribute_delete__works(void **state) {
+
+ f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
+
+ {
+ will_return(__wrap_pthread_condattr_destroy, false);
+
+ const f_status_t status = f_thread_condition_attribute_delete(&attribute);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_attribute_delete_h
+#define _TEST__F_thread__condition_attribute_delete_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_attribute_delete()
+ */
+extern void test__f_thread_condition_attribute_delete__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_attribute_delete()
+ */
+extern void test__f_thread_condition_attribute_delete__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_attribute_delete()
+ */
+extern void test__f_thread_condition_attribute_delete__works(void **state);
+
+#endif // _TEST__F_thread__condition_attribute_delete_h
#include "test-thread.h"
-#include "test-thread-attribute_condition_shared_get.h"
+#include "test-thread-condition_attribute_shared_get.h"
#ifdef __cplusplus
extern "C" {
#endif
-void test__f_thread_attribute_condition_shared_get__fails(void **state) {
+void test__f_thread_condition_attribute_shared_get__fails(void **state) {
f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
int shared = 0;
will_return(__wrap_pthread_condattr_getpshared, true);
will_return(__wrap_pthread_condattr_getpshared, errnos[i]);
- const f_status_t status = f_thread_attribute_condition_shared_get(&attribute, &shared);
+ const f_status_t status = f_thread_condition_attribute_shared_get(&attribute, &shared);
assert_int_equal(status, F_status_set_error(statuss[i]));
} // for
}
-void test__f_thread_attribute_condition_shared_get__parameter_checking(void **state) {
+void test__f_thread_condition_attribute_shared_get__parameter_checking(void **state) {
f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
int shared = 0;
{
- const f_status_t status = f_thread_attribute_condition_shared_get(0, 0);
+ const f_status_t status = f_thread_condition_attribute_shared_get(0, 0);
assert_int_equal(status, F_status_set_error(F_parameter));
}
{
- const f_status_t status = f_thread_attribute_condition_shared_get(&attribute, 0);
+ const f_status_t status = f_thread_condition_attribute_shared_get(&attribute, 0);
assert_int_equal(status, F_status_set_error(F_parameter));
}
{
- const f_status_t status = f_thread_attribute_condition_shared_get(0, &shared);
+ const f_status_t status = f_thread_condition_attribute_shared_get(0, &shared);
assert_int_equal(status, F_status_set_error(F_parameter));
}
}
-void test__f_thread_attribute_condition_shared_get__works(void **state) {
+void test__f_thread_condition_attribute_shared_get__works(void **state) {
f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
int shared = 0;
{
will_return(__wrap_pthread_condattr_getpshared, false);
- const f_status_t status = f_thread_attribute_condition_shared_get(&attribute, &shared);
+ const f_status_t status = f_thread_condition_attribute_shared_get(&attribute, &shared);
assert_int_equal(status, F_none);
}
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_attribute_shared_get_h
+#define _TEST__F_thread__condition_attribute_shared_get_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_attribute_shared_get()
+ */
+extern void test__f_thread_condition_attribute_shared_get__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_attribute_shared_get()
+ */
+extern void test__f_thread_condition_attribute_shared_get__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_attribute_shared_get()
+ */
+extern void test__f_thread_condition_attribute_shared_get__works(void **state);
+
+#endif // _TEST__F_thread__condition_attribute_shared_get_h
#include "test-thread.h"
-#include "test-thread-attribute_condition_shared_set.h"
+#include "test-thread-condition_attribute_shared_set.h"
#ifdef __cplusplus
extern "C" {
#endif
-void test__f_thread_attribute_condition_shared_set__fails(void **state) {
+void test__f_thread_condition_attribute_shared_set__fails(void **state) {
f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
will_return(__wrap_pthread_condattr_setpshared, true);
will_return(__wrap_pthread_condattr_setpshared, errnos[i]);
- const f_status_t status = f_thread_attribute_condition_shared_set(0, &attribute);
+ const f_status_t status = f_thread_condition_attribute_shared_set(0, &attribute);
assert_int_equal(status, F_status_set_error(statuss[i]));
} // for
}
-void test__f_thread_attribute_condition_shared_set__parameter_checking(void **state) {
+void test__f_thread_condition_attribute_shared_set__parameter_checking(void **state) {
{
- const f_status_t status = f_thread_attribute_condition_shared_set(0, 0);
+ const f_status_t status = f_thread_condition_attribute_shared_set(0, 0);
assert_int_equal(status, F_status_set_error(F_parameter));
}
}
-void test__f_thread_attribute_condition_shared_set__works(void **state) {
+void test__f_thread_condition_attribute_shared_set__works(void **state) {
f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
{
will_return(__wrap_pthread_condattr_setpshared, false);
- const f_status_t status = f_thread_attribute_condition_shared_set(0, &attribute);
+ const f_status_t status = f_thread_condition_attribute_shared_set(0, &attribute);
assert_int_equal(status, F_none);
}
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_attribute_shared_set_h
+#define _TEST__F_thread__condition_attribute_shared_set_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_attribute_shared_set()
+ */
+extern void test__f_thread_condition_attribute_shared_set__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_attribute_shared_set()
+ */
+extern void test__f_thread_condition_attribute_shared_set__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_attribute_shared_set()
+ */
+extern void test__f_thread_condition_attribute_shared_set__works(void **state);
+
+#endif // _TEST__F_thread__condition_attribute_shared_set_h
}
{
+ 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);
}
{
+ 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);
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-condition_create.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_condition_create__fails(void **state) {
+
+ f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBUSY,
+ EINVAL,
+ ENOMEM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_resource_not,
+ F_busy,
+ F_parameter,
+ F_memory_not,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 5; ++i) {
+
+ will_return(__wrap_pthread_cond_init, true);
+ will_return(__wrap_pthread_cond_init, errnos[i]);
+
+ const f_status_t status = f_thread_condition_create(&attribute, &condition);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_condition_create__parameter_checking(void **state) {
+
+ f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
+
+ {
+ const f_status_t status = f_thread_condition_create(&attribute, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_condition_create__works(void **state) {
+
+ f_thread_condition_attribute_t attribute = f_thread_condition_attribute_t_initialize;
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+
+ {
+ will_return(__wrap_pthread_cond_init, false);
+
+ const f_status_t status = f_thread_condition_create(&attribute, &condition);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_create_h
+#define _TEST__F_thread__condition_create_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_create()
+ */
+extern void test__f_thread_condition_create__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_create()
+ */
+extern void test__f_thread_condition_create__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_create()
+ */
+extern void test__f_thread_condition_create__works(void **state);
+
+#endif // _TEST__F_thread__condition_create_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-condition_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_condition_delete__fails(void **state) {
+
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+
+ int errnos[] = {
+ EBUSY,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_busy,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 2; ++i) {
+
+ will_return(__wrap_pthread_cond_destroy, true);
+ will_return(__wrap_pthread_cond_destroy, errnos[i]);
+
+ const f_status_t status = f_thread_condition_delete(&condition);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_condition_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_condition_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_condition_delete__works(void **state) {
+
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+
+ {
+ will_return(__wrap_pthread_cond_destroy, false);
+
+ const f_status_t status = f_thread_condition_delete(&condition);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_delete_h
+#define _TEST__F_thread__condition_delete_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_delete()
+ */
+extern void test__f_thread_condition_delete__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_delete()
+ */
+extern void test__f_thread_condition_delete__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_delete()
+ */
+extern void test__f_thread_condition_delete__works(void **state);
+
+#endif // _TEST__F_thread__condition_delete_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-condition_signal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_condition_signal__fails(void **state) {
+
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+
+ int errnos[] = {
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 2; ++i) {
+
+ will_return(__wrap_pthread_cond_signal, true);
+ will_return(__wrap_pthread_cond_signal, errnos[i]);
+
+ const f_status_t status = f_thread_condition_signal(&condition);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_condition_signal__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_condition_signal(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_condition_signal__works(void **state) {
+
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+
+ {
+ will_return(__wrap_pthread_cond_signal, false);
+
+ const f_status_t status = f_thread_condition_signal(&condition);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_signal_h
+#define _TEST__F_thread__condition_signal_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_signal()
+ */
+extern void test__f_thread_condition_signal__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_signal()
+ */
+extern void test__f_thread_condition_signal__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_signal()
+ */
+extern void test__f_thread_condition_signal__works(void **state);
+
+#endif // _TEST__F_thread__condition_signal_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-condition_signal_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_condition_signal_all__fails(void **state) {
+
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+
+ int errnos[] = {
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 2; ++i) {
+
+ will_return(__wrap_pthread_cond_broadcast, true);
+ will_return(__wrap_pthread_cond_broadcast, errnos[i]);
+
+ const f_status_t status = f_thread_condition_signal_all(&condition);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_condition_signal_all__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_condition_signal_all(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_condition_signal_all__works(void **state) {
+
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+
+ {
+ will_return(__wrap_pthread_cond_broadcast, false);
+
+ const f_status_t status = f_thread_condition_signal_all(&condition);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_signal_all_h
+#define _TEST__F_thread__condition_signal_all_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_signal_all()
+ */
+extern void test__f_thread_condition_signal_all__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_signal_all()
+ */
+extern void test__f_thread_condition_signal_all__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_signal_all()
+ */
+extern void test__f_thread_condition_signal_all__works(void **state);
+
+#endif // _TEST__F_thread__condition_signal_all_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-condition_wait.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_condition_wait__fails(void **state) {
+
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ int errnos[] = {
+ EINVAL,
+ ENOTRECOVERABLE,
+ EOWNERDEAD,
+ EPERM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_recover_not,
+ F_dead,
+ F_prohibited,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 5; ++i) {
+
+ will_return(__wrap_pthread_cond_wait, true);
+ will_return(__wrap_pthread_cond_wait, errnos[i]);
+
+ const f_status_t status = f_thread_condition_wait(&condition, &mutex);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_condition_wait__parameter_checking(void **state) {
+
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ {
+ const f_status_t status = f_thread_condition_wait(0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_condition_wait(0, &mutex);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_condition_wait(&condition, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_condition_wait__works(void **state) {
+
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ {
+ will_return(__wrap_pthread_cond_wait, false);
+
+ const f_status_t status = f_thread_condition_wait(&condition, &mutex);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_wait_h
+#define _TEST__F_thread__condition_wait_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_wait()
+ */
+extern void test__f_thread_condition_wait__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_wait()
+ */
+extern void test__f_thread_condition_wait__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_wait()
+ */
+extern void test__f_thread_condition_wait__works(void **state);
+
+#endif // _TEST__F_thread__condition_wait_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-condition_wait_timed.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_condition_wait_timed__fails(void **state) {
+
+ struct timespec wait;
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ memset(&wait, 0, sizeof(struct timespec));
+
+ int errnos[] = {
+ EINVAL,
+ ENOTRECOVERABLE,
+ EOWNERDEAD,
+ EPERM,
+ ETIMEDOUT,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_status_set_error(F_parameter),
+ F_status_set_error(F_recover_not),
+ F_status_set_error(F_dead),
+ F_status_set_error(F_prohibited),
+ F_time,
+ F_status_set_error(F_failure),
+ };
+
+ for (uint8_t i = 0; i < 6; ++i) {
+
+ will_return(__wrap_pthread_cond_timedwait, true);
+ will_return(__wrap_pthread_cond_timedwait, errnos[i]);
+
+ const f_status_t status = f_thread_condition_wait_timed(&wait, &condition, &mutex);
+
+ assert_int_equal(status, statuss[i]);
+ } // for
+}
+
+void test__f_thread_condition_wait_timed__parameter_checking(void **state) {
+
+ struct timespec wait;
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ memset(&wait, 0, sizeof(struct timespec));
+
+ {
+ const f_status_t status = f_thread_condition_wait_timed(&wait, 0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_condition_wait_timed(&wait, &condition, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_condition_wait_timed(&wait, 0, &mutex);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_condition_wait_timed__works(void **state) {
+
+ struct timespec wait;
+ f_thread_condition_t condition = f_thread_condition_t_initialize;
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ memset(&wait, 0, sizeof(struct timespec));
+
+ {
+ will_return(__wrap_pthread_cond_timedwait, false);
+
+ const f_status_t status = f_thread_condition_wait_timed(&wait, &condition, &mutex);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__condition_wait_timed_h
+#define _TEST__F_thread__condition_wait_timed_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_condition_wait_timed()
+ */
+extern void test__f_thread_condition_wait_timed__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_condition_wait_timed()
+ */
+extern void test__f_thread_condition_wait_timed__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_condition_wait_timed()
+ */
+extern void test__f_thread_condition_wait_timed__works(void **state);
+
+#endif // _TEST__F_thread__condition_wait_timed_h
}
{
+ 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);
}
{
+ 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);
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-create.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_create__fails(void **state) {
+
+ f_thread_attribute_t attribute = f_thread_attribute_t_initialize;
+ f_thread_id_t id = f_thread_id_t_initialize;
+ int argument = 0;
+
+ int errnos[] = {
+ EAGAIN,
+ EINVAL,
+ EPERM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_resource_not,
+ F_parameter,
+ F_prohibited,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 4; ++i) {
+
+ will_return(__wrap_pthread_create, true);
+ will_return(__wrap_pthread_create, errnos[i]);
+
+ const f_status_t status = f_thread_create(&attribute, &id, stub_callback, &argument);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_create__parameter_checking(void **state) {
+
+ f_thread_attribute_t attribute = f_thread_attribute_t_initialize;
+ f_thread_id_t id = f_thread_id_t_initialize;
+
+ {
+ const f_status_t status = f_thread_create(&attribute, 0, 0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_create(&attribute, &id, 0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_create(&attribute, 0, stub_callback, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_create__works(void **state) {
+
+ f_thread_attribute_t attribute = f_thread_attribute_t_initialize;
+ f_thread_id_t id = f_thread_id_t_initialize;
+ int argument = 0;
+
+ {
+ will_return(__wrap_pthread_create, false);
+
+ const f_status_t status = f_thread_create(&attribute, &id, stub_callback, &argument);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__create_h
+#define _TEST__F_thread__create_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_create()
+ */
+extern void test__f_thread_create__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_create()
+ */
+extern void test__f_thread_create__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_create()
+ */
+extern void test__f_thread_create__works(void **state);
+
+#endif // _TEST__F_thread__create_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-detach.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_detach__fails(void **state) {
+
+ f_thread_id_t id = 0;
+
+ int errnos[] = {
+ EINVAL,
+ ESRCH,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_found_not,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 3; ++i) {
+
+ will_return(__wrap_pthread_detach, true);
+ will_return(__wrap_pthread_detach, errnos[i]);
+
+ const f_status_t status = f_thread_detach(id);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_detach__works(void **state) {
+
+ f_thread_id_t id = 0;
+
+ {
+ will_return(__wrap_pthread_detach, false);
+
+ const f_status_t status = f_thread_detach(id);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__detach_h
+#define _TEST__F_thread__detach_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_detach()
+ */
+extern void test__f_thread_detach__fails(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_detach()
+ */
+extern void test__f_thread_detach__works(void **state);
+
+#endif // _TEST__F_thread__detach_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-exit.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_exit__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_exit(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_exit__works(void **state) {
+
+ int result = 0;
+
+ {
+ will_return(__wrap_pthread_exit, 1);
+
+ const f_status_t status = f_thread_exit(&result);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(result, 1);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__exit_h
+#define _TEST__F_thread__exit_h
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_exit()
+ */
+extern void test__f_thread_exit__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_exit()
+ */
+extern void test__f_thread_exit__works(void **state);
+
+#endif // _TEST__F_thread__exit_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-join.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_join__fails(void **state) {
+
+ f_thread_id_t id = f_thread_id_t_initialize;
+
+ int errnos[] = {
+ EDEADLK,
+ EINVAL,
+ EPERM,
+ ESRCH,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_deadlock,
+ F_parameter,
+ F_supported_not,
+ F_found_not,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 5; ++i) {
+
+ will_return(__wrap_pthread_join, true);
+ will_return(__wrap_pthread_join, errnos[i]);
+
+ const f_status_t status = f_thread_join(id, 0);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_join__works(void **state) {
+
+ f_thread_id_t id = f_thread_id_t_initialize;
+
+ {
+ will_return(__wrap_pthread_join, false);
+
+ const f_status_t status = f_thread_join(id, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__join_h
+#define _TEST__F_thread__join_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_join()
+ */
+extern void test__f_thread_join__fails(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_join()
+ */
+extern void test__f_thread_join__works(void **state);
+
+#endif // _TEST__F_thread__join_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-join_timed.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_join_timed__fails(void **state) {
+
+ f_thread_id_t id = f_thread_id_t_initialize;
+ struct timespec wait;
+
+ memset(&wait, 0, sizeof(struct timespec));
+
+ int errnos[] = {
+ EBUSY,
+ EDEADLK,
+ EINVAL,
+ EPERM,
+ ESRCH,
+ ETIMEDOUT,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_busy,
+ F_status_set_error(F_deadlock),
+ F_status_set_error(F_parameter),
+ F_status_set_error(F_supported_not),
+ F_status_set_error(F_found_not),
+ F_time,
+ F_status_set_error(F_failure),
+ };
+
+ for (uint8_t i = 0; i < 7; ++i) {
+
+ will_return(__wrap_pthread_timedjoin_np, true);
+ will_return(__wrap_pthread_timedjoin_np, errnos[i]);
+
+ const f_status_t status = f_thread_join_timed(id, wait, 0);
+
+ assert_int_equal(status, statuss[i]);
+ } // for
+}
+
+void test__f_thread_join_timed__works(void **state) {
+
+ f_thread_id_t id = f_thread_id_t_initialize;
+ struct timespec wait;
+
+ memset(&wait, 0, sizeof(struct timespec));
+
+ {
+ will_return(__wrap_pthread_timedjoin_np, false);
+
+ const f_status_t status = f_thread_join_timed(id, wait, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__join_timed_h
+#define _TEST__F_thread__join_timed_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_join_timed()
+ */
+extern void test__f_thread_join_timed__fails(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_join_timed()
+ */
+extern void test__f_thread_join_timed__works(void **state);
+
+#endif // _TEST__F_thread__join_timed_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-join_try.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_join_try__fails(void **state) {
+
+ f_thread_id_t id = f_thread_id_t_initialize;
+
+ int errnos[] = {
+ EBUSY,
+ EDEADLK,
+ EINVAL,
+ EPERM,
+ ESRCH,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_busy,
+ F_status_set_error(F_deadlock),
+ F_status_set_error(F_parameter),
+ F_status_set_error(F_supported_not),
+ F_status_set_error(F_found_not),
+ F_status_set_error(F_failure),
+ };
+
+ for (uint8_t i = 0; i < 6; ++i) {
+
+ will_return(__wrap_pthread_tryjoin_np, true);
+ will_return(__wrap_pthread_tryjoin_np, errnos[i]);
+
+ const f_status_t status = f_thread_join_try(id, 0);
+
+ assert_int_equal(status, statuss[i]);
+ } // for
+}
+
+void test__f_thread_join_try__works(void **state) {
+
+ f_thread_id_t id = f_thread_id_t_initialize;
+
+ {
+ will_return(__wrap_pthread_tryjoin_np, false);
+
+ const f_status_t status = f_thread_join_try(id, 0);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__join_try_h
+#define _TEST__F_thread__join_try_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_join_try()
+ */
+extern void test__f_thread_join_try__fails(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_join_try()
+ */
+extern void test__f_thread_join_try__works(void **state);
+
+#endif // _TEST__F_thread__join_try_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-key_create.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_key_create__fails(void **state) {
+
+ f_thread_key_t key = f_thread_key_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ ENOMEM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_resource_not,
+ F_memory_not,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 3; ++i) {
+
+ will_return(__wrap_pthread_key_create, true);
+ will_return(__wrap_pthread_key_create, errnos[i]);
+
+ const f_status_t status = f_thread_key_create(stub_other, &key);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_key_create__parameter_checking(void **state) {
+
+ f_thread_key_t key = f_thread_key_t_initialize;
+
+ {
+ const f_status_t status = f_thread_key_create(0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_key_create(stub_other, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_key_create(0, &key);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_key_create__works(void **state) {
+
+ f_thread_key_t key = f_thread_key_t_initialize;
+
+ {
+ will_return(__wrap_pthread_key_create, false);
+
+ const f_status_t status = f_thread_key_create(stub_other, &key);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__key_create_h
+#define _TEST__F_thread__key_create_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_key_create()
+ */
+extern void test__f_thread_key_create__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_key_create()
+ */
+extern void test__f_thread_key_create__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_key_create()
+ */
+extern void test__f_thread_key_create__works(void **state);
+
+#endif // _TEST__F_thread__key_create_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-key_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_key_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_key_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_key_delete__works(void **state) {
+
+ f_thread_key_t key = f_thread_key_t_initialize;
+
+ {
+ will_return(__wrap_pthread_key_delete, false);
+
+ const f_status_t status = f_thread_key_delete(&key);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__key_delete_h
+#define _TEST__F_thread__key_delete_h
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_key_delete()
+ */
+extern void test__f_thread_key_delete__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_key_delete()
+ */
+extern void test__f_thread_key_delete__works(void **state);
+
+#endif // _TEST__F_thread__key_delete_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-key_get.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_key_get__parameter_checking(void **state) {
+
+ f_thread_key_t key = f_thread_key_t_initialize;
+
+ {
+ const f_status_t status = f_thread_key_get(key, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_key_get__works(void **state) {
+
+ f_thread_key_t key = f_thread_key_t_initialize;
+ int value = 0;
+ int *value_ptr = &value;
+ int expect = 1;
+
+ {
+ will_return(__wrap_pthread_getspecific, (void *) &expect);
+
+ const f_status_t status = f_thread_key_get(key, (void *) &value_ptr);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(value_ptr, &expect);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__key_get_h
+#define _TEST__F_thread__key_get_h
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_key_get()
+ */
+extern void test__f_thread_key_get__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_key_get()
+ */
+extern void test__f_thread_key_get__works(void **state);
+
+#endif // _TEST__F_thread__key_get_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-key_set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_key_set__fails(void **state) {
+
+ f_thread_key_t key = f_thread_key_t_initialize;
+ int value = 0;
+
+ int errnos[] = {
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 2; ++i) {
+
+ will_return(__wrap_pthread_setspecific, true);
+ will_return(__wrap_pthread_setspecific, errnos[i]);
+
+ const f_status_t status = f_thread_key_set(key, &value);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_key_set__parameter_checking(void **state) {
+
+ f_thread_key_t key = f_thread_key_t_initialize;
+
+ {
+ const f_status_t status = f_thread_key_set(key, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_key_set__works(void **state) {
+
+ f_thread_key_t key = f_thread_key_t_initialize;
+ int value = 0;
+
+ {
+ will_return(__wrap_pthread_setspecific, false);
+
+ const f_status_t status = f_thread_key_set(key, &value);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__key_set_h
+#define _TEST__F_thread__key_set_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_key_set()
+ */
+extern void test__f_thread_key_set__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_key_set()
+ */
+extern void test__f_thread_key_set__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_key_set()
+ */
+extern void test__f_thread_key_set__works(void **state);
+
+#endif // _TEST__F_thread__key_set_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_attribute_create.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_attribute_create__fails(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBUSY,
+ EINVAL,
+ ENOMEM,
+ EPERM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_resource_not,
+ F_busy,
+ F_parameter,
+ F_memory_not,
+ F_prohibited,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 6; ++i) {
+
+ will_return(__wrap_pthread_rwlockattr_init, true);
+ will_return(__wrap_pthread_rwlockattr_init, errnos[i]);
+
+ const f_status_t status = f_thread_lock_attribute_create(&attribute);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_lock_attribute_create__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_lock_attribute_create(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_attribute_create__works(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+
+ {
+ will_return(__wrap_pthread_rwlockattr_init, false);
+
+ const f_status_t status = f_thread_lock_attribute_create(&attribute);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_attribute_create_h
+#define _TEST__F_thread__lock_attribute_create_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_lock_attribute_create()
+ */
+extern void test__f_thread_lock_attribute_create__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_attribute_create()
+ */
+extern void test__f_thread_lock_attribute_create__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_attribute_create()
+ */
+extern void test__f_thread_lock_attribute_create__works(void **state);
+
+#endif // _TEST__F_thread__lock_attribute_create_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_attribute_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_attribute_delete__fails(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+
+ int errnos[] = {
+ EBUSY,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_busy,
+ F_parameter,
+ 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_attribute_delete(&attribute);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_lock_attribute_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_lock_attribute_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_attribute_delete__works(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+
+ {
+ will_return(__wrap_pthread_rwlockattr_destroy, false);
+
+ const f_status_t status = f_thread_lock_attribute_delete(&attribute);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_attribute_delete_h
+#define _TEST__F_thread__lock_attribute_delete_h
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_attribute_delete()
+ */
+extern void test__f_thread_lock_attribute_delete__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_attribute_delete()
+ */
+extern void test__f_thread_lock_attribute_delete__works(void **state);
+
+#endif // _TEST__F_thread__lock_attribute_delete_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_attribute_shared_get.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_attribute_shared_get__fails(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+ int shared = 0;
+
+ int errnos[] = {
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 1; ++i) {
+
+ will_return(__wrap_pthread_rwlockattr_getpshared, true);
+ will_return(__wrap_pthread_rwlockattr_getpshared, errnos[i]);
+
+ const f_status_t status = f_thread_lock_attribute_shared_get(&attribute, &shared);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_lock_attribute_shared_get__parameter_checking(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+ int shared = 0;
+
+ {
+ const f_status_t status = f_thread_lock_attribute_shared_get(0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_lock_attribute_shared_get(&attribute, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_lock_attribute_shared_get(0, &shared);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_attribute_shared_get__works(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+ int shared = 0;
+
+ {
+ will_return(__wrap_pthread_rwlockattr_getpshared, false);
+
+ const f_status_t status = f_thread_lock_attribute_shared_get(&attribute, &shared);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_attribute_shared_get_h
+#define _TEST__F_thread__lock_attribute_shared_get_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_lock_attribute_shared_get()
+ */
+extern void test__f_thread_lock_attribute_shared_get__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_attribute_shared_get()
+ */
+extern void test__f_thread_lock_attribute_shared_get__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_attribute_shared_get()
+ */
+extern void test__f_thread_lock_attribute_shared_get__works(void **state);
+
+#endif // _TEST__F_thread__lock_attribute_shared_get_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_attribute_shared_set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_attribute_shared_set__fails(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+ int shared = 0;
+
+ int errnos[] = {
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 2; ++i) {
+
+ will_return(__wrap_pthread_rwlockattr_setpshared, true);
+ will_return(__wrap_pthread_rwlockattr_setpshared, errnos[i]);
+
+ const f_status_t status = f_thread_lock_attribute_shared_set(shared, &attribute);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_lock_attribute_shared_set__parameter_checking(void **state) {
+
+ int shared = 0;
+
+ {
+ const f_status_t status = f_thread_lock_attribute_shared_set(shared, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_attribute_shared_set__works(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+ int shared = 0;
+
+ {
+ will_return(__wrap_pthread_rwlockattr_setpshared, false);
+
+ const f_status_t status = f_thread_lock_attribute_shared_set(shared, &attribute);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_attribute_shared_set_h
+#define _TEST__F_thread__lock_attribute_shared_set_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_lock_attribute_shared_set()
+ */
+extern void test__f_thread_lock_attribute_shared_set__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_attribute_shared_set()
+ */
+extern void test__f_thread_lock_attribute_shared_set__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_attribute_shared_set()
+ */
+extern void test__f_thread_lock_attribute_shared_set__works(void **state);
+
+#endif // _TEST__F_thread__lock_attribute_shared_set_h
}
{
+ 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);
}
{
+ 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);
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_create.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_create__fails(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ ENOMEM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_resource_not,
+ F_memory_not,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 3; ++i) {
+
+ will_return(__wrap_pthread_rwlock_init, true);
+ will_return(__wrap_pthread_rwlock_init, errnos[i]);
+
+ const f_status_t status = f_thread_lock_create(&attribute, &lock);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_lock_create__parameter_checking(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+
+ {
+ const f_status_t status = f_thread_lock_create(&attribute, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_create__works(void **state) {
+
+ f_thread_lock_attribute_t attribute = f_thread_lock_attribute_t_initialize;
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ {
+ will_return(__wrap_pthread_rwlock_init, false);
+
+ const f_status_t status = f_thread_lock_create(&attribute, &lock);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_create_h
+#define _TEST__F_thread__lock_create_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_lock_create()
+ */
+extern void test__f_thread_lock_create__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_create()
+ */
+extern void test__f_thread_lock_create__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_create()
+ */
+extern void test__f_thread_lock_create__works(void **state);
+
+#endif // _TEST__F_thread__lock_create_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_delete__fails(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ int errnos[] = {
+ EBUSY,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_busy,
+ F_parameter,
+ 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_lock_delete(&lock);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_lock_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_lock_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_delete__works(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ {
+ will_return(__wrap_pthread_rwlock_destroy, false);
+
+ const f_status_t status = f_thread_lock_delete(&lock);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_delete_h
+#define _TEST__F_thread__lock_delete_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_lock_delete()
+ */
+extern void test__f_thread_lock_delete__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_delete()
+ */
+extern void test__f_thread_lock_delete__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_delete()
+ */
+extern void test__f_thread_lock_delete__works(void **state);
+
+#endif // _TEST__F_thread__lock_delete_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_read__fails(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EDEADLK,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_resource_not,
+ F_deadlock,
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 4; ++i) {
+
+ will_return(__wrap_pthread_rwlock_rdlock, true);
+ will_return(__wrap_pthread_rwlock_rdlock, errnos[i]);
+
+ const f_status_t status = f_thread_lock_read(&lock);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_lock_read__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_lock_read(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_read__works(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ {
+ will_return(__wrap_pthread_rwlock_rdlock, false);
+
+ const f_status_t status = f_thread_lock_read(&lock);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_read_h
+#define _TEST__F_thread__lock_read_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_lock_read()
+ */
+extern void test__f_thread_lock_read__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_read()
+ */
+extern void test__f_thread_lock_read__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_read()
+ */
+extern void test__f_thread_lock_read__works(void **state);
+
+#endif // _TEST__F_thread__lock_read_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_read_timed.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_read_timed__fails(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+ struct timespec timeout;
+
+ memset(&timeout, 0, sizeof(struct timespec));
+
+ int errnos[] = {
+ EAGAIN,
+ EDEADLK,
+ EINVAL,
+ ETIMEDOUT,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_status_set_error(F_resource_not),
+ F_status_set_error(F_deadlock),
+ F_status_set_error(F_parameter),
+ F_time,
+ F_status_set_error(F_failure),
+ };
+
+ for (uint8_t i = 0; i < 5; ++i) {
+
+ will_return(__wrap_pthread_rwlock_timedrdlock, true);
+ will_return(__wrap_pthread_rwlock_timedrdlock, errnos[i]);
+
+ const f_status_t status = f_thread_lock_read_timed(&timeout, &lock);
+
+ assert_int_equal(status, statuss[i]);
+ } // for
+}
+
+void test__f_thread_lock_read_timed__parameter_checking(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+ struct timespec timeout;
+
+ memset(&timeout, 0, sizeof(struct timespec));
+
+ {
+ const f_status_t status = f_thread_lock_read_timed(0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_lock_read_timed(&timeout, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_lock_read_timed(0, &lock);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_read_timed__works(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+ struct timespec timeout;
+
+ memset(&timeout, 0, sizeof(struct timespec));
+
+ {
+ will_return(__wrap_pthread_rwlock_timedrdlock, false);
+
+ const f_status_t status = f_thread_lock_read_timed(&timeout, &lock);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_read_timed_h
+#define _TEST__F_thread__lock_read_timed_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_lock_read_timed()
+ */
+extern void test__f_thread_lock_read_timed__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_read_timed()
+ */
+extern void test__f_thread_lock_read_timed__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_read_timed()
+ */
+extern void test__f_thread_lock_read_timed__works(void **state);
+
+#endif // _TEST__F_thread__lock_read_timed_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_read_try.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_read_try__fails(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBUSY,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_status_set_error(F_resource_not),
+ F_busy,
+ F_status_set_error(F_parameter),
+ F_status_set_error(F_failure),
+ };
+
+ for (uint8_t i = 0; i < 4; ++i) {
+
+ will_return(__wrap_pthread_rwlock_tryrdlock, true);
+ will_return(__wrap_pthread_rwlock_tryrdlock, errnos[i]);
+
+ const f_status_t status = f_thread_lock_read_try(&lock);
+
+ assert_int_equal(status, statuss[i]);
+ } // for
+}
+
+void test__f_thread_lock_read_try__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_lock_read_try(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_read_try__works(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ {
+ will_return(__wrap_pthread_rwlock_tryrdlock, false);
+
+ const f_status_t status = f_thread_lock_read_try(&lock);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_read_try_h
+#define _TEST__F_thread__lock_read_try_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_lock_read_try()
+ */
+extern void test__f_thread_lock_read_try__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_read_try()
+ */
+extern void test__f_thread_lock_read_try__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_read_try()
+ */
+extern void test__f_thread_lock_read_try__works(void **state);
+
+#endif // _TEST__F_thread__lock_read_try_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_write__fails(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EDEADLK,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_resource_not,
+ F_deadlock,
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 4; ++i) {
+
+ will_return(__wrap_pthread_rwlock_wrlock, true);
+ will_return(__wrap_pthread_rwlock_wrlock, errnos[i]);
+
+ const f_status_t status = f_thread_lock_write(&lock);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_lock_write__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_lock_write(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_write__works(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ {
+ will_return(__wrap_pthread_rwlock_wrlock, false);
+
+ const f_status_t status = f_thread_lock_write(&lock);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_write_h
+#define _TEST__F_thread__lock_write_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_lock_write()
+ */
+extern void test__f_thread_lock_write__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_write()
+ */
+extern void test__f_thread_lock_write__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_write()
+ */
+extern void test__f_thread_lock_write__works(void **state);
+
+#endif // _TEST__F_thread__lock_write_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_write_timed.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_write_timed__fails(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+ struct timespec timeout;
+
+ memset(&timeout, 0, sizeof(struct timespec));
+
+ int errnos[] = {
+ EDEADLK,
+ EINVAL,
+ ETIMEDOUT,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_status_set_error(F_deadlock),
+ F_status_set_error(F_parameter),
+ F_time,
+ F_status_set_error(F_failure),
+ };
+
+ for (uint8_t i = 0; i < 4; ++i) {
+
+ will_return(__wrap_pthread_rwlock_timedwrlock, true);
+ will_return(__wrap_pthread_rwlock_timedwrlock, errnos[i]);
+
+ const f_status_t status = f_thread_lock_write_timed(&timeout, &lock);
+
+ assert_int_equal(status, statuss[i]);
+ } // for
+}
+
+void test__f_thread_lock_write_timed__parameter_checking(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+ struct timespec timeout;
+
+ memset(&timeout, 0, sizeof(struct timespec));
+
+ {
+ const f_status_t status = f_thread_lock_write_timed(0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_lock_write_timed(&timeout, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_lock_write_timed(0, &lock);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_write_timed__works(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+ struct timespec timeout;
+
+ memset(&timeout, 0, sizeof(struct timespec));
+
+ {
+ will_return(__wrap_pthread_rwlock_timedwrlock, false);
+
+ const f_status_t status = f_thread_lock_write_timed(&timeout, &lock);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_write_timed_h
+#define _TEST__F_thread__lock_write_timed_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_lock_write_timed()
+ */
+extern void test__f_thread_lock_write_timed__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_write_timed()
+ */
+extern void test__f_thread_lock_write_timed__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_write_timed()
+ */
+extern void test__f_thread_lock_write_timed__works(void **state);
+
+#endif // _TEST__F_thread__lock_write_timed_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-lock_write_try.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_lock_write_try__fails(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBUSY,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_status_set_error(F_resource_not),
+ F_busy,
+ F_status_set_error(F_parameter),
+ F_status_set_error(F_failure),
+ };
+
+ for (uint8_t i = 0; i < 4; ++i) {
+
+ will_return(__wrap_pthread_rwlock_trywrlock, true);
+ will_return(__wrap_pthread_rwlock_trywrlock, errnos[i]);
+
+ const f_status_t status = f_thread_lock_write_try(&lock);
+
+ assert_int_equal(status, statuss[i]);
+ } // for
+}
+
+void test__f_thread_lock_write_try__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_lock_write_try(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_lock_write_try__works(void **state) {
+
+ f_thread_lock_t lock = f_thread_lock_t_initialize;
+
+ {
+ will_return(__wrap_pthread_rwlock_trywrlock, false);
+
+ const f_status_t status = f_thread_lock_write_try(&lock);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__lock_write_try_h
+#define _TEST__F_thread__lock_write_try_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_lock_write_try()
+ */
+extern void test__f_thread_lock_write_try__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_lock_write_try()
+ */
+extern void test__f_thread_lock_write_try__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_lock_write_try()
+ */
+extern void test__f_thread_lock_write_try__works(void **state);
+
+#endif // _TEST__F_thread__lock_write_try_h
}
{
+ 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);
}
{
+ 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);
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_attribute_create.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attribute_create__fails(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBUSY,
+ EINVAL,
+ ENOMEM,
+ EPERM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_resource_not,
+ F_busy,
+ F_parameter,
+ F_memory_not,
+ F_prohibited,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 6; ++i) {
+
+ will_return(__wrap_pthread_mutexattr_init, true);
+ will_return(__wrap_pthread_mutexattr_init, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_attribute_create(&attribute);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_attribute_create__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_create(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_attribute_create__works(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+
+ {
+ will_return(__wrap_pthread_mutexattr_init, false);
+
+ const f_status_t status = f_thread_mutex_attribute_create(&attribute);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_attribute_create_h
+#define _TEST__F_thread__mutex_attribute_create_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_attribute_create()
+ */
+extern void test__f_thread_mutex_attribute_create__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_attribute_create()
+ */
+extern void test__f_thread_mutex_attribute_create__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_attribute_create()
+ */
+extern void test__f_thread_mutex_attribute_create__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attribute_create_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_attribute_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attribute_delete__fails(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+
+ int errnos[] = {
+ EBUSY,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_busy,
+ F_parameter,
+ 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_attribute_delete(&attribute);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_attribute_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_attribute_delete__works(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+
+ {
+ will_return(__wrap_pthread_mutexattr_destroy, false);
+
+ const f_status_t status = f_thread_mutex_attribute_delete(&attribute);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_attribute_delete_h
+#define _TEST__F_thread__mutex_attribute_delete_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_attribute_delete()
+ */
+extern void test__f_thread_mutex_attribute_delete__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_attribute_delete()
+ */
+extern void test__f_thread_mutex_attribute_delete__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_attribute_delete()
+ */
+extern void test__f_thread_mutex_attribute_delete__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attribute_delete_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_attribute_priority_ceiling_get.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attribute_priority_ceiling_get__fails(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int ceiling = 0;
+
+ int errnos[] = {
+ EINVAL,
+ EPERM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_prohibited,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 3; ++i) {
+
+ will_return(__wrap_pthread_mutexattr_getprioceiling, true);
+ will_return(__wrap_pthread_mutexattr_getprioceiling, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_attribute_priority_ceiling_get(&attribute, &ceiling);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_attribute_priority_ceiling_get__parameter_checking(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int ceiling = 0;
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_priority_ceiling_get(0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_priority_ceiling_get(&attribute, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_priority_ceiling_get(0, &ceiling);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_attribute_priority_ceiling_get__works(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int ceiling = 0;
+
+ {
+ will_return(__wrap_pthread_mutexattr_getprioceiling, false);
+
+ const f_status_t status = f_thread_mutex_attribute_priority_ceiling_get(&attribute, &ceiling);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_attribute_priority_ceiling_get_h
+#define _TEST__F_thread__mutex_attribute_priority_ceiling_get_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_attribute_priority_ceiling_get()
+ */
+extern void test__f_thread_mutex_attribute_priority_ceiling_get__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_attribute_priority_ceiling_get()
+ */
+extern void test__f_thread_mutex_attribute_priority_ceiling_get__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_attribute_priority_ceiling_get()
+ */
+extern void test__f_thread_mutex_attribute_priority_ceiling_get__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attribute_priority_ceiling_get_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_attribute_priority_ceiling_set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attribute_priority_ceiling_set__fails(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int ceiling = 0;
+
+ int errnos[] = {
+ EINVAL,
+ EPERM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_prohibited,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 3; ++i) {
+
+ will_return(__wrap_pthread_mutexattr_setprioceiling, true);
+ will_return(__wrap_pthread_mutexattr_setprioceiling, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_attribute_priority_ceiling_set(ceiling, &attribute);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_attribute_priority_ceiling_set__parameter_checking(void **state) {
+
+ int ceiling = 0;
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_priority_ceiling_set(ceiling, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_attribute_priority_ceiling_set__works(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int ceiling = 0;
+
+ {
+ will_return(__wrap_pthread_mutexattr_setprioceiling, false);
+
+ const f_status_t status = f_thread_mutex_attribute_priority_ceiling_set(ceiling, &attribute);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_attribute_priority_ceiling_set_h
+#define _TEST__F_thread__mutex_attribute_priority_ceiling_set_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_attribute_priority_ceiling_set()
+ */
+extern void test__f_thread_mutex_attribute_priority_ceiling_set__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_attribute_priority_ceiling_set()
+ */
+extern void test__f_thread_mutex_attribute_priority_ceiling_set__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_attribute_priority_ceiling_set()
+ */
+extern void test__f_thread_mutex_attribute_priority_ceiling_set__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attribute_priority_ceiling_set_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_attribute_protocol_get.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attribute_protocol_get__fails(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int protocol = 0;
+
+ int errnos[] = {
+ EINVAL,
+ EPERM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_prohibited,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 3; ++i) {
+
+ will_return(__wrap_pthread_mutexattr_getprotocol, true);
+ will_return(__wrap_pthread_mutexattr_getprotocol, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_attribute_protocol_get(&attribute, &protocol);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_attribute_protocol_get__parameter_checking(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int protocol = 0;
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_protocol_get(0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_protocol_get(&attribute, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_protocol_get(0, &protocol);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_attribute_protocol_get__works(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int protocol = 0;
+
+ {
+ will_return(__wrap_pthread_mutexattr_getprotocol, false);
+
+ const f_status_t status = f_thread_mutex_attribute_protocol_get(&attribute, &protocol);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_attribute_protocol_get_h
+#define _TEST__F_thread__mutex_attribute_protocol_get_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_attribute_protocol_get()
+ */
+extern void test__f_thread_mutex_attribute_protocol_get__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_attribute_protocol_get()
+ */
+extern void test__f_thread_mutex_attribute_protocol_get__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_attribute_protocol_get()
+ */
+extern void test__f_thread_mutex_attribute_protocol_get__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attribute_protocol_get_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_attribute_protocol_set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attribute_protocol_set__fails(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int protocol = 0;
+
+ int errnos[] = {
+ EINVAL,
+ EPERM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_prohibited,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 3; ++i) {
+
+ will_return(__wrap_pthread_mutexattr_setprotocol, true);
+ will_return(__wrap_pthread_mutexattr_setprotocol, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_attribute_protocol_set(protocol, &attribute);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_attribute_protocol_set__parameter_checking(void **state) {
+
+ int protocol = 0;
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_protocol_set(protocol, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_attribute_protocol_set__works(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int protocol = 0;
+
+ {
+ will_return(__wrap_pthread_mutexattr_setprotocol, false);
+
+ const f_status_t status = f_thread_mutex_attribute_protocol_set(protocol, &attribute);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_attribute_protocol_set_h
+#define _TEST__F_thread__mutex_attribute_protocol_set_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_attribute_protocol_set()
+ */
+extern void test__f_thread_mutex_attribute_protocol_set__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_attribute_protocol_set()
+ */
+extern void test__f_thread_mutex_attribute_protocol_set__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_attribute_protocol_set()
+ */
+extern void test__f_thread_mutex_attribute_protocol_set__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attribute_protocol_set_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_attribute_shared_get.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attribute_shared_get__fails(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int shared = 0;
+
+ int errnos[] = {
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 1; ++i) {
+
+ will_return(__wrap_pthread_mutexattr_getpshared, true);
+ will_return(__wrap_pthread_mutexattr_getpshared, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_attribute_shared_get(&attribute, &shared);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_attribute_shared_get__parameter_checking(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int shared = 0;
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_shared_get(0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_shared_get(&attribute, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_shared_get(0, &shared);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_attribute_shared_get__works(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int shared = 0;
+
+ {
+ will_return(__wrap_pthread_mutexattr_getpshared, false);
+
+ const f_status_t status = f_thread_mutex_attribute_shared_get(&attribute, &shared);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_attribute_shared_get_h
+#define _TEST__F_thread__mutex_attribute_shared_get_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_attribute_shared_get()
+ */
+extern void test__f_thread_mutex_attribute_shared_get__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_attribute_shared_get()
+ */
+extern void test__f_thread_mutex_attribute_shared_get__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_attribute_shared_get()
+ */
+extern void test__f_thread_mutex_attribute_shared_get__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attribute_shared_get_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_attribute_shared_set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attribute_shared_set__fails(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int shared = 0;
+
+ int errnos[] = {
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 2; ++i) {
+
+ will_return(__wrap_pthread_mutexattr_setpshared, true);
+ will_return(__wrap_pthread_mutexattr_setpshared, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_attribute_shared_set(shared, &attribute);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_attribute_shared_set__parameter_checking(void **state) {
+
+ int shared = 0;
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_shared_set(shared, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_attribute_shared_set__works(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int shared = 0;
+
+ {
+ will_return(__wrap_pthread_mutexattr_setpshared, false);
+
+ const f_status_t status = f_thread_mutex_attribute_shared_set(shared, &attribute);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_attribute_shared_set_h
+#define _TEST__F_thread__mutex_attribute_shared_set_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_attribute_shared_set()
+ */
+extern void test__f_thread_mutex_attribute_shared_set__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_attribute_shared_set()
+ */
+extern void test__f_thread_mutex_attribute_shared_set__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_attribute_shared_set()
+ */
+extern void test__f_thread_mutex_attribute_shared_set__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attribute_shared_set_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_attribute_type_get.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attribute_type_get__fails(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int type = 0;
+
+ int errnos[] = {
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 1; ++i) {
+
+ will_return(__wrap_pthread_mutexattr_gettype, true);
+ will_return(__wrap_pthread_mutexattr_gettype, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_attribute_type_get(&attribute, &type);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_attribute_type_get__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_type_get(0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_attribute_type_get__works(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int type = 0;
+
+ {
+ will_return(__wrap_pthread_mutexattr_gettype, false);
+
+ const f_status_t status = f_thread_mutex_attribute_type_get(&attribute, &type);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_attribute_type_get_h
+#define _TEST__F_thread__mutex_attribute_type_get_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_attribute_type_get()
+ */
+extern void test__f_thread_mutex_attribute_type_get__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_attribute_type_get()
+ */
+extern void test__f_thread_mutex_attribute_type_get__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_attribute_type_get()
+ */
+extern void test__f_thread_mutex_attribute_type_get__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attribute_type_get_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_attribute_type_set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_attribute_type_set__fails(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int type = 0;
+
+ int errnos[] = {
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 2; ++i) {
+
+ will_return(__wrap_pthread_mutexattr_settype, true);
+ will_return(__wrap_pthread_mutexattr_settype, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_attribute_type_set(type, &attribute);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_attribute_type_set__parameter_checking(void **state) {
+
+ int type = 0;
+
+ {
+ const f_status_t status = f_thread_mutex_attribute_type_set(type, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_attribute_type_set__works(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ int type = 0;
+
+ {
+ will_return(__wrap_pthread_mutexattr_settype, false);
+
+ const f_status_t status = f_thread_mutex_attribute_type_set(type, &attribute);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_attribute_type_set_h
+#define _TEST__F_thread__mutex_attribute_type_set_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_attribute_type_set()
+ */
+extern void test__f_thread_mutex_attribute_type_set__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_attribute_type_set()
+ */
+extern void test__f_thread_mutex_attribute_type_set__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_attribute_type_set()
+ */
+extern void test__f_thread_mutex_attribute_type_set__works(void **state);
+
+#endif // _TEST__F_thread__mutex_attribute_type_set_h
}
{
+ 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);
}
{
+ 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);
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_create.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_create__fails(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EBUSY,
+ EINVAL,
+ ENOMEM,
+ EPERM,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_resource_not,
+ F_busy,
+ F_parameter,
+ F_memory_not,
+ F_prohibited,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 6; ++i) {
+
+ will_return(__wrap_pthread_mutex_init, true);
+ will_return(__wrap_pthread_mutex_init, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_create(&attribute, &mutex);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_create__parameter_checking(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+
+ {
+ const f_status_t status = f_thread_mutex_create(&attribute, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_create__works(void **state) {
+
+ f_thread_mutex_attribute_t attribute = f_thread_mutex_attribute_t_initialize;
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ {
+ will_return(__wrap_pthread_mutex_init, false);
+
+ const f_status_t status = f_thread_mutex_create(&attribute, &mutex);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_create_h
+#define _TEST__F_thread__mutex_create_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_create()
+ */
+extern void test__f_thread_mutex_create__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_create()
+ */
+extern void test__f_thread_mutex_create__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_create()
+ */
+extern void test__f_thread_mutex_create__works(void **state);
+
+#endif // _TEST__F_thread__mutex_create_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_delete__fails(void **state) {
+
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ int errnos[] = {
+ EBUSY,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_busy,
+ F_parameter,
+ 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_mutex_delete(&mutex);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_mutex_delete(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_delete__works(void **state) {
+
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ {
+ will_return(__wrap_pthread_mutex_destroy, false);
+
+ const f_status_t status = f_thread_mutex_delete(&mutex);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_delete_h
+#define _TEST__F_thread__mutex_delete_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_delete()
+ */
+extern void test__f_thread_mutex_delete__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_delete()
+ */
+extern void test__f_thread_mutex_delete__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_delete()
+ */
+extern void test__f_thread_mutex_delete__works(void **state);
+
+#endif // _TEST__F_thread__mutex_delete_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_lock.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_lock__fails(void **state) {
+
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ int errnos[] = {
+ EAGAIN,
+ EDEADLK,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_resource_not,
+ F_deadlock,
+ F_parameter,
+ F_failure,
+ };
+
+ for (uint8_t i = 0; i < 4; ++i) {
+
+ will_return(__wrap_pthread_mutex_lock, true);
+ will_return(__wrap_pthread_mutex_lock, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_lock(&mutex);
+
+ assert_int_equal(status, F_status_set_error(statuss[i]));
+ } // for
+}
+
+void test__f_thread_mutex_lock__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_mutex_lock(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_lock__works(void **state) {
+
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+
+ {
+ will_return(__wrap_pthread_mutex_lock, false);
+
+ const f_status_t status = f_thread_mutex_lock(&mutex);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_lock_h
+#define _TEST__F_thread__mutex_lock_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_lock()
+ */
+extern void test__f_thread_mutex_lock__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_lock()
+ */
+extern void test__f_thread_mutex_lock__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_lock()
+ */
+extern void test__f_thread_mutex_lock__works(void **state);
+
+#endif // _TEST__F_thread__mutex_lock_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_lock_timed.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_lock_timed__fails(void **state) {
+
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+ struct timespec timeout;
+
+ memset(&timeout, 0, sizeof(struct timespec));
+
+ int errnos[] = {
+ EAGAIN,
+ EDEADLK,
+ EINVAL,
+ ENOTRECOVERABLE,
+ EOWNERDEAD,
+ ETIMEDOUT,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_status_set_error(F_resource_not),
+ F_status_set_error(F_deadlock),
+ F_status_set_error(F_parameter),
+ F_status_set_error(F_recover_not),
+ F_status_set_error(F_dead),
+ F_time,
+ F_status_set_error(F_failure),
+ };
+
+ for (uint8_t i = 0; i < 7; ++i) {
+
+ will_return(__wrap_pthread_mutex_timedlock, true);
+ will_return(__wrap_pthread_mutex_timedlock, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_lock_timed(&timeout, &mutex);
+
+ assert_int_equal(status, statuss[i]);
+ } // for
+}
+
+void test__f_thread_mutex_lock_timed__parameter_checking(void **state) {
+
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+ struct timespec timeout;
+
+ memset(&timeout, 0, sizeof(struct timespec));
+
+ {
+ const f_status_t status = f_thread_mutex_lock_timed(0, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_mutex_lock_timed(&timeout, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+
+ {
+ const f_status_t status = f_thread_mutex_lock_timed(0, &mutex);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_lock_timed__works(void **state) {
+
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+ struct timespec timeout;
+
+ memset(&timeout, 0, sizeof(struct timespec));
+
+ {
+ will_return(__wrap_pthread_mutex_timedlock, false);
+
+ const f_status_t status = f_thread_mutex_lock_timed(&timeout, &mutex);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_lock_timed_h
+#define _TEST__F_thread__mutex_lock_timed_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_lock_timed()
+ */
+extern void test__f_thread_mutex_lock_timed__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_lock_timed()
+ */
+extern void test__f_thread_mutex_lock_timed__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_lock_timed()
+ */
+extern void test__f_thread_mutex_lock_timed__works(void **state);
+
+#endif // _TEST__F_thread__mutex_lock_timed_h
--- /dev/null
+#include "test-thread.h"
+#include "test-thread-mutex_lock_try.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_thread_mutex_lock_try__fails(void **state) {
+
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+ struct timespec timeout;
+
+ memset(&timeout, 0, sizeof(struct timespec));
+
+ int errnos[] = {
+ EAGAIN,
+ EBUSY,
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_status_set_error(F_resource_not),
+ F_busy,
+ F_status_set_error(F_parameter),
+ F_status_set_error(F_failure),
+ };
+
+ for (uint8_t i = 0; i < 4; ++i) {
+
+ will_return(__wrap_pthread_mutex_trylock, true);
+ will_return(__wrap_pthread_mutex_trylock, errnos[i]);
+
+ const f_status_t status = f_thread_mutex_lock_try(&mutex);
+
+ assert_int_equal(status, statuss[i]);
+ } // for
+}
+
+void test__f_thread_mutex_lock_try__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_thread_mutex_lock_try(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+void test__f_thread_mutex_lock_try__works(void **state) {
+
+ f_thread_mutex_t mutex = f_thread_mutex_t_initialize;
+ struct timespec timeout;
+
+ memset(&timeout, 0, sizeof(struct timespec));
+
+ {
+ will_return(__wrap_pthread_mutex_trylock, false);
+
+ const f_status_t status = f_thread_mutex_lock_try(&mutex);
+
+ assert_int_equal(status, F_none);
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Thread
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the thread project.
+ */
+#ifndef _TEST__F_thread__mutex_lock_try_h
+#define _TEST__F_thread__mutex_lock_try_h
+
+/**
+ * Test that function fails.
+ *
+ * @see f_thread_mutex_lock_try()
+ */
+extern void test__f_thread_mutex_lock_try__fails(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_thread_mutex_lock_try()
+ */
+extern void test__f_thread_mutex_lock_try__parameter_checking(void **state);
+
+/**
+ * Test that function works.
+ *
+ * @see f_thread_mutex_lock_try()
+ */
+extern void test__f_thread_mutex_lock_try__works(void **state);
+
+#endif // _TEST__F_thread__mutex_lock_try_h
}
{
+ 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);
}
{
+ 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);
}
{
+ 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);
}
{
+ 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);
cmocka_unit_test(test__f_thread_attribute_affinity_set__fails),
cmocka_unit_test(test__f_thread_attribute_affinity_set__works),
- cmocka_unit_test(test__f_thread_attribute_condition_clock_get__fails),
- cmocka_unit_test(test__f_thread_attribute_condition_clock_get__works),
+ cmocka_unit_test(test__f_thread_attribute_concurrency_get__works),
- cmocka_unit_test(test__f_thread_attribute_condition_clock_set__fails),
- cmocka_unit_test(test__f_thread_attribute_condition_clock_set__works),
-
- cmocka_unit_test(test__f_thread_attribute_condition_shared_get__fails),
- cmocka_unit_test(test__f_thread_attribute_condition_shared_get__works),
-
- cmocka_unit_test(test__f_thread_attribute_condition_shared_set__fails),
- cmocka_unit_test(test__f_thread_attribute_condition_shared_set__works),
+ cmocka_unit_test(test__f_thread_attribute_concurrency_set__fails),
+ cmocka_unit_test(test__f_thread_attribute_concurrency_set__works),
cmocka_unit_test(test__f_thread_attribute_create__fails),
cmocka_unit_test(test__f_thread_attribute_create__works),
cmocka_unit_test(test__f_thread_barrier_wait__works),
+ cmocka_unit_test(test__f_thread_caller__works),
+
+ cmocka_unit_test(test__f_thread_cancel__fails),
+ cmocka_unit_test(test__f_thread_cancel__works),
+
+ cmocka_unit_test(test__f_thread_cancel_state_set__fails),
+ cmocka_unit_test(test__f_thread_cancel_state_set__works),
+
+ cmocka_unit_test(test__f_thread_cancel_test__works),
+
+ cmocka_unit_test(test__f_thread_cancel_type_set__fails),
+ cmocka_unit_test(test__f_thread_cancel_type_set__works),
+
+ cmocka_unit_test(test__f_thread_clock_get_id__fails),
+ cmocka_unit_test(test__f_thread_clock_get_id__works),
+
+ cmocka_unit_test(test__f_thread_compare__works),
+
+ cmocka_unit_test(test__f_thread_condition_attribute_clock_get__fails),
+ cmocka_unit_test(test__f_thread_condition_attribute_clock_get__works),
+
+ cmocka_unit_test(test__f_thread_condition_attribute_clock_set__fails),
+ cmocka_unit_test(test__f_thread_condition_attribute_clock_set__works),
+
+ cmocka_unit_test(test__f_thread_condition_attribute_create__fails),
+ cmocka_unit_test(test__f_thread_condition_attribute_create__works),
+
+ cmocka_unit_test(test__f_thread_condition_attribute_delete__fails),
+ cmocka_unit_test(test__f_thread_condition_attribute_delete__works),
+
+ cmocka_unit_test(test__f_thread_condition_attribute_shared_get__fails),
+ cmocka_unit_test(test__f_thread_condition_attribute_shared_get__works),
+
+ cmocka_unit_test(test__f_thread_condition_attribute_shared_set__fails),
+ cmocka_unit_test(test__f_thread_condition_attribute_shared_set__works),
+
+ cmocka_unit_test(test__f_thread_condition_create__fails),
+ cmocka_unit_test(test__f_thread_condition_create__works),
+
+ cmocka_unit_test(test__f_thread_condition_delete__fails),
+ cmocka_unit_test(test__f_thread_condition_delete__works),
+
+ cmocka_unit_test(test__f_thread_condition_wait__fails),
+ cmocka_unit_test(test__f_thread_condition_wait__works),
+
+ cmocka_unit_test(test__f_thread_condition_wait_timed__fails),
+ cmocka_unit_test(test__f_thread_condition_wait_timed__works),
+
+ cmocka_unit_test(test__f_thread_create__fails),
+ cmocka_unit_test(test__f_thread_create__works),
+
+ cmocka_unit_test(test__f_thread_detach__fails),
+ cmocka_unit_test(test__f_thread_detach__works),
+
+ // Mocking pthread_exit() appears to still result in an exit() call and cannot be tested until this is resolved.
+ //cmocka_unit_test(test__f_thread_exit__works),
+
+ cmocka_unit_test(test__f_thread_join__fails),
+ cmocka_unit_test(test__f_thread_join__works),
+
+ cmocka_unit_test(test__f_thread_join_timed__fails),
+ cmocka_unit_test(test__f_thread_join_timed__works),
+
+ cmocka_unit_test(test__f_thread_join_try__fails),
+ cmocka_unit_test(test__f_thread_join_try__works),
+
+ cmocka_unit_test(test__f_thread_key_create__fails),
+ cmocka_unit_test(test__f_thread_key_create__works),
+
+ cmocka_unit_test(test__f_thread_key_delete__works),
+
+ cmocka_unit_test(test__f_thread_key_get__works),
+
+ cmocka_unit_test(test__f_thread_key_set__fails),
+ cmocka_unit_test(test__f_thread_key_set__works),
+
+ cmocka_unit_test(test__f_thread_lock_attribute_create__fails),
+ cmocka_unit_test(test__f_thread_lock_attribute_create__works),
+
+ cmocka_unit_test(test__f_thread_lock_attribute_delete__works),
+
+ cmocka_unit_test(test__f_thread_lock_attribute_shared_get__fails),
+ cmocka_unit_test(test__f_thread_lock_attribute_shared_get__works),
+
+ cmocka_unit_test(test__f_thread_lock_attribute_shared_set__fails),
+ cmocka_unit_test(test__f_thread_lock_attribute_shared_set__works),
+
+ cmocka_unit_test(test__f_thread_lock_create__fails),
+ cmocka_unit_test(test__f_thread_lock_create__works),
+
+ cmocka_unit_test(test__f_thread_lock_delete__fails),
+ cmocka_unit_test(test__f_thread_lock_delete__works),
+
+ cmocka_unit_test(test__f_thread_lock_read__fails),
+ cmocka_unit_test(test__f_thread_lock_read__works),
+
+ cmocka_unit_test(test__f_thread_lock_read_timed__fails),
+ cmocka_unit_test(test__f_thread_lock_read_timed__works),
+
+ cmocka_unit_test(test__f_thread_lock_read_try__fails),
+ cmocka_unit_test(test__f_thread_lock_read_try__works),
+
+ cmocka_unit_test(test__f_thread_lock_write__fails),
+ cmocka_unit_test(test__f_thread_lock_write__works),
+
+ cmocka_unit_test(test__f_thread_lock_write_timed__fails),
+ cmocka_unit_test(test__f_thread_lock_write_timed__works),
+
+ cmocka_unit_test(test__f_thread_lock_write_try__fails),
+ cmocka_unit_test(test__f_thread_lock_write_try__works),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_create__fails),
+ cmocka_unit_test(test__f_thread_mutex_attribute_create__works),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_delete__fails),
+ cmocka_unit_test(test__f_thread_mutex_attribute_delete__works),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_priority_ceiling_get__fails),
+ cmocka_unit_test(test__f_thread_mutex_attribute_priority_ceiling_get__works),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_priority_ceiling_set__fails),
+ cmocka_unit_test(test__f_thread_mutex_attribute_priority_ceiling_set__works),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_shared_get__fails),
+ cmocka_unit_test(test__f_thread_mutex_attribute_shared_get__works),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_shared_set__fails),
+ cmocka_unit_test(test__f_thread_mutex_attribute_shared_set__works),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_type_get__fails),
+ cmocka_unit_test(test__f_thread_mutex_attribute_type_get__works),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_type_set__fails),
+ cmocka_unit_test(test__f_thread_mutex_attribute_type_set__works),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_protocol_get__fails),
+ cmocka_unit_test(test__f_thread_mutex_attribute_protocol_get__works),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_protocol_set__fails),
+ cmocka_unit_test(test__f_thread_mutex_attribute_protocol_set__works),
+
+ cmocka_unit_test(test__f_thread_mutex_create__fails),
+ cmocka_unit_test(test__f_thread_mutex_create__works),
+
+ cmocka_unit_test(test__f_thread_mutex_delete__fails),
+ cmocka_unit_test(test__f_thread_mutex_delete__works),
+
+ cmocka_unit_test(test__f_thread_mutex_lock__fails),
+ cmocka_unit_test(test__f_thread_mutex_lock__works),
+
+ cmocka_unit_test(test__f_thread_mutex_lock_timed__fails),
+ cmocka_unit_test(test__f_thread_mutex_lock_timed__works),
+
+ cmocka_unit_test(test__f_thread_mutex_lock_try__fails),
+ cmocka_unit_test(test__f_thread_mutex_lock_try__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_attribute_affinity_get__parameter_checking),
cmocka_unit_test(test__f_thread_attribute_affinity_set__parameter_checking),
- cmocka_unit_test(test__f_thread_attribute_condition_clock_get__parameter_checking),
- cmocka_unit_test(test__f_thread_attribute_condition_clock_set__parameter_checking),
-
- cmocka_unit_test(test__f_thread_attribute_condition_shared_get__parameter_checking),
- cmocka_unit_test(test__f_thread_attribute_condition_shared_set__parameter_checking),
+ cmocka_unit_test(test__f_thread_attribute_concurrency_get__parameter_checking),
+ // f_thread_attribute_concurrency_set() doesn't use parameter checking.
cmocka_unit_test(test__f_thread_attribute_create__parameter_checking),
cmocka_unit_test(test__f_thread_barrier_delete__parameter_checking),
cmocka_unit_test(test__f_thread_barrier_wait__parameter_checking),
- #endif // _di_level_0_parameter_checking_
- // f_thread_user_set() doesn't use parameter checking.
+ // f_thread_caller() doesn't use parameter checking.
+
+ // f_thread_cancel() doesn't use parameter checking.
+
+ // f_thread_cancel_state_set() doesn't use parameter checking.
+
+ // f_thread_cancel_test() doesn't use parameter checking.
+
+ // f_thread_cancel_type_set() doesn't use parameter checking.
+
+ cmocka_unit_test(test__f_thread_clock_get_id__parameter_checking),
+
+ // f_thread_compare() doesn't use parameter checking.
+
+ cmocka_unit_test(test__f_thread_condition_attribute_clock_get__parameter_checking),
+ cmocka_unit_test(test__f_thread_condition_attribute_clock_set__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_condition_attribute_create__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_condition_attribute_delete__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_condition_attribute_shared_get__parameter_checking),
+ cmocka_unit_test(test__f_thread_condition_attribute_shared_set__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_condition_create__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_condition_signal__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_condition_signal_all__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_condition_wait__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_condition_wait_timed__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_create__parameter_checking),
+
+ // f_thread_detach() doesn't use parameter checking.
+
+ cmocka_unit_test(test__f_thread_exit__parameter_checking),
+
+ // f_thread_join() doesn't use parameter checking.
+
+ // f_thread_join_timed() doesn't use parameter checking.
+
+ // f_thread_join_try() doesn't use parameter checking.
+
+ cmocka_unit_test(test__f_thread_key_create__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_key_delete__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_key_get__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_key_set__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_attribute_create__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_attribute_delete__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_attribute_shared_get__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_attribute_shared_set__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_create__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_delete__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_read__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_read_timed__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_read_try__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_write__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_write_timed__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_lock_write_try__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_create__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_delete__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_priority_ceiling_get__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_priority_ceiling_set__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_shared_get__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_shared_set__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_type_get__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_type_set__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_protocol_get__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_attribute_protocol_set__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_create__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_delete__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_lock__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_lock_timed__parameter_checking),
+
+ cmocka_unit_test(test__f_thread_mutex_lock_try__parameter_checking),
+ #endif // _di_level_0_parameter_checking_
};
return cmocka_run_group_tests(tests, setup, setdown);
#include "test-thread-at_fork.h"
#include "test-thread-attribute_affinity_get.h"
#include "test-thread-attribute_affinity_set.h"
-#include "test-thread-attribute_condition_clock_get.h"
-#include "test-thread-attribute_condition_clock_set.h"
-#include "test-thread-attribute_condition_shared_get.h"
-#include "test-thread-attribute_condition_shared_set.h"
+#include "test-thread-attribute_concurrency_get.h"
+#include "test-thread-attribute_concurrency_set.h"
#include "test-thread-attribute_create.h"
#include "test-thread-attribute_default_get.h"
#include "test-thread-attribute_default_set.h"
#include "test-thread-barrier_create.h"
#include "test-thread-barrier_delete.h"
#include "test-thread-barrier_wait.h"
+#include "test-thread-caller.h"
+#include "test-thread-cancel.h"
+#include "test-thread-cancel_state_set.h"
+#include "test-thread-cancel_test.h"
+#include "test-thread-cancel_type_set.h"
+#include "test-thread-clock_get_id.h"
+#include "test-thread-compare.h"
+#include "test-thread-condition_attribute_clock_get.h"
+#include "test-thread-condition_attribute_clock_set.h"
+#include "test-thread-condition_attribute_create.h"
+#include "test-thread-condition_attribute_delete.h"
+#include "test-thread-condition_attribute_shared_get.h"
+#include "test-thread-condition_attribute_shared_set.h"
+#include "test-thread-condition_create.h"
+#include "test-thread-condition_delete.h"
+#include "test-thread-condition_signal.h"
+#include "test-thread-condition_signal_all.h"
+#include "test-thread-condition_wait.h"
+#include "test-thread-condition_wait_timed.h"
+#include "test-thread-create.h"
+#include "test-thread-detach.h"
+#include "test-thread-exit.h"
+#include "test-thread-join.h"
+#include "test-thread-join_try.h"
+#include "test-thread-join_timed.h"
+#include "test-thread-key_create.h"
+#include "test-thread-key_delete.h"
+#include "test-thread-key_get.h"
+#include "test-thread-key_set.h"
+#include "test-thread-lock_attribute_create.h"
+#include "test-thread-lock_attribute_delete.h"
+#include "test-thread-lock_attribute_shared_get.h"
+#include "test-thread-lock_attribute_shared_set.h"
+#include "test-thread-lock_create.h"
+#include "test-thread-lock_delete.h"
+#include "test-thread-lock_read.h"
+#include "test-thread-lock_read_timed.h"
+#include "test-thread-lock_read_try.h"
+#include "test-thread-lock_write.h"
+#include "test-thread-lock_write_timed.h"
+#include "test-thread-lock_write_try.h"
+#include "test-thread-mutex_attribute_create.h"
+#include "test-thread-mutex_attribute_delete.h"
+#include "test-thread-mutex_attribute_priority_ceiling_get.h"
+#include "test-thread-mutex_attribute_priority_ceiling_set.h"
+#include "test-thread-mutex_attribute_shared_get.h"
+#include "test-thread-mutex_attribute_shared_set.h"
+#include "test-thread-mutex_attribute_type_get.h"
+#include "test-thread-mutex_attribute_type_set.h"
+#include "test-thread-mutex_attribute_protocol_get.h"
+#include "test-thread-mutex_attribute_protocol_set.h"
+#include "test-thread-mutex_create.h"
+#include "test-thread-mutex_delete.h"
+#include "test-thread-mutex_lock.h"
+#include "test-thread-mutex_lock_timed.h"
+#include "test-thread-mutex_lock_try.h"
#ifdef __cplusplus
extern "C" {