The tests are not used and there are no functions to test.
Remove the `@todo` regarding adding delete and destroy functions for `f_thread_once_t`.
Document the reasons for this in the documentation comments.
* A typedef representing pthread_once_t.
*
* There are no delete functions and therefore no delete macros.
+ *
+ * This does not provide a clear macro because pthread_once_t requires special functions to perform a clear.
*/
#ifndef _di_f_thread_once_t_
typedef pthread_once_t f_thread_once_t;
/**
* An array of thread onces.
*
+ * There are no delete or destroy callbacks because pthread_once_t does not support deletions.
+ *
* Properties:
* - array: The array of f_thread_once_t.
* - used: Total number of allocated spaces used.
}
#endif // _di_f_thread_onces_t_
-// @todo add delete & destroy callbacks.
-
#ifdef __cplusplus
} // extern "C"
#endif
/**
* An array of an array of thread onces.
*
+ * There are no delete or destroy callbacks because pthread_once_t does not support deletions.
+ *
* Properties:
* - array: The array of f_thread_onces_t.
* - used: Total number of allocated spaces used.
}
#endif // _di_f_thread_oncess_t_
-// @todo add delete & destroy callbacks.
-
#ifdef __cplusplus
} // extern "C"
#endif
+++ /dev/null
-#include "test-thread.h"
-#include "test-thread-onces_delete_callback.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_onces_delete_callback__fails(void **state) {
-
- f_thread_once_t data = f_thread_once_t_initialize;
- f_thread_once_t data_array[] = { data };
- f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_thread_onces_t datass_array[] = { datas };
-
- int errnos[] = {
- 1,
- mock_errno_generic,
- };
-
- f_status_t statuss[] = {
- F_status_set_error(F_failure),
- F_status_set_error(F_failure),
- };
-
- for (uint8_t i = 0; i < 2; ++i) {
-
- will_return(__wrap_pthread_attr_destroy, true);
- will_return(__wrap_pthread_attr_destroy, errnos[i]);
-
- const f_status_t status = f_thread_onces_delete_callback(0, 1, (void *) datass_array);
-
- assert_int_equal(status, statuss[i]);
- } // for
-}
-
-void test__f_thread_onces_delete_callback__works(void **state) {
-
- f_thread_once_t data = f_thread_once_t_initialize;
- f_thread_once_t data_array[] = { data };
- f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_thread_onces_t datass_array[] = { datas };
- const f_number_unsigned_t length = 1;
-
- {
- will_return(__wrap_pthread_attr_destroy, false);
-
- const f_status_t status = f_thread_onces_delete_callback(0, length, (void *) datass_array);
-
- assert_int_equal(status, F_okay);
- }
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_thread__onces_delete_callback
-#define _TEST__F_thread__onces_delete_callback
-
-/**
- * Test that the function fails.
- *
- * @see f_thread_onces_delete_callback_()
- */
-extern void test__f_thread_onces_delete_callback__fails(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_onces_delete_callback_()
- */
-extern void test__f_thread_onces_delete_callback__works(void **state);
-
-#endif // _TEST__F_thread__onces_delete_callback
+++ /dev/null
-#include "test-thread.h"
-#include "test-thread-onces_destroy_callback.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_onces_destroy_callback__fails(void **state) {
-
- f_thread_once_t data = f_thread_once_t_initialize;
- f_thread_once_t data_array[] = { data };
- f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_thread_onces_t datass_array[] = { datas };
-
- int errnos[] = {
- 1,
- mock_errno_generic,
- };
-
- f_status_t statuss[] = {
- F_status_set_error(F_failure),
- F_status_set_error(F_failure),
- };
-
- for (uint8_t i = 0; i < 2; ++i) {
-
- will_return(__wrap_pthread_attr_destroy, true);
- will_return(__wrap_pthread_attr_destroy, errnos[i]);
-
- const f_status_t status = f_thread_onces_destroy_callback(0, 1, (void *) datass_array);
-
- assert_int_equal(status, statuss[i]);
- } // for
-}
-
-void test__f_thread_onces_destroy_callback__works(void **state) {
-
- f_thread_once_t data = f_thread_once_t_initialize;
- f_thread_once_t data_array[] = { data };
- f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_thread_onces_t datass_array[] = { datas };
- const f_number_unsigned_t length = 1;
-
- {
- will_return(__wrap_pthread_attr_destroy, false);
-
- const f_status_t status = f_thread_onces_destroy_callback(0, length, (void *) datass_array);
-
- assert_int_equal(status, F_okay);
- }
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_thread__onces_destroy_callback
-#define _TEST__F_thread__onces_destroy_callback
-
-/**
- * Test that the function fails.
- *
- * @see f_thread_onces_destroy_callback_()
- */
-extern void test__f_thread_onces_destroy_callback__fails(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_onces_destroy_callback_()
- */
-extern void test__f_thread_onces_destroy_callback__works(void **state);
-
-#endif // _TEST__F_thread__onces_destroy_callback
+++ /dev/null
-#include "test-thread.h"
-#include "test-thread-oncess_delete_callback.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_oncess_delete_callback__fails(void **state) {
-
- f_thread_once_t data = f_thread_once_t_initialize;
- f_thread_once_t data_array[] = { data };
- f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_thread_onces_t datas_array[] = { datas };
- f_thread_oncess_t datass = { .array = datas_array, .used = 1, .size = 1 };
- f_thread_oncess_t datass_array[] = { datass };
-
- int errnos[] = {
- 1,
- mock_errno_generic,
- };
-
- f_status_t statuss[] = {
- F_status_set_error(F_failure),
- F_status_set_error(F_failure),
- };
-
- for (uint8_t i = 0; i < 2; ++i) {
-
- will_return(__wrap_pthread_attr_destroy, true);
- will_return(__wrap_pthread_attr_destroy, errnos[i]);
-
- const f_status_t status = f_thread_oncess_delete_callback(0, 1, (void *) datass_array);
-
- assert_int_equal(status, statuss[i]);
- } // for
-}
-
-void test__f_thread_oncess_delete_callback__works(void **state) {
-
- f_thread_once_t data = f_thread_once_t_initialize;
- f_thread_once_t data_array[] = { data };
- f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_thread_onces_t datas_array[] = { datas };
- f_thread_oncess_t datass = { .array = datas_array, .used = 1, .size = 1 };
- f_thread_oncess_t datass_array[] = { datass };
- const f_number_unsigned_t length = 1;
-
- {
- will_return(__wrap_pthread_attr_destroy, false);
- will_return(__wrap_f_memory_array_resize, false);
- will_return(__wrap_f_memory_array_resize, F_okay);
-
- const f_status_t status = f_thread_oncess_delete_callback(0, length, (void *) datass_array);
-
- assert_int_equal(status, F_okay);
- }
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_thread__oncess_delete_callback
-#define _TEST__F_thread__oncess_delete_callback
-
-/**
- * Test that the function fails.
- *
- * @see f_thread_oncess_delete_callback_()
- */
-extern void test__f_thread_oncess_delete_callback__fails(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_oncess_delete_callback_()
- */
-extern void test__f_thread_oncess_delete_callback__works(void **state);
-
-#endif // _TEST__F_thread__oncess_delete_callback
+++ /dev/null
-#include "test-thread.h"
-#include "test-thread-oncess_destroy_callback.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void test__f_thread_oncess_destroy_callback__fails(void **state) {
-
- f_thread_once_t data = f_thread_once_t_initialize;
- f_thread_once_t data_array[] = { data };
- f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_thread_onces_t datas_array[] = { datas };
- f_thread_oncess_t datass = { .array = datas_array, .used = 1, .size = 1 };
- f_thread_oncess_t datass_array[] = { datass };
-
- int errnos[] = {
- 1,
- mock_errno_generic,
- };
-
- f_status_t statuss[] = {
- F_status_set_error(F_failure),
- F_status_set_error(F_failure),
- };
-
- for (uint8_t i = 0; i < 2; ++i) {
-
- will_return(__wrap_pthread_attr_destroy, true);
- will_return(__wrap_pthread_attr_destroy, errnos[i]);
-
- const f_status_t status = f_thread_oncess_destroy_callback(0, 1, (void *) datass_array);
-
- assert_int_equal(status, statuss[i]);
- } // for
-}
-
-void test__f_thread_oncess_destroy_callback__works(void **state) {
-
- f_thread_once_t data = f_thread_once_t_initialize;
- f_thread_once_t data_array[] = { data };
- f_thread_onces_t datas = { .array = data_array, .used = 1, .size = 1 };
- f_thread_onces_t datas_array[] = { datas };
- f_thread_oncess_t datass = { .array = datas_array, .used = 1, .size = 1 };
- f_thread_oncess_t datass_array[] = { datass };
- const f_number_unsigned_t length = 1;
-
- {
- will_return(__wrap_pthread_attr_destroy, false);
- will_return(__wrap_f_memory_array_adjust, false);
- will_return(__wrap_f_memory_array_adjust, F_okay);
-
- const f_status_t status = f_thread_oncess_destroy_callback(0, length, (void *) datass_array);
-
- assert_int_equal(status, F_okay);
- }
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Thread
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Test the array types in the type project.
- */
-#ifndef _TEST__F_thread__oncess_destroy_callback
-#define _TEST__F_thread__oncess_destroy_callback
-
-/**
- * Test that the function fails.
- *
- * @see f_thread_oncess_destroy_callback_()
- */
-extern void test__f_thread_oncess_destroy_callback__fails(void **state);
-
-/**
- * Test that the function works.
- *
- * @see f_thread_oncess_destroy_callback_()
- */
-extern void test__f_thread_oncess_destroy_callback__works(void **state);
-
-#endif // _TEST__F_thread__oncess_destroy_callback